* mml.el (mml-preview): do.
authorJesper Harder <harder@ifa.au.dk>
Sun, 27 Apr 2003 02:17:07 +0000 (02:17 +0000)
committerJesper Harder <harder@ifa.au.dk>
Sun, 27 Apr 2003 02:17:07 +0000 (02:17 +0000)
* message.el (message-mode): do.

* gnus-undo.el (gnus-undo-mode): do.

* gnus-topic.el (gnus-topic-mode): do.

* gnus-sum.el (gnus-summary-mode, gnus-summary-edit-article): do.

* gnus-msg.el (gnus-setup-message)
(gnus-inews-add-send-actions, gnus-configure-posting-styles): do.

* gnus-gl.el (gnus-grouplens-mode): do.

* gnus-art.el (gnus-mime-save-part-and-strip)
(gnus-mime-delete-part): Use it.

* gnus-util.el (gnus-make-local-hook): New function.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-gl.el
lisp/gnus-msg.el
lisp/gnus-sum.el
lisp/gnus-topic.el
lisp/gnus-undo.el
lisp/gnus-util.el
lisp/message.el
lisp/mml.el

index 123475d..f2c6759 100644 (file)
@@ -1,3 +1,25 @@
+2003-04-27  Jesper Harder  <harder@ifa.au.dk>
+
+       * mml.el (mml-preview): do.
+
+       * message.el (message-mode): do.
+
+       * gnus-undo.el (gnus-undo-mode): do.
+
+       * gnus-topic.el (gnus-topic-mode): do.
+
+       * gnus-sum.el (gnus-summary-mode, gnus-summary-edit-article): do.
+
+       * gnus-msg.el (gnus-setup-message)
+       (gnus-inews-add-send-actions, gnus-configure-posting-styles): do.
+
+       * gnus-gl.el (gnus-grouplens-mode): do.
+
+       * gnus-art.el (gnus-mime-save-part-and-strip)
+       (gnus-mime-delete-part): Use it.
+
+       * gnus-util.el (gnus-make-local-hook): New function.
+
 2003-04-25  Simon Josefsson  <jas@extundo.com>
 
        * nnrss.el (nnrss-node-text): Don't use a star.
