+2005-03-02 Daiki Ueno <ueno@unixuser.org>
+
+ * riece-log.el (riece-log-lock-file): Define with defvar.
+ (riece-log-display-message-function): Use riece-log-lock-file as
+ LOCKNAME of write-region.
+ (riece-log-insinuate): Set riece-log-lock-file.
+
2005-02-27 Daiki Ueno <ueno@unixuser.org>
* riece-300.el (riece-handle-317-message): Format idle seconds in
:type 'directory
:group 'riece-log)
-(defcustom riece-log-lock-directory
- (expand-file-name "=lock" riece-log-directory)
- "*Lock directory for riece-log.
-It is created if there is at least one instance of Emacs running riece-log."
- :type 'directory
- :group 'riece-log)
-
(defcustom riece-log-directory-map nil
"*The map of channel name and directory name."
:type '(repeat (cons (string :tag "Channel name")
:group 'riece-highlight-faces)
(defvar riece-log-date-face 'riece-log-date-face)
+(defvar riece-log-lock-file nil
+ "Lock file for riece-log.
+It is created if there is at least one instance of Emacs running riece-log.")
+
(defvar riece-log-enabled nil)
(defconst riece-log-description
(make-directory (file-name-directory file) t))
(write-region (concat (format-time-string "%H:%M") " "
(riece-format-message message))
- nil file t 0))))
+ nil file t 0
+ riece-log-lock-file))))
(defun riece-log-get-file (identity)
(expand-file-name
'(riece-button)))
(defun riece-log-insinuate ()
+ (make-directory riece-log-directory t)
+ (setq riece-log-lock-file
+ (expand-file-name (format "=lock.%s@%s.%d"
+ (user-login-name)
+ (system-name)
+ (emacs-pid))
+ riece-log-directory))
;; FIXME: Use `riece-after-insert-functions' for trapping change,
;; notice, wallops and so on. But must add argument.
(add-hook 'riece-after-display-message-functions
(defvar riece-command-mode-map)
(defun riece-log-enable ()
(define-key riece-command-mode-map "\C-cd" 'riece-log-open-directory)
- (make-directory riece-log-directory t)
- (condition-case nil
- (progn
- (make-directory riece-log-lock-directory)
- (add-hook 'riece-exit-hook
- (lambda ()
- (condition-case nil
- (delete-directory riece-log-lock-directory)
- (error))))
- (setq riece-log-enabled t))
- (error
- (if riece-debug
- (message "Can't create lock directory for riece-log")))))
+ (setq riece-log-enabled t))
(defun riece-log-disable ()
(define-key riece-command-mode-map "\C-cd" nil)