Suppress compiler warnings.
authorueno <ueno>
Fri, 6 Jun 2008 04:12:03 +0000 (04:12 +0000)
committerueno <ueno>
Fri, 6 Jun 2008 04:12:03 +0000 (04:12 +0000)
(riece-make-local-hook): New alias.
(riece-derived-mode-p): New alias.
(riece-set-process-query-on-exit-flag): New alias.

12 files changed:
lisp/ChangeLog
lisp/riece-async.el
lisp/riece-button.el
lisp/riece-commands.el
lisp/riece-compat.el
lisp/riece-ctcp.el
lisp/riece-display.el
lisp/riece-epg.el
lisp/riece-highlight.el
lisp/riece-ruby.el
lisp/riece-shrink-buffer.el
lisp/riece.el

index 25100e1..6053dfd 100644 (file)
@@ -1,3 +1,9 @@
+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,
index b633ff5..56403f8 100644 (file)
@@ -84,7 +84,7 @@ assumed that the file is in the same directory of this file.")
                        (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 ()
index 27e4a73..fd6f24e 100644 (file)
@@ -256,8 +256,7 @@ This function is used as a callback for a channel button."
     (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
@@ -292,8 +291,7 @@ This function is used as a callback for a channel button."
   (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
index 427fd3c..ddb353d 100644 (file)
@@ -34,8 +34,6 @@
 (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
@@ -445,8 +443,8 @@ the layout to the selected layout-name."
                               (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."
@@ -455,8 +453,8 @@ the layout to the selected layout-name."
                               (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."
@@ -476,8 +474,8 @@ the layout to the selected layout-name."
      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))
@@ -629,8 +627,7 @@ the layout to the selected layout-name."
   "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)
@@ -647,8 +644,7 @@ If prefix argument ARG is non-nil, toggle frozen status."
 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)
index 3e54caf..b237d0e 100644 (file)
                          (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
index e0e60a9..18eefdc 100644 (file)
               (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"
index 3cd8f72..5d20012 100644 (file)
@@ -31,8 +31,6 @@
 (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
@@ -358,8 +356,7 @@ Local to the buffer in `riece-buffer-list'.")
   (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"
index 63c5997..a33d8ad 100644 (file)
     (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."
index 97e9af1..f40638e 100644 (file)
   ;; 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)))))
index 699ddd0..13d2611 100644 (file)
@@ -265,7 +265,7 @@ Return a string name assigned by the server."
                   (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
index 6bc9481..38091a0 100644 (file)
     (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)))))
 
index 67ee557..400404d 100644 (file)
@@ -31,8 +31,6 @@
 (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))
 
@@ -399,9 +397,12 @@ For a list of the generic commands type \\[riece-command-generic] ? RET.
     (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))
 
@@ -491,7 +492,7 @@ All normal editing commands are turned off."
         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)
@@ -522,7 +523,7 @@ Instead, these commands are available:
        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)