`define-derived-mode'.
Synch with Oort Gnus.
+2001-07-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * lisp/dgnushack.el (dgnushack-make-auto-load): Advise
+ `make-autoload' to handle `define-derived-mode'.
+
2001-07-12 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/message.el (message-yank-original): Unwind-protect while
+2001-07-16 12:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+ From: Stefan Monnier <monnier@cs.yale.edu>
+
+ * 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\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+ * message.el (message-citation-line-function): Refer to
+ gnus-cite-attribution-suffix.
+
2001-07-15 Pavel Jan\e,Bm\e(Bk <Pavel@Janik.cz>
* gnus-art.el,...: Error convention changes.
(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"))
(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))
"\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.
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))
(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))
(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)
(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
;;;###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)
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))
(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:\\<message-mode-map>
C-c C-s `message-send' (send the message) C-c C-c `message-send-and-exit'
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).
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)
(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."
"^\\(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."
(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)
+2001-07-16 Kai Gro\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+ * message.texi (Insertion): Refer to gnus-cite-attribution-suffix.
+
2001-07-13 12:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus.texi (RSS): Add.
\e$B$3$N4X?t$,8F$P$l$?$H$-!"%]%$%s%H$O%a%C%;!<%8$NK\BN$N@hF,$K$"$k$G$7$g$&!#\e(B
+\e$B$J$*\e(B gnus \e$B$K$O!"\e(B`writes:' \e$B$N>e$G%/%j%C%/$9$k$H0zMQ$5$l$?%F%-%9%H$r1#$95!\e(B
+\e$BG=$,$"$j$^$9!#$b$7$"$J$?$,EY$r1[$7$F0zMQ9T$rJQ99$7$F$7$^$&$H!"$=$l$rFI$`\e(B
+\e$B?M$?$A$bH`$i$N\e(B gnus \e$B$rBP1~$5$;$J$1$l$P$J$i$J$/$J$k$G$7$g$&!#JQ\e(B
+\e$B?t\e(B @code{gnus-cite-attribution-suffix} \e$B$r;2>H$7$F2<$5$$!#>\:Y\e(B
+\e$B$O\e(B @xref{\e$B5-;v$N%O%$%i%$%H\e(B, , Article Highlighting, gnus} \e$B$K$"$j$^$9!#\e(B
+
@item message-yank-prefix
@vindex message-yank-prefix
@cindex yanking
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