index 8c4b986..d455089 100644 (file)
@@ -3914,9 +3914,7 @@ General format specifiers can also be used.  See Info node
             (let ((mbl1 mml-buffer-list))
               (setq mml-buffer-list mbl)
               (set (make-local-variable 'mml-buffer-list) mbl1))
-            ;; LOCAL argument of add-hook differs between GNU Emacs
-            ;; and XEmacs. make-local-hook makes sure they are local.
-            (make-local-hook 'kill-buffer-hook)
+            (gnus-make-local-hook 'kill-buffer-hook)
             (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
        `(lambda (no-highlight)
          (let ((mail-parse-charset (or gnus-article-charset
@@ -3994,9 +3992,7 @@ Replace it with some information about the removed part."
            (let ((mbl1 mml-buffer-list))
              (setq mml-buffer-list mbl)
              (set (make-local-variable 'mml-buffer-list) mbl1))
-           ;; LOCAL argument of add-hook differs between GNU Emacs
-           ;; and XEmacs. make-local-hook makes sure they are local.
-           (make-local-hook 'kill-buffer-hook)
+           (gnus-make-local-hook 'kill-buffer-hook)
            (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
        `(lambda (no-highlight)
          (let ((mail-parse-charset (or gnus-article-charset
index 689e995..1df6838 100644 (file)
@@ -810,9 +810,9 @@ If prefix argument ALL is non-nil, all articles are marked as read."
          (if (null arg) (not gnus-grouplens-mode)
            (> (prefix-numeric-value arg) 0)))
     (when gnus-grouplens-mode
-      (make-local-hook 'gnus-select-article-hook)
+      (gnus-make-local-hook 'gnus-select-article-hook)
       (add-hook 'gnus-select-article-hook 'grouplens-do-time nil 'local)
-      (make-local-hook 'gnus-exit-group-hook)
+      (gnus-make-local-hook 'gnus-exit-group-hook)
       (add-hook 'gnus-exit-group-hook 'bbb-exit-group nil 'local)
       (make-local-variable 'gnus-score-find-score-files-function)
 
index df7b80b..2bd4a12 100644 (file)
@@ -437,10 +437,8 @@ Thank you for your help in stamping out bugs.
             (let ((mbl1 mml-buffer-list))
               (setq mml-buffer-list mbl)  ;; Global value
               (set (make-local-variable 'mml-buffer-list) mbl1);; Local value
-              ;; LOCAL argument of add-hook differs between GNU Emacs
-              ;; and XEmacs. make-local-hook makes sure they are local.
-              (make-local-hook 'kill-buffer-hook)
-              (make-local-hook 'change-major-mode-hook)
+              (gnus-make-local-hook 'kill-buffer-hook)
+              (gnus-make-local-hook 'change-major-mode-hook)
               (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t)
               (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))
           (mml-destroy-buffers)
@@ -522,11 +520,11 @@ Gcc: header for archiving purposes."
 
 (defun gnus-inews-add-send-actions (winconf buffer article
                                            &optional config yanked)
-  (make-local-hook 'message-sent-hook)
+  (gnus-make-local-hook 'message-sent-hook)
   (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
                                 'gnus-inews-do-gcc) nil t)
   (when gnus-agent
-    (make-local-hook 'message-header-hook)
+    (gnus-make-local-hook 'message-header-hook)
     (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t))
   (setq message-post-method
        `(lambda (arg)
@@ -1915,8 +1913,7 @@ this is a reply."
       (setq name (assq 'name results)
            address (assq 'address results))
       (setq results (delq name (delq address results)))
-      ;; make-local-hook is not obsolete in Emacs 20 or XEmacs.
-      (make-local-hook 'message-setup-hook)
+      (gnus-make-local-hook 'message-setup-hook)
       (setq results (sort results (lambda (x y)
                                    (string-lessp (car x) (car y)))))
       (dolist (result results)
index 3d55f45..93372e0 100644 (file)
@@ -2678,7 +2678,7 @@ The following commands are available:
   (make-local-variable 'gnus-summary-dummy-line-format)
   (make-local-variable 'gnus-summary-dummy-line-format-spec)
   (make-local-variable 'gnus-summary-mark-positions)
-  (make-local-hook 'pre-command-hook)
+  (gnus-make-local-hook 'pre-command-hook)
   (add-hook 'pre-command-hook 'gnus-set-global-variables nil t)
   (gnus-run-hooks 'gnus-summary-mode-hook)
   (turn-on-gnus-mailing-list-mode)
@@ -9310,7 +9310,7 @@ groups."
                (let ((mbl1 mml-buffer-list))
                  (setq mml-buffer-list mbl)
                  (set (make-local-variable 'mml-buffer-list) mbl1))
-               (make-local-hook 'kill-buffer-hook)
+               (gnus-make-local-hook 'kill-buffer-hook)
                (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))))
         `(lambda (no-highlight)
            (let ((mail-parse-charset ',gnus-newsgroup-charset)
index 22ef257..708e779 100644 (file)
@@ -1153,7 +1153,7 @@ articles in the topic and its subtopics."
           'gnus-group-sort-topic)
       (setq gnus-group-change-level-function 'gnus-topic-change-level)
       (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group)
-      (make-local-hook 'gnus-check-bogus-groups-hook)
+      (gnus-make-local-hook 'gnus-check-bogus-groups-hook)
       (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist
                nil 'local)
       (setq gnus-topology-checked-p nil)
index 7dd333f..cbd506a 100644 (file)
     (when (gnus-visual-p 'undo-menu 'menu)
       (gnus-undo-make-menu-bar))
     (gnus-add-minor-mode 'gnus-undo-mode "" gnus-undo-mode-map)
-    (make-local-hook 'post-command-hook)
+    (gnus-make-local-hook 'post-command-hook)
     (add-hook 'post-command-hook 'gnus-undo-boundary nil t)
     (gnus-run-hooks 'gnus-undo-mode-hook)))
 
index e47e3ee..69d029e 100644 (file)
       'point-at-eol
     'line-end-position))
 
+;; The LOCAL arg to `add-hook' is interpreted differently in Emacs and
+;; XEmacs.  In Emacs we don't need to call `make-local-hook' first.
+;; It's harmless, though, so the main purpose of this alias is to shut
+;; up the byte compiler.
+(defalias 'gnus-make-local-hook
+  (if (eq (get 'make-local-hook 'byte-compile) 
+         'byte-compile-obsolete)
+      'ignore                          ; Emacs
+    'make-local-hook))                 ; XEmacs
+
 (defun gnus-delete-first (elt list)
   "Delete by side effect the first occurrence of ELT as a member of LIST."
   (if (equal (car list) elt)
index c669c7b..c2f7779 100644 (file)
@@ -1452,7 +1452,8 @@ no, only reply back to the author."
   (autoload 'gnus-group-name-decode "gnus-group")
   (autoload 'gnus-groups-from-server "gnus")
   (autoload 'rmail-output "rmailout")
-  (autoload 'gnus-delay-article "gnus-delay"))
+  (autoload 'gnus-delay-article "gnus-delay")
+  (autoload 'gnus-make-local-hook "gnus-util"))
 
 \f
 
@@ -2344,9 +2345,7 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
        (set (make-local-variable 'tool-bar-map) (message-tool-bar-map))))
   (easy-menu-add message-mode-menu message-mode-map)
   (easy-menu-add message-mode-field-menu message-mode-map)
-  ;; make-local-hook is harmless though obsolete in Emacs 21.
-  ;; Emacs 20 and XEmacs need make-local-hook.
-  (make-local-hook 'after-change-functions)
+  (gnus-make-local-hook 'after-change-functions)
   ;; Mmmm... Forbidden properties...
   (add-hook 'after-change-functions 'message-strip-forbidden-properties
            nil 'local)
index b22ab22..94f3712 100644 (file)
@@ -35,6 +35,7 @@
   (autoload 'message-make-message-id "message")
   (autoload 'gnus-setup-posting-charset "gnus-msg")
   (autoload 'gnus-add-minor-mode "gnus-ems")
+  (autoload 'gnus-make-local-hook "gnus-util")
   (autoload 'message-fetch-field "message")
   (autoload 'fill-flowed-encode "flow-fill")
   (autoload 'message-posting-charset "message"))
@@ -1070,7 +1071,7 @@ If RAW, don't highlight the article."
            (gnus-article-prepare-display))))
       ;; Disable article-mode-map.
       (use-local-map nil)
-      (make-local-hook 'kill-buffer-hook)
+      (gnus-make-local-hook 'kill-buffer-hook)
       (add-hook 'kill-buffer-hook
                (lambda ()
                  (mm-destroy-parts gnus-article-mime-handles)) nil t)