From 0464e22911efc9ca68160da82288cb517a81ea52 Mon Sep 17 00:00:00 2001 From: Jesper Harder Date: Sun, 27 Apr 2003 02:17:07 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 22 ++++++++++++++++++++++ lisp/gnus-art.el | 8 ++------ lisp/gnus-gl.el | 4 ++-- lisp/gnus-msg.el | 13 +++++-------- lisp/gnus-sum.el | 4 ++-- lisp/gnus-topic.el | 2 +- lisp/gnus-undo.el | 2 +- lisp/gnus-util.el | 10 ++++++++++ lisp/message.el | 7 +++---- lisp/mml.el | 3 ++- 10 files changed, 50 insertions(+), 25 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 123475d72..f2c675927 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,25 @@ +2003-04-27 Jesper Harder + + * 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 * nnrss.el (nnrss-node-text): Don't use a star. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 8c4b98691..d455089dd 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -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 diff --git a/lisp/gnus-gl.el b/lisp/gnus-gl.el index 689e9952f..1df6838e8 100644 --- a/lisp/gnus-gl.el +++ b/lisp/gnus-gl.el @@ -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) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index df7b80b7b..2bd4a125e 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -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) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 3d55f4544..93372e051 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -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) diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index 22ef257e6..708e77988 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -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) diff --git a/lisp/gnus-undo.el b/lisp/gnus-undo.el index 7dd333f1c..cbd506af8 100644 --- a/lisp/gnus-undo.el +++ b/lisp/gnus-undo.el @@ -114,7 +114,7 @@ (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))) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index e47e3ee4f..69d029e3e 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -137,6 +137,16 @@ '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) diff --git a/lisp/message.el b/lisp/message.el index c669c7b1c..c2f7779c7 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -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")) @@ -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) diff --git a/lisp/mml.el b/lisp/mml.el index b22ab2205..94f37129c 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -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) -- 2.25.1