(riece-make-local-hook): New alias.
(riece-derived-mode-p): New alias.
(riece-set-process-query-on-exit-flag): New alias.
+2008-06-06 Daiki Ueno <ueno@unixuser.org>
+
+ * riece-compat.el (riece-make-local-hook): New alias.
+ (riece-derived-mode-p): New alias.
+ (riece-set-process-query-on-exit-flag): New alias.
+
2008-06-05 TAKAHASHI Kaoru <kaoru@kaisei.org>
* riece-options.el (riece-server-alist): Fix :value for username,
(not (looking-at (format "NOTICE CONNECTED %d"
(process-id process))))))
(accept-process-output process))))
- (process-kill-without-query process)
+ (riece-set-process-query-on-exit-flag process nil)
process))
(defun riece-async-insinuate ()
(let ((buffers riece-buffer-list))
(while buffers
(set-buffer (car buffers))
- (if (eq (derived-mode-class major-mode)
- 'riece-dialogue-mode)
+ (if (riece-derived-mode-p 'riece-dialogue-mode)
(riece-button-dialogue-mode-hook))
(setq buffers (cdr buffers)))))
(add-hook 'riece-channel-list-mode-hook
(let ((pointer riece-buffer-list))
(while pointer
(with-current-buffer (car pointer)
- (if (eq (derived-mode-class major-mode)
- 'riece-dialogue-mode)
+ (if (riece-derived-mode-p 'riece-dialogue-mode)
(riece-button-update-buffer)))
(setq pointer (cdr pointer)))
(if riece-current-channel
(require 'riece-message)
(require 'riece-mcat)
-(autoload 'derived-mode-class "derived")
-
;;; Channel movement:
(defun riece-command-switch-to-channel (channel)
(interactive (list (riece-completing-read-identity
(riece-line-beginning-position)
(riece-line-end-position))
nil)
- (let ((next-line-add-newlines t))
- (next-line 1)))
+ (if (> (forward-line) 0)
+ (insert "\n")))
(defun riece-command-enter-message-as-notice ()
"Send the current line to the current channel as NOTICE."
(riece-line-beginning-position)
(riece-line-end-position))
t)
- (let ((next-line-add-newlines t))
- (next-line 1)))
+ (if (> (forward-line) 0)
+ (insert "\n")))
(defun riece-command-enter-message-to-user (user)
"Send the current line to USER."
user)
(riece-display-message
(riece-make-message (riece-current-nickname) user text nil t)))
- (let ((next-line-add-newlines t))
- (next-line 1)))
+ (if (> (forward-line) 0)
+ (insert "\n")))
(defun riece-command-join-channel (target key)
(unless (riece-server-opened (riece-identity-server target))
"Prevent automatic scrolling of the dialogue window.
If prefix argument ARG is non-nil, toggle frozen status."
(interactive "P")
- (with-current-buffer (if (eq (derived-mode-class major-mode)
- 'riece-dialogue-mode)
+ (with-current-buffer (if (riece-derived-mode-p 'riece-dialogue-mode)
(current-buffer)
(if (and riece-channel-buffer-mode
riece-channel-buffer)
The difference from `riece-command-freeze' is that your messages are hidden.
If prefix argument ARG is non-nil, toggle frozen status."
(interactive "P")
- (with-current-buffer (if (eq (derived-mode-class major-mode)
- 'riece-dialogue-mode)
+ (with-current-buffer (if (riece-derived-mode-p 'riece-dialogue-mode)
(current-buffer)
(if (and riece-channel-buffer-mode
riece-channel-buffer)
(make-list (- max min) (concat regexp "?"))))
"")))
+(if (get 'make-local-hook 'byte-obsolete-info)
+ (defalias 'riece-make-local-hook 'ignore)
+ (defalias 'riece-make-local-hook 'make-local-hook))
+
+(autoload 'derived-mode-class "derived")
+(if (fboundp 'derived-mode-p)
+ (defalias 'riece-derived-mode-p 'derived-mode-p)
+ (defun riece-derived-mode-p (&rest modes)
+ (memq (derived-mode-class major-mode) modes)))
+
+(if (fboundp 'set-process-query-on-exit-flag)
+ (defalias 'riece-set-process-query-on-exit-flag
+ 'set-process-query-on-exit-flag)
+ (defun riece-set-process-query-on-exit-flag (process flag)
+ (process-kill-without-query process (not flag))))
+
(provide 'riece-compat)
;;; riece-compat.el ends here
(read-string (riece-mcat "Action: "))
(prog1 (read-from-minibuffer (riece-mcat "Action: ")
(cons message 0))
- (let ((next-line-add-newlines t))
- (next-line 1)))))))
+ (if (> (forward-line) 0)
+ (insert "\n")))))))
(if (equal action "")
(error "No action"))
(riece-send-string (format "PRIVMSG %s :\1ACTION %s\1\r\n"
(require 'riece-signal)
(require 'riece-mcat)
-(autoload 'derived-mode-class "derived")
-
(defvar riece-channel-buffer-format "*Channel:%s*"
"Format of channel message buffer.")
(defvar riece-channel-buffer-alist nil
(walk-windows
(lambda (window)
(with-current-buffer (window-buffer window)
- (if (eq (derived-mode-class major-mode)
- 'riece-dialogue-mode)
+ (if (riece-derived-mode-p 'riece-dialogue-mode)
(setq riece-freeze-indicator
(if (eq riece-freeze 'own)
"f"
(riece-display-message
(riece-make-message (riece-current-nickname) riece-current-channel
(concat "[encrypted:" string "]") nil t))
- (let ((next-line-add-newlines t))
- (next-line 1))))
+ (if (> (forward-line) 0)
+ (insert "\n"))))
(defun riece-command-set-passphrase (identity passphrase)
"Set PASSPHRASE associated with IDENTITY."
;; In XEmacs, auto-initialization of font-lock is not affective
;; when buffer-file-name is not set.
(font-lock-set-defaults)
- (make-local-hook 'after-change-functions)
+ (riece-make-local-hook 'after-change-functions)
(add-hook 'after-change-functions
'riece-highlight-hide-prefix nil t)
(if (get 'riece-highlight 'riece-addon-enabled)
(save-excursion
(while buffers
(set-buffer (car buffers))
- (if (eq (derived-mode-class major-mode)
- 'riece-dialogue-mode)
+ (if (riece-derived-mode-p 'riece-dialogue-mode)
(remove-hook 'after-change-functions
'riece-highlight-hide-prefix t))
(setq buffers (cdr buffers)))))
(defun riece-highlight-enable ()
(let ((buffers riece-buffer-list))
(while buffers
- (if (memq (derived-mode-class
- (with-current-buffer (car buffers)
- major-mode))
- '(riece-dialogue-mode riece-channel-list-mode))
+ (if (with-current-buffer (car buffers)
+ (riece-derived-mode-p 'riece-dialogue-mode
+ 'riece-channel-list-mode))
(with-current-buffer (car buffers)
(font-lock-mode 1)))
(setq buffers (cdr buffers)))))
(defun riece-highlight-disable ()
(let ((buffers riece-buffer-list))
(while buffers
- (if (memq (derived-mode-class
- (with-current-buffer (car buffers)
- major-mode))
- '(riece-dialogue-mode riece-channel-list-mode))
+ (if (with-current-buffer (car buffers)
+ (riece-derived-mode-p 'riece-dialogue-mode
+ 'riece-channel-list-mode))
(with-current-buffer (car buffers)
(font-lock-mode 0)))
(setq buffers (cdr buffers)))))
(expand-file-name riece-ruby-server-program
riece-data-directory)
riece-ruby-server-program-arguments))
- (process-kill-without-query riece-ruby-process)
+ (riece-set-process-query-on-exit-flag riece-ruby-process nil)
(set-process-filter riece-ruby-process #'riece-ruby-filter)
(set-process-sentinel riece-ruby-process #'riece-ruby-sentinel)))
(save-excursion
(while buffers
(if (and (get 'riece-shrink-buffer 'riece-addon-enabled)
(buffer-live-p (car buffers))
- (eq (derived-mode-class
- (with-current-buffer (car buffers)
- major-mode))
- 'riece-dialogue-mode))
+ (with-current-buffer (car buffers)
+ (riece-derived-mode-p 'riece-dialogue-mode)))
(riece-shrink-buffer (car buffers)))
(setq buffers (cdr buffers)))))
(require 'riece-addon)
(require 'riece-signal)
-(autoload 'derived-mode-class "derived")
-
(defvar riece-channel-list-mode-map (make-sparse-keymap))
(defvar riece-user-list-mode-map (make-sparse-keymap))
(setq riece-command-mode-syntax-table
(copy-syntax-table (syntax-table)))
(set-syntax-table riece-command-mode-syntax-table)
- (mapcar
- (lambda (c) (modify-syntax-entry c "w"))
- "^[]{}'`"))
+ (let* ((chars "^[]{}'`")
+ (length (length chars))
+ (index 0))
+ (while (< index length)
+ (modify-syntax-entry (aref chars index) "w")
+ (setq index (1+ index)))))
(run-hooks 'riece-command-mode-hook))
riece-mode-line-buffer-identification)
truncate-lines t
buffer-read-only t)
- (make-local-hook 'riece-update-buffer-functions)
+ (riece-make-local-hook 'riece-update-buffer-functions)
(add-hook 'riece-update-buffer-functions
'riece-update-channel-list-buffer nil t)
(use-local-map riece-channel-list-mode-map)
buffer-read-only t)
(if (boundp 'transient-mark-mode)
(set (make-local-variable 'transient-mark-mode) t))
- (make-local-hook 'riece-update-buffer-functions)
+ (riece-make-local-hook 'riece-update-buffer-functions)
(add-hook 'riece-update-buffer-functions
'riece-update-user-list-buffer nil t)
(use-local-map riece-user-list-mode-map)