From: yamaoka Date: Tue, 17 Jul 2001 03:03:54 +0000 (+0000) Subject: * dgnushack.el (dgnushack-make-auto-load): Advise `make-autoload' to handle X-Git-Tag: t-gnus-6_15_4-04-quimby~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=43b351789ef4a46244f82b806efa2b3eeceaeba2;p=elisp%2Fgnus.git- * dgnushack.el (dgnushack-make-auto-load): Advise `make-autoload' to handle `define-derived-mode'. Synch with Oort Gnus. --- diff --git a/ChangeLog b/ChangeLog index fa4d0e5..aef04cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-07-17 Katsumi Yamaoka + + * lisp/dgnushack.el (dgnushack-make-auto-load): Advise + `make-autoload' to handle `define-derived-mode'. + 2001-07-12 Katsumi Yamaoka * lisp/message.el (message-yank-original): Unwind-protect while diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07b3517..9ee5c1d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2001-07-16 12:00:00 ShengHuo ZHU + From: Stefan Monnier + + * message.el (message-mode): Use define-derived-mode. + (message-tab): message-completion-alist. + + * imap.el (imap-interactive-login): Use make-local-variable. + (imap-open): Ditto. + (imap-authenticate): Ditto. + + * gnus-msg.el (gnus-setup-message): Change-major-mode-hook. + + * gnus-art.el (gnus-article-edit-mode): Use define-derived-mode. + +2001-07-16 Kai Gro,A_(Bjohann + + * message.el (message-citation-line-function): Refer to + gnus-cite-attribution-suffix. + 2001-07-15 Pavel Jan,Bm(Bk * gnus-art.el,...: Error convention changes. diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 40f2a78..3496035 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -544,6 +544,20 @@ Modify to suit your needs.")) (defun dgnushack-make-auto-load () (require 'autoload) + (unless (make-autoload '(define-derived-mode child parent name + "docstring" body) + "file") + (defadvice make-autoload (around handle-define-derived-mode activate) + "Handle `define-derived-mode'." + (if (eq (car-safe (ad-get-arg 0)) 'define-derived-mode) + (setq ad-return-value + (list 'autoload + (list 'quote (nth 1 (ad-get-arg 0))) + (ad-get-arg 1) + (nth 4 (ad-get-arg 0)) + t nil)) + ad-do-it)) + (put 'define-derived-mode 'doc-string-elt 3)) (let ((generated-autoload-file dgnushack-gnus-load-file) (make-backup-files nil) (autoload-package-name "gnus")) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 8c9f150..574e28f 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1682,7 +1682,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (width (window-width (get-buffer-window (current-buffer))))) (save-restriction (article-goto-body) - (let ((adaptive-fill-mode nil)) + (let ((adaptive-fill-mode nil)) ;Why? -sm (while (not (eobp)) (end-of-line) (when (>= (current-column) (min fill-column width)) @@ -4958,21 +4958,18 @@ If given a prefix, show the hidden text instead." "\C-c\C-w" gnus-article-edit-mode-map) "f" gnus-article-edit-full-stops)) -(defun gnus-article-edit-mode () +(define-derived-mode gnus-article-edit-mode text-mode "Article Edit" "Major mode for editing articles. This is an extended text-mode. \\{gnus-article-edit-mode-map}" - (interactive) - (setq major-mode 'gnus-article-edit-mode) - (setq mode-name "Article Edit") - (use-local-map gnus-article-edit-mode-map) (make-local-variable 'gnus-article-edit-done-function) (make-local-variable 'gnus-prev-winconf) + (set (make-local-variable 'font-lock-defaults) + '(message-font-lock-keywords t)) (setq buffer-read-only nil) (buffer-enable-undo) - (widen) - (gnus-run-hooks 'text-mode-hook 'gnus-article-edit-mode-hook)) + (widen)) (defun gnus-article-edit (&optional force) "Edit the current article. diff --git a/lisp/imap.el b/lisp/imap.el index 1539a44..ac4eacc 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -723,8 +723,8 @@ LOGINFUNC is passed a username and a password, it should return t if it where sucessful authenticating itself to the server, nil otherwise. Returns t if login was successful, nil otherwise." (with-current-buffer buffer - (make-variable-buffer-local 'imap-username) - (make-variable-buffer-local 'imap-password) + (make-local-variable 'imap-username) + (make-local-variable 'imap-password) (let (user passwd ret) ;; (condition-case () (while (or (not user) (not passwd)) @@ -891,7 +891,7 @@ necessery. If nil, the buffer name is generated." (with-current-buffer (get-buffer-create buffer) (if (imap-opened buffer) (imap-close buffer)) - (mapcar 'make-variable-buffer-local imap-local-variables) + (mapcar 'make-local-variable imap-local-variables) (set-buffer-multibyte nil) (buffer-disable-undo) (setq imap-server (or server imap-server)) @@ -961,8 +961,8 @@ password is remembered in the buffer." (or (eq imap-state 'auth) (eq imap-state 'select) (eq imap-state 'examine)) - (make-variable-buffer-local 'imap-username) - (make-variable-buffer-local 'imap-password) + (make-local-variable 'imap-username) + (make-local-variable 'imap-password) (if user (setq imap-username user)) (if passwd (setq imap-password passwd)) (if (funcall (nth 2 (assq imap-auth imap-authenticator-alist)) buffer) diff --git a/lisp/lpath.el b/lisp/lpath.el index 0b6960b..915fa5e 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -13,6 +13,7 @@ (maybe-fbind '(babel-fetch babel-wash create-image decode-coding-string display-graphic-p + bbdb-complete-name display-time-event-handler find-image font-create-object gnus-mule-get-coding-system font-lock-set-defaults diff --git a/lisp/message.el b/lisp/message.el index 8e7d58a..a53887f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -668,7 +668,12 @@ The function `message-supersede' runs this hook." ;;;###autoload (defcustom message-citation-line-function 'message-insert-citation-line - "*Function called to insert the \"Whomever writes:\" line." + "*Function called to insert the \"Whomever writes:\" line. + +Note that Gnus provides a feature where the reader can click on +`writes:' to hide the cited text. If you change this line too much, +people who read your message will have to change their Gnus +configuration. See the variable `gnus-cite-attribution-suffix'." :type 'function :group 'message-insertion) @@ -949,10 +954,6 @@ candidates: table) "Syntax table used while in Message mode.") -(defvar message-mode-abbrev-table text-mode-abbrev-table - "Abbrev table used in Message mode buffers. -Defaults to `text-mode-abbrev-table'.") - (defface message-header-to-face '((((class color) (background dark)) @@ -1778,7 +1779,7 @@ Point is left at the beginning of the narrowed-to region." (defvar facemenu-remove-face-function)) ;;;###autoload -(defun message-mode () +(define-derived-mode message-mode text-mode "Message" "Major mode for editing mail and news to be sent. Like Text Mode but with these additional commands:\\ C-c C-s `message-send' (send the message) C-c C-c `message-send-and-exit' @@ -1791,6 +1792,7 @@ C-c C-f move to a header field (and create it if there isn't): C-c C-f C-k move to Keywords C-c C-f C-d move to Distribution C-c C-f C-m move to Mail-Followup-To C-c C-f C-f move to Followup-To + C-c C-f c move to Mail-Copies-To C-c C-t `message-insert-to' (add a To header to a news followup) C-c C-n `message-insert-newsgroups' (add a Newsgroup header to a news reply) C-c C-b `message-goto-body' (move to beginning of message text). @@ -1803,33 +1805,22 @@ C-c C-v `message-delete-not-region' (remove the text outside the region). C-c C-z `message-kill-to-signature' (kill the text up to the signature). C-c C-r `message-caesar-buffer-body' (rot13 the message body). M-RET `message-newline-and-reformat' (break the line and reformat)." - (interactive) - (kill-all-local-variables) (set (make-local-variable 'message-reply-buffer) nil) (make-local-variable 'message-send-actions) (make-local-variable 'message-exit-actions) (make-local-variable 'message-kill-actions) (make-local-variable 'message-postpone-actions) (make-local-variable 'message-draft-article) - (make-local-hook 'kill-buffer-hook) - (set-syntax-table message-mode-syntax-table) - (use-local-map message-mode-map) - (setq local-abbrev-table message-mode-abbrev-table) - (setq major-mode 'message-mode) - (setq mode-name "Message") (setq buffer-offer-save t) - (make-local-variable 'facemenu-add-face-function) - (make-local-variable 'facemenu-remove-face-function) - (setq facemenu-add-face-function - (lambda (face end) - (let ((face-fun (cdr (assq face message-face-alist)))) - (if face-fun - (funcall face-fun (point) end) - (error "Face %s not configured for %s mode" face mode-name))) - "") - facemenu-remove-face-function t) - (make-local-variable 'message-reply-headers) - (setq message-reply-headers nil) + (set (make-local-variable 'facemenu-add-face-function) + (lambda (face end) + (let ((face-fun (cdr (assq face message-face-alist)))) + (if face-fun + (funcall face-fun (point) end) + (error "Face %s not configured for %s mode" face mode-name))) + "")) + (set (make-local-variable 'facemenu-remove-face-function) t) + (set (make-local-variable 'message-reply-headers) nil) (make-local-variable 'message-user-agent) (make-local-variable 'message-post-method) (set (make-local-variable 'message-sent-message-via) nil) @@ -1854,9 +1845,7 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (mail-abbrevs-setup) (mail-aliases-setup))) (message-set-auto-save-file-name) - (make-local-variable 'indent-tabs-mode) ;Turn off tabs for indentation. - (setq indent-tabs-mode nil) - (run-hooks 'text-mode-hook 'message-mode-hook)) + (set (make-local-variable 'indent-tabs-mode) nil)) ;No tabs for indentation. (defun message-setup-fill-variables () "Setup message fill variables." @@ -5543,14 +5532,21 @@ which specify the range to operate on." "^\\(Newsgroups\\|Followup-To\\|Posted-To\\|Gcc\\):" "Regexp that match headers that lists groups.") +(defvar message-completion-alist + (list (cons message-newgroups-header-regexp 'message-expand-group) + '("^\\(Resent-\\)?\\(To\\|B?Cc\\):" . message-expand-name)) + "Alist of (RE . FUN). Use FUN for completion on header lines matching RE.") + (defun message-tab () "Expand group names in Newsgroups and Followup-To headers. Do a `tab-to-tab-stop' if not in those headers." (interactive) - (if (let ((mail-abbrev-mode-regexp message-newgroups-header-regexp)) - (mail-abbrev-in-expansion-header-p)) - (message-expand-group) - (tab-to-tab-stop))) + (let ((alist message-completion-alist)) + (while (and alist + (let ((mail-abbrev-mode-regexp (caar alist))) + (not (mail-abbrev-in-expansion-header-p)))) + (setq alist (cdr alist))) + (funcall (or (cdar alist) (default-value 'indent-line-function))))) (defun message-expand-group () "Expand the group name under point." @@ -5594,6 +5590,11 @@ Do a `tab-to-tab-stop' if not in those headers." (goto-char (point-min)) (delete-region (point) (progn (forward-line 3) (point)))))))))) +(defun message-expand-name () + (if (fboundp 'bbdb-complete-name) + (bbdb-complete-name) + (expand-abbrev))) + ;;; Help stuff. (defun message-talkative-question (ask question show &rest text) diff --git a/texi/ChangeLog b/texi/ChangeLog index 47fd574..daa6da4 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2001-07-16 Kai Gro,A_(Bjohann + + * message.texi (Insertion): Refer to gnus-cite-attribution-suffix. + 2001-07-13 12:00:00 ShengHuo ZHU * gnus.texi (RSS): Add. diff --git a/texi/message-ja.texi b/texi/message-ja.texi index 54ae2b3..ae97802 100644 --- a/texi/message-ja.texi +++ b/texi/message-ja.texi @@ -484,6 +484,12 @@ Hallvard B Furuseth writes: $B$3$N4X?t$,8F$P$l$?$H$-!"%]%$%s%H$O%a%C%;!<%8$NK\BN$N@hF,$K$"$k$G$7$g$&!#(B +$B$J$*(B gnus $B$K$O!"(B`writes:' $B$N>e$G%/%j%C%/$9$k$H0zMQ$5$l$?%F%-%9%H$r1#$95!(B +$BG=$,$"$j$^$9!#$b$7$"$J$?$,EY$r1[$7$F0zMQ9T$rJQ99$7$F$7$^$&$H!"$=$l$rFI$`(B +$B?M$?$A$bH`$i$N(B gnus $B$rBP1~$5$;$J$1$l$P$J$i$J$/$J$k$G$7$g$&!#JQ(B +$B?t(B @code{gnus-cite-attribution-suffix} $B$r;2>H$7$F2<$5$$!#>\:Y(B +$B$O(B @xref{$B5-;v$N%O%$%i%$%H(B, , Article Highlighting, gnus} $B$K$"$j$^$9!#(B + @item message-yank-prefix @vindex message-yank-prefix @cindex yanking diff --git a/texi/message.texi b/texi/message.texi index bc5b2d2..f2cc33e 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -502,6 +502,12 @@ Hallvard B Furuseth writes: Point will be at the beginning of the body of the message when this function is called. +Note that Gnus provides a feature where clicking on `writes:' hides the +cited text. If you change the citation line too much, readers of your +messages will have to adjust their Gnus, too. See the variable +@code{gnus-cite-attribution-suffix}. @xref{Article Highlighting, , +Article Highlighting, gnus}, for details. + @item message-yank-prefix @vindex message-yank-prefix @cindex yanking