diff options
| author | Stefan Monnier | 2010-12-06 21:01:00 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-12-06 21:01:00 -0500 |
| commit | 674c5ccf395d233eacf0fc07c36811d6f53114be (patch) | |
| tree | aa3cbd02c417e04471c25f2bb298314b67a4effc | |
| parent | 6568edea53db356657f44670573dfb046391c6ed (diff) | |
| download | emacs-674c5ccf395d233eacf0fc07c36811d6f53114be.tar.gz emacs-674c5ccf395d233eacf0fc07c36811d6f53114be.zip | |
* lisp/gnus/message.el: Use completion-at-point.
(message-completion-function): New fun, extracted from message-tab.
(message-mode): Use it for completion-at-point-functions.
(message-tab): Use it and completion-at-point.
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 23 |
2 files changed, 24 insertions, 6 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c0446207028..4a5d103e08b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-12-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * message.el: Use completion-at-point. | ||
| 4 | (message-completion-function): New fun, extracted from message-tab. | ||
| 5 | (message-mode): Use it for completion-at-point-functions. | ||
| 6 | (message-tab): Use it and completion-at-point. | ||
| 7 | |||
| 1 | 2010-12-07 Katsumi Yamaoka <yamaoka@jpl.org> | 8 | 2010-12-07 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 9 | ||
| 3 | * shr.el (shr-find-fill-point): Don't break a line after a kinsoku-bol | 10 | * shr.el (shr-find-fill-point): Don't break a line after a kinsoku-bol |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 7f80dec33bb..de9eef5ea73 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -277,7 +277,7 @@ This is a list of regexps and regexp matches." | |||
| 277 | regexp)) | 277 | regexp)) |
| 278 | 278 | ||
| 279 | (defcustom message-ignored-mail-headers | 279 | (defcustom message-ignored-mail-headers |
| 280 | "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:" | 280 | "^\\([GF]cc\\|Resent-Fcc\\|Xref\\|X-Draft-From\\|X-Gnus-Agent-Meta-Information\\):" |
| 281 | "*Regexp of headers to be removed unconditionally before mailing." | 281 | "*Regexp of headers to be removed unconditionally before mailing." |
| 282 | :group 'message-mail | 282 | :group 'message-mail |
| 283 | :group 'message-headers | 283 | :group 'message-headers |
| @@ -2914,6 +2914,7 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." | |||
| 2914 | (mail-aliases-setup)))) | 2914 | (mail-aliases-setup)))) |
| 2915 | ((message-mail-alias-type-p 'ecomplete) | 2915 | ((message-mail-alias-type-p 'ecomplete) |
| 2916 | (ecomplete-setup))) | 2916 | (ecomplete-setup))) |
| 2917 | (add-hook 'completion-at-point-functions 'message-completion-function nil t) | ||
| 2917 | (unless buffer-file-name | 2918 | (unless buffer-file-name |
| 2918 | (message-set-auto-save-file-name)) | 2919 | (message-set-auto-save-file-name)) |
| 2919 | (unless (buffer-base-buffer) | 2920 | (unless (buffer-base-buffer) |
| @@ -7743,7 +7744,7 @@ When FORCE, rebuild the tool bar." | |||
| 7743 | :type '(alist :key-type regexp :value-type function)) | 7744 | :type '(alist :key-type regexp :value-type function)) |
| 7744 | 7745 | ||
| 7745 | (defcustom message-expand-name-databases | 7746 | (defcustom message-expand-name-databases |
| 7746 | (list 'bbdb 'eudc) | 7747 | '(bbdb eudc) |
| 7747 | "List of databases to try for name completion (`message-expand-name'). | 7748 | "List of databases to try for name completion (`message-expand-name'). |
| 7748 | Each element is a symbol and can be `bbdb' or `eudc'." | 7749 | Each element is a symbol and can be `bbdb' or `eudc'." |
| 7749 | :group 'message | 7750 | :group 'message |
| @@ -7765,15 +7766,25 @@ If nil, the function bound in `text-mode-map' or `global-map' is executed." | |||
| 7765 | Execute function specified by `message-tab-body-function' when not in | 7766 | Execute function specified by `message-tab-body-function' when not in |
| 7766 | those headers." | 7767 | those headers." |
| 7767 | (interactive) | 7768 | (interactive) |
| 7769 | (cond | ||
| 7770 | ((if (and (boundp 'completion-fail-discreetly) | ||
| 7771 | (fboundp 'completion-at-point)) | ||
| 7772 | (let ((completion-fail-discreetly t)) (completion-at-point)) | ||
| 7773 | (funcall (or (message-completion-function) #'ignore))) | ||
| 7774 | ;; Completion was performed; nothing else to do. | ||
| 7775 | nil) | ||
| 7776 | (message-tab-body-function (funcall message-tab-body-function)) | ||
| 7777 | (t (funcall (or (lookup-key text-mode-map "\t") | ||
| 7778 | (lookup-key global-map "\t") | ||
| 7779 | 'indent-relative))))) | ||
| 7780 | |||
| 7781 | (defun message-completion-function () | ||
| 7768 | (let ((alist message-completion-alist)) | 7782 | (let ((alist message-completion-alist)) |
| 7769 | (while (and alist | 7783 | (while (and alist |
| 7770 | (let ((mail-abbrev-mode-regexp (caar alist))) | 7784 | (let ((mail-abbrev-mode-regexp (caar alist))) |
| 7771 | (not (mail-abbrev-in-expansion-header-p)))) | 7785 | (not (mail-abbrev-in-expansion-header-p)))) |
| 7772 | (setq alist (cdr alist))) | 7786 | (setq alist (cdr alist))) |
| 7773 | (funcall (or (cdar alist) message-tab-body-function | 7787 | (cdar alist))) |
| 7774 | (lookup-key text-mode-map "\t") | ||
| 7775 | (lookup-key global-map "\t") | ||
| 7776 | 'indent-relative)))) | ||
| 7777 | 7788 | ||
| 7778 | (eval-and-compile | 7789 | (eval-and-compile |
| 7779 | (condition-case nil | 7790 | (condition-case nil |