aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-14 13:57:55 +1100
committerLars Ingebrigtsen2016-02-14 13:57:55 +1100
commitb9baa80d7f550c1b51613398db2b106bc7220e8b (patch)
tree4454f3354de6b6b0b6f39b73e1aaf367681005bd
parent8e14ce4b5c88b9ec04d3a38ed2fcb8aa72b4c627 (diff)
downloademacs-b9baa80d7f550c1b51613398db2b106bc7220e8b.tar.gz
emacs-b9baa80d7f550c1b51613398db2b106bc7220e8b.zip
Remove compat code and functions from message.el
* lisp/gnus/message.el (message-send-mail-function): Remove compat code. (message-dont-reply-to-names, message-mode) (message-setup-fill-variables, message-fill-paragraph) (message-remove-blank-cited-lines, message-make-from) (message-forward-rmail-make-body, message-tool-bar-gnome) (message-tab): Remove compat code. (message-completion-in-region): Remove. (message-read-from-minibuffer): Remove compat code.
-rw-r--r--lisp/gnus/message.el124
1 files changed, 28 insertions, 96 deletions
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 9ab44fab12d..46f01770480 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -656,12 +656,10 @@ variable should be a regexp or a list of regexps."
656(defun message-send-mail-function () 656(defun message-send-mail-function ()
657 "Return suitable value for the variable `message-send-mail-function'." 657 "Return suitable value for the variable `message-send-mail-function'."
658 (cond ((and (require 'sendmail) 658 (cond ((and (require 'sendmail)
659 (boundp 'sendmail-program)
660 sendmail-program 659 sendmail-program
661 (executable-find sendmail-program)) 660 (executable-find sendmail-program))
662 'message-send-mail-with-sendmail) 661 'message-send-mail-with-sendmail)
663 ((and (locate-library "smtpmail") 662 ((and (locate-library "smtpmail")
664 (boundp 'smtpmail-default-smtp-server)
665 smtpmail-default-smtp-server) 663 smtpmail-default-smtp-server)
666 'message-smtpmail-send-it) 664 'message-smtpmail-send-it)
667 ((locate-library "mailclient") 665 ((locate-library "mailclient")
@@ -1351,9 +1349,8 @@ If nil, you might be asked to input the charset."
1351 :link '(custom-manual "(message)Various Message Variables") 1349 :link '(custom-manual "(message)Various Message Variables")
1352 :type 'symbol) 1350 :type 'symbol)
1353 1351
1354(defcustom message-dont-reply-to-names 1352(defcustom message-dont-reply-to-names mail-dont-reply-to-names
1355 (and (boundp 'mail-dont-reply-to-names) mail-dont-reply-to-names) 1353 "Addresses to prune when doing wide replies.
1356 "*Addresses to prune when doing wide replies.
1357This can be a regexp, a list of regexps or a predicate function. 1354This can be a regexp, a list of regexps or a predicate function.
1358Also, a value of nil means exclude your own user name only. 1355Also, a value of nil means exclude your own user name only.
1359 1356
@@ -2985,10 +2982,7 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
2985 ;; Allow mail alias things. 2982 ;; Allow mail alias things.
2986 (cond 2983 (cond
2987 ((message-mail-alias-type-p 'abbrev) 2984 ((message-mail-alias-type-p 'abbrev)
2988 (if (fboundp 'mail-abbrevs-setup) 2985 (mail-abbrevs-setup))
2989 (mail-abbrevs-setup)
2990 (if (fboundp 'mail-aliases-setup) ; warning avoidance
2991 (mail-aliases-setup))))
2992 ((message-mail-alias-type-p 'ecomplete) 2986 ((message-mail-alias-type-p 'ecomplete)
2993 (ecomplete-setup))) 2987 (ecomplete-setup)))
2994 (add-hook 'completion-at-point-functions 'message-completion-function nil t) 2988 (add-hook 'completion-at-point-functions 'message-completion-function nil t)
@@ -3014,8 +3008,6 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
3014 (make-local-variable 'paragraph-separate) 3008 (make-local-variable 'paragraph-separate)
3015 (make-local-variable 'paragraph-start) 3009 (make-local-variable 'paragraph-start)
3016 (make-local-variable 'adaptive-fill-regexp) 3010 (make-local-variable 'adaptive-fill-regexp)
3017 (unless (boundp 'adaptive-fill-first-line-regexp)
3018 (setq adaptive-fill-first-line-regexp nil))
3019 (make-local-variable 'adaptive-fill-first-line-regexp) 3011 (make-local-variable 'adaptive-fill-first-line-regexp)
3020 (let ((quote-prefix-regexp 3012 (let ((quote-prefix-regexp
3021 ;; User should change message-cite-prefix-regexp if 3013 ;; User should change message-cite-prefix-regexp if
@@ -3457,12 +3449,10 @@ Prefix arg means justify as well."
3457This function is used as the value of `fill-paragraph-function' in 3449This function is used as the value of `fill-paragraph-function' in
3458Message buffers and is not meant to be called directly." 3450Message buffers and is not meant to be called directly."
3459 (interactive (list (if current-prefix-arg 'full))) 3451 (interactive (list (if current-prefix-arg 'full)))
3460 (if (if (boundp 'filladapt-mode) filladapt-mode) 3452 (if (message-point-in-header-p)
3461 nil 3453 (message-fill-field)
3462 (if (message-point-in-header-p) 3454 (message-newline-and-reformat arg t))
3463 (message-fill-field) 3455 t)
3464 (message-newline-and-reformat arg t))
3465 t))
3466 3456
3467(defun message-point-in-header-p () 3457(defun message-point-in-header-p ()
3468 "Return t if point is in the header." 3458 "Return t if point is in the header."
@@ -3746,15 +3736,11 @@ If REMOVE is non-nil, remove newlines, too.
3746To use this automatically, you may add this function to 3736To use this automatically, you may add this function to
3747`gnus-message-setup-hook'." 3737`gnus-message-setup-hook'."
3748 (interactive "P") 3738 (interactive "P")
3749 (let ((citexp 3739 (let ((citexp (concat "^\\("
3750 (concat 3740 (concat message-yank-cited-prefix "\\|")
3751 "^\\(" 3741 message-yank-prefix
3752 (when (boundp 'message-yank-cited-prefix) 3742 "\\)+ *\n")))
3753 (concat message-yank-cited-prefix "\\|")) 3743 (message "Removing `%s'" citexp)
3754 message-yank-prefix
3755 "\\)+ *\n"
3756 )))
3757 (message "removing `%s'" citexp)
3758 (save-excursion 3744 (save-excursion
3759 (message-goto-body) 3745 (message-goto-body)
3760 (while (re-search-forward citexp nil t) 3746 (while (re-search-forward citexp nil t)
@@ -5704,10 +5690,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5704 "Make a From header." 5690 "Make a From header."
5705 (let* ((style message-from-style) 5691 (let* ((style message-from-style)
5706 (login (or address (message-make-address))) 5692 (login (or address (message-make-address)))
5707 (fullname (or name 5693 (fullname (or name user-full-name (user-full-name))))
5708 (and (boundp 'user-full-name)
5709 user-full-name)
5710 (user-full-name))))
5711 (when (string= fullname "&") 5694 (when (string= fullname "&")
5712 (setq fullname (user-login-name))) 5695 (setq fullname (user-login-name)))
5713 (with-temp-buffer 5696 (with-temp-buffer
@@ -5807,8 +5790,7 @@ give as trustworthy answer as possible."
5807 ;; `system-name' returned the right result. 5790 ;; `system-name' returned the right result.
5808 sysname) 5791 sysname)
5809 ;; Try `mail-host-address'. 5792 ;; Try `mail-host-address'.
5810 ((and (boundp 'mail-host-address) 5793 ((and (stringp mail-host-address)
5811 (stringp mail-host-address)
5812 (not (string-match message-bogus-system-names mail-host-address))) 5794 (not (string-match message-bogus-system-names mail-host-address)))
5813 mail-host-address) 5795 mail-host-address)
5814 ;; We try `user-mail-address' as a backup. 5796 ;; We try `user-mail-address' as a backup.
@@ -6340,11 +6322,10 @@ moved to the beginning "
6340 ((and message-beginning-of-line (message-point-in-header-p)) 6322 ((and message-beginning-of-line (message-point-in-header-p))
6341 (let* ((point (point)) 6323 (let* ((point (point))
6342 (bol (progn (beginning-of-line n) (point))) 6324 (bol (progn (beginning-of-line n) (point)))
6343 (boh (message-beginning-of-header (and (boundp 'visual-line-mode) 6325 (boh (message-beginning-of-header visual-line-mode)))
6344 visual-line-mode))))
6345 (goto-char (if (and boh (or (< boh point) (= bol point))) boh bol)))) 6326 (goto-char (if (and boh (or (< boh point) (= bol point))) boh bol))))
6346 ;; Go to beginning of visual line 6327 ;; Go to beginning of visual line
6347 ((and (boundp 'visual-line-mode) visual-line-mode) 6328 (visual-line-mode
6348 (beginning-of-visual-line n)) 6329 (beginning-of-visual-line n))
6349 ;; Go to beginning of line. 6330 ;; Go to beginning of line.
6350 ((beginning-of-line n)))) 6331 ((beginning-of-line n))))
@@ -6424,10 +6405,7 @@ moved to the beginning "
6424 "Message already being composed; erase? ") 6405 "Message already being composed; erase? ")
6425 (message nil)))) 6406 (message nil))))
6426 (error "Message being composed"))) 6407 (error "Message being composed")))
6427 (funcall (or switch-function 6408 (funcall (or switch-function 'pop-to-buffer-same-window)
6428 (if (fboundp #'pop-to-buffer-same-window)
6429 #'pop-to-buffer-same-window
6430 #'pop-to-buffer))
6431 name) 6409 name)
6432 (set-buffer name)) 6410 (set-buffer name))
6433 (erase-buffer) 6411 (erase-buffer)
@@ -7606,10 +7584,8 @@ is for the internal use."
7606(defun message-forward-rmail-make-body (forward-buffer) 7584(defun message-forward-rmail-make-body (forward-buffer)
7607 (save-window-excursion 7585 (save-window-excursion
7608 (set-buffer forward-buffer) 7586 (set-buffer forward-buffer)
7609 (if (rmail-msg-is-pruned) 7587 (when (rmail-msg-is-pruned)
7610 (if (fboundp 'rmail-msg-restore-non-pruned-header) 7588 (rmail-toggle-header 0)))
7611 (rmail-msg-restore-non-pruned-header) ; Emacs 22
7612 (rmail-toggle-header 0)))) ; Emacs 23
7613 (message-forward-make-body forward-buffer)) 7589 (message-forward-make-body forward-buffer))
7614 7590
7615;; Fixme: Should have defcustom. 7591;; Fixme: Should have defcustom.
@@ -7859,12 +7835,10 @@ Pre-defined symbols include `message-tool-bar-gnome' and
7859(defcustom message-tool-bar-gnome 7835(defcustom message-tool-bar-gnome
7860 '((ispell-message "spell" nil 7836 '((ispell-message "spell" nil
7861 :vert-only t 7837 :vert-only t
7862 :visible (or (not (boundp 'flyspell-mode)) 7838 :visible (not flyspell-mode))
7863 (not flyspell-mode)))
7864 (flyspell-buffer "spell" t 7839 (flyspell-buffer "spell" t
7865 :vert-only t 7840 :vert-only t
7866 :visible (and (boundp 'flyspell-mode) 7841 :visible flyspell-mode
7867 flyspell-mode)
7868 :help "Flyspell whole buffer") 7842 :help "Flyspell whole buffer")
7869 (message-send-and-exit "mail/send" t :label "Send") 7843 (message-send-and-exit "mail/send" t :label "Send")
7870 (message-dont-send "mail/save-draft") 7844 (message-dont-send "mail/save-draft")
@@ -7929,9 +7903,7 @@ When FORCE, rebuild the tool bar."
7929 (gmm-image-load-path-for-library "message" 7903 (gmm-image-load-path-for-library "message"
7930 "mail/save-draft.xpm" 7904 "mail/save-draft.xpm"
7931 nil t)) 7905 nil t))
7932 (image-load-path (cons (car load-path) 7906 (image-load-path (cons (car load-path) image-load-path)))
7933 (when (boundp 'image-load-path)
7934 image-load-path))))
7935 (gmm-tool-bar-from-list message-tool-bar 7907 (gmm-tool-bar-from-list message-tool-bar
7936 message-tool-bar-zap-list 7908 message-tool-bar-zap-list
7937 'message-mode-map)))) 7909 'message-mode-map))))
@@ -7982,10 +7954,8 @@ not in those headers. If that variable is nil, indent with the
7982regular text mode tabbing command." 7954regular text mode tabbing command."
7983 (interactive) 7955 (interactive)
7984 (cond 7956 (cond
7985 ((if (and (boundp 'completion-fail-discreetly) 7957 ((let ((completion-fail-discreetly t))
7986 (fboundp 'completion-at-point)) 7958 (completion-at-point))
7987 (let ((completion-fail-discreetly t)) (completion-at-point))
7988 (funcall (or (message-completion-function) #'ignore)))
7989 ;; Completion was performed; nothing else to do. 7959 ;; Completion was performed; nothing else to do.
7990 nil) 7960 nil)
7991 (message-tab-body-function (funcall message-tab-body-function)) 7961 (message-tab-body-function (funcall message-tab-body-function))
@@ -8031,41 +8001,7 @@ regular text mode tabbing command."
8031 group) 8001 group)
8032 collection)) 8002 collection))
8033 gnus-active-hashtb)) 8003 gnus-active-hashtb))
8034 (message-completion-in-region b e collection))) 8004 (completion-in-region b e collection)))
8035
8036(defalias 'message-completion-in-region
8037 (if (fboundp 'completion-in-region)
8038 'completion-in-region
8039 (lambda (b e hashtb)
8040 (let* ((string (buffer-substring b e))
8041 (completions (all-completions string hashtb))
8042 comp)
8043 (delete-region b (point))
8044 (cond
8045 ((= (length completions) 1)
8046 (if (string= (car completions) string)
8047 (progn
8048 (insert string)
8049 (message "Only matching group"))
8050 (insert (car completions))))
8051 ((and (setq comp (try-completion string hashtb))
8052 (not (string= comp string)))
8053 (insert comp))
8054 (t
8055 (insert string)
8056 (if (not comp)
8057 (message "No matching groups")
8058 (save-selected-window
8059 (pop-to-buffer "*Completions*")
8060 (buffer-disable-undo)
8061 (let ((buffer-read-only nil))
8062 (erase-buffer)
8063 (let ((standard-output (current-buffer)))
8064 (display-completion-list (sort completions 'string<)))
8065 (setq buffer-read-only nil)
8066 (goto-char (point-min))
8067 (delete-region (point)
8068 (progn (forward-line 3) (point))))))))))))
8069 8005
8070(defun message-expand-name () 8006(defun message-expand-name ()
8071 (cond ((and (memq 'eudc message-expand-name-databases) 8007 (cond ((and (memq 'eudc message-expand-name-databases)
@@ -8187,13 +8123,9 @@ regexp VARSTR."
8187 8123
8188(defun message-read-from-minibuffer (prompt &optional initial-contents) 8124(defun message-read-from-minibuffer (prompt &optional initial-contents)
8189 "Read from the minibuffer while providing abbrev expansion." 8125 "Read from the minibuffer while providing abbrev expansion."
8190 (if (fboundp 'mail-abbrevs-setup) 8126 (let ((minibuffer-setup-hook 'mail-abbrevs-setup)
8191 (let ((minibuffer-setup-hook 'mail-abbrevs-setup) 8127 (minibuffer-local-map message-minibuffer-local-map))
8192 (minibuffer-local-map message-minibuffer-local-map)) 8128 (read-from-minibuffer prompt initial-contents)))
8193 (read-from-minibuffer prompt initial-contents))
8194 (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
8195 (minibuffer-local-map message-minibuffer-local-map))
8196 (read-string prompt initial-contents))))
8197 8129
8198(defun message-use-alternative-email-as-from () 8130(defun message-use-alternative-email-as-from ()
8199 "Set From field of the outgoing message to the first matching 8131 "Set From field of the outgoing message to the first matching