diff options
Diffstat (limited to 'lisp/mail')
-rw-r--r-- | lisp/mail/emacsbug.el | 8 | ||||
-rw-r--r-- | lisp/mail/feedmail.el | 2 | ||||
-rw-r--r-- | lisp/mail/metamail.el | 202 | ||||
-rw-r--r-- | lisp/mail/qp.el | 2 | ||||
-rw-r--r-- | lisp/mail/rfc2045.el | 2 | ||||
-rw-r--r-- | lisp/mail/rfc2368.el | 2 | ||||
-rw-r--r-- | lisp/mail/rmail-spam-filter.el | 14 | ||||
-rw-r--r-- | lisp/mail/rmail.el | 19 |
8 files changed, 31 insertions, 220 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 7f3dc4454ab..efbc0668553 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -208,7 +208,11 @@ This requires either the macOS \"open\" command, or the freedesktop ;;;###autoload (defun report-emacs-bug (topic &optional unused) "Report a bug in GNU Emacs. -Prompts for bug subject. Leaves you in a mail buffer." +Prompts for bug subject. Leaves you in a mail buffer. + +Already submitted bugs can be found in the Emacs bug tracker: + + https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;max-bugs=100;base-order=1;bug-rev=1" (declare (advertised-calling-convention (topic) "24.5")) (interactive "sBug Subject: ") ;; The syntax `version;' is preferred to `[version]' because the @@ -270,7 +274,7 @@ Prompts for bug subject. Leaves you in a mail buffer." 'face 'link 'help-echo (concat "mouse-2, RET: Follow this link") 'action (lambda (button) - (browse-url "https://debbugs.gnu.org/")) + (browse-url "https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;max-bugs=100;base-order=1;bug-rev=1")) 'follow-link t) (insert ". Please check that diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index b9920023d82..0d7193c1be0 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1203,7 +1203,7 @@ no longer matches to transformed string. Used by function feedmail-tidy-up-slug and indirectly by feedmail-queue-subject-slug-maker." :version "24.1" :group 'feedmail-queue - :type 'string + :type 'regexp ) diff --git a/lisp/mail/metamail.el b/lisp/mail/metamail.el deleted file mode 100644 index 0e407ea060e..00000000000 --- a/lisp/mail/metamail.el +++ /dev/null @@ -1,202 +0,0 @@ -;;; metamail.el --- Metamail interface for GNU Emacs - -;; Copyright (C) 1993, 1996, 2001-2020 Free Software Foundation, Inc. - -;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp> -;; Keywords: mail, news, mime, multimedia - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. - -;;; Commentary: - -;; Note: Metamail does not have all the options which are compatible with -;; the environment variables. For that reason, metamail.el has to -;; hack the environment variables. In addition, there is no way to -;; display all header fields without extra informative body messages -;; which are suppressed by the "-q" option. - -;; The idea of using metamail to process MIME messages is from -;; gnus-mime.el by Spike <Spike@world.std.com>. - -;;; Code: - -(defvar rmail-current-message) -(defvar rmail-message-vector) - -(defgroup metamail nil - "Metamail interface for Emacs." - :group 'mail - :group 'processes) - -(defcustom metamail-program-name "metamail" - "Metamail program name." - :type 'string - :group 'metamail) - -(defcustom metamail-mailer-name "emacs" - "Mailer name set to MM_MAILER environment variable." - :type 'string - :group 'metamail) - -(defvar metamail-environment '("KEYHEADS=*" "MM_QUIET=1") - "Environment variables passed to `metamail'. -It must be a list of strings that have the format ENVVARNAME=VALUE. -It is not expected to be altered globally by `set' or `setq'. -Instead, change its value temporary using `let' or `let*' form.") - -(defcustom metamail-switches '("-x" "-d" "-z") - "Switches for `metamail' program. -`-z' is required to remove zap file. -It is not expected to be altered globally by `set' or `setq'. -Instead, change its value temporary using `let' or `let*' form. -`-m MAILER' argument is automatically generated from the -`metamail-mailer-name' variable." - :type '(repeat (string :tag "Switch")) - :group 'metamail) - -;;;###autoload -(defun metamail-interpret-header () - "Interpret a header part of a MIME message in current buffer. -Its body part is not interpreted at all." - (interactive) - (save-excursion - (let* ((buffer-read-only nil) - (metamail-switches ;Inhibit processing an empty body. - (append metamail-switches '("-c" "text/plain" "-E" "7bit"))) - (end (progn - (goto-char (point-min)) - (search-forward "\n\n" nil 'move) - ;; An extra newline is inserted by metamail if there - ;; is no body part. So, insert a dummy body by - ;; itself. - (insert "\n") - (point)))) - (metamail-region (point-min) end nil nil 'nodisplay) - ;; Remove an extra newline inserted by myself. - (goto-char (point-min)) - (if (search-forward "\n\n\n" nil t) - (delete-char -1)) - ))) - -;;;###autoload -(defun metamail-interpret-body (&optional viewmode nodisplay) - "Interpret a body part of a MIME message in current buffer. -Optional argument VIEWMODE specifies the value of the -EMACS_VIEW_MODE environment variable (defaulted to 1). -Optional argument NODISPLAY non-nil means buffer is not -redisplayed as output is inserted. -Its header part is not interpreted at all." - (interactive "p") - (save-excursion - (let ((contype nil) - (encoding nil) - (end (progn - (goto-char (point-min)) - (search-forward "\n\n" nil t) - (point)))) - ;; Find Content-Type and Content-Transfer-Encoding from the header. - (save-restriction - (narrow-to-region (point-min) end) - (setq contype - (or (mail-fetch-field "Content-Type") "text/plain")) - (setq encoding - (or (mail-fetch-field "Content-Transfer-Encoding") "7bit"))) - ;; Interpret the body part only. - (let ((metamail-switches ;Process body part only. - (append metamail-switches - (list "-b" "-c" contype "-E" encoding)))) - (metamail-region end (point-max) viewmode nil nodisplay)) - ;; This mode specific hack is no longer appropriate in mbox Rmail. - ;; Pre-mbox, we have just modified the actual folder, so we - ;; update the message-vector with the new end position of the - ;; current message. In mbox Rmail, all we have done is modify a - ;; display copy of the message. Note also that point-max is a - ;; marker in the wrong buffer: the message-vector contains - ;; markers in rmail-view-buffer (which is not in rmail-mode). - ;; So this hack actually breaks the message-vector. - ;; If you're calling this on the actual rmail-view-buffer (or a - ;; non-swapped rmail-buffer), you would still need this hack. - ;; But you're not going to do that. -;;; (cond ((eq major-mode 'rmail-mode) -;;; ;; Adjust the marker of this message if in Rmail mode buffer. -;;; (set-marker (aref rmail-message-vector (1+ rmail-current-message)) -;;; (point-max)))) - ))) - -;;;###autoload -(defun metamail-buffer (&optional viewmode buffer nodisplay) - "Process current buffer through `metamail'. -Optional argument VIEWMODE specifies the value of the -EMACS_VIEW_MODE environment variable (defaulted to 1). -Optional argument BUFFER specifies a buffer to be filled (nil -means current). -Optional argument NODISPLAY non-nil means buffer is not -redisplayed as output is inserted." - (interactive "p") - (metamail-region (point-min) (point-max) viewmode buffer nodisplay)) - -;;;###autoload -(defun metamail-region (beg end &optional viewmode buffer nodisplay) - "Process current region through `metamail'. -Optional argument VIEWMODE specifies the value of the -EMACS_VIEW_MODE environment variable (defaulted to 1). -Optional argument BUFFER specifies a buffer to be filled (nil -means current). -Optional argument NODISPLAY non-nil means buffer is not -redisplayed as output is inserted." - (interactive "r\np") - (let ((curbuf (current-buffer)) - (buffer-read-only nil) - (metafile (make-temp-file "metamail")) - (option-environment - (list (format "EMACS_VIEW_MODE=%d" - (if (numberp viewmode) viewmode 1))))) - (save-excursion - ;; Gee! Metamail does not output to stdout if input comes from - ;; stdin. - (let ((selective-display nil)) ;Disable ^M to nl translation. - (write-region beg end metafile nil 'nomessage)) - (if buffer - (set-buffer buffer)) - (setq buffer-read-only nil) - ;; Clear destination buffer. - (if (eq curbuf (current-buffer)) - (delete-region beg end) - (delete-region (point-min) (point-max))) - ;; We have to pass the environment variable KEYHEADS to display - ;; all header fields. Metamail should have an optional argument - ;; to pass such information directly. - (let ((process-environment - (append process-environment - metamail-environment option-environment)) - (coding-system-for-read 'undecided)) - (apply (function call-process) - metamail-program-name - nil - t ;Output to current buffer - (not nodisplay) ;Force redisplay - (append metamail-switches - (list "-m" (or metamail-mailer-name "emacs")) - (list metafile)))) - ;; `metamail' may not delete the temporary file! - (condition-case error - (delete-file metafile) - (error nil)) - ))) - -(provide 'metamail) - -;;; metamail.el ends here diff --git a/lisp/mail/qp.el b/lisp/mail/qp.el index 388c3981c97..35ff47fd098 100644 --- a/lisp/mail/qp.el +++ b/lisp/mail/qp.el @@ -1,4 +1,4 @@ -;;; qp.el --- Quoted-Printable functions +;;; qp.el --- Quoted-Printable functions -*- lexical-binding:t -*- ;; Copyright (C) 1998-2020 Free Software Foundation, Inc. diff --git a/lisp/mail/rfc2045.el b/lisp/mail/rfc2045.el index 7d962ea2348..dba9c04cc83 100644 --- a/lisp/mail/rfc2045.el +++ b/lisp/mail/rfc2045.el @@ -1,4 +1,4 @@ -;;; rfc2045.el --- Functions for decoding rfc2045 headers +;;; rfc2045.el --- Functions for decoding rfc2045 headers -*- lexical-binding:t -*- ;; Copyright (C) 1998-2020 Free Software Foundation, Inc. diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el index 7b38288be20..afa30590059 100644 --- a/lisp/mail/rfc2368.el +++ b/lisp/mail/rfc2368.el @@ -1,4 +1,4 @@ -;;; rfc2368.el --- support for rfc2368 +;;; rfc2368.el --- support for rfc2368 -*- lexical-binding:t -*- ;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc. diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el index 1755f4eb467..db518482591 100644 --- a/lisp/mail/rmail-spam-filter.el +++ b/lisp/mail/rmail-spam-filter.el @@ -133,7 +133,7 @@ If any element matches the \"From\" header, the message is flagged as a valid, non-spam message. E.g., if your domain is \"emacs.com\" then including \"emacs\\\\.com\" in this list would flag all mail (purporting to be) from your colleagues as valid." - :type '(repeat string) + :type '(repeat regexp) :group 'rmail-spam-filter) (defcustom rsf-definitions-alist nil @@ -157,22 +157,22 @@ A rule matches only if all the specified elements match." (list :format "%v" (cons :format "%v" :value (from . "") (const :format "" from) - (string :tag "From" "")) + (regexp :tag "From" "")) (cons :format "%v" :value (to . "") (const :format "" to) - (string :tag "To" "")) + (regexp :tag "To" "")) (cons :format "%v" :value (subject . "") (const :format "" subject) - (string :tag "Subject" "")) + (regexp :tag "Subject" "")) (cons :format "%v" :value (content-type . "") (const :format "" content-type) - (string :tag "Content-Type" "")) + (regexp :tag "Content-Type" "")) (cons :format "%v" :value (contents . "") (const :format "" contents) - (string :tag "Contents" "")) + (regexp :tag "Contents" "")) (cons :format "%v" :value (x-spam-status . "") (const :format "" x-spam-status) - (string :tag "X-Spam-Status" "")) + (regexp :tag "X-Spam-Status" "")) (cons :format "%v" :value (action . output-and-delete) (const :format "" action) (choice :tag "Action selection" diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 3feff803e3e..44cde7cb5a9 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -578,11 +578,21 @@ Examples: (defvar rmail-reply-prefix "Re: " "String to prepend to Subject line when replying to a message.") +;; Note: this is matched with case-fold-search bound to t. +(defcustom rmail-re-abbrevs + "\\(RE\\|رد\\|回复\\|回覆\\|SV\\|Antw\\|VS\\|REF\\|AW\\|ΑΠ\\|ΣΧΕΤ\\|השב\\|Vá\\|R\\|RIF\\|BLS\\|RES\\|Odp\\|YNT\\|ATB\\)" + "Regexp with localized 'Re:' abbreviations in various languages." + :version "28.1" + :type 'regexp) + ;; Some mailers use "Re(2):" or "Re^2:" or "Re: Re:" or "Re[2]:". ;; This pattern should catch all the common variants. ;; rms: I deleted the change to delete tags in square brackets ;; because they mess up RT tags. -(defvar rmail-reply-regexp "\\`\\(Re\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?: *\\)*" +(defvar rmail-reply-regexp + (concat "\\`\\(" + rmail-re-abbrevs + "\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?[::] *\\)*") "Regexp to delete from Subject line before inserting `rmail-reply-prefix'.") (defcustom rmail-display-summary nil @@ -3398,7 +3408,7 @@ whitespace, replacing whitespace runs with a single space and removing prefixes such as Re:, Fwd: and so on and mailing list tags such as [tag]." (let ((subject (or (rmail-get-header "Subject" msgnum) "")) - (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) + (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,4\\}[::]\\|\\[[^]]+]\\)[ \t\n]+\\)*")) (setq subject (rfc2047-decode-string subject)) (setq subject (replace-regexp-in-string regexp "" subject)) (replace-regexp-in-string "[ \t\n]+" " " subject))) @@ -4393,9 +4403,8 @@ browsing, and moving of messages." (text face mouse function &optional token prevline)) ;; Make sure our special speedbar major mode is loaded -(if (featurep 'speedbar) - (rmail-install-speedbar-variables) - (add-hook 'speedbar-load-hook 'rmail-install-speedbar-variables)) +(with-eval-after-load 'speedbar + (rmail-install-speedbar-variables)) (defun rmail-speedbar-buttons (buffer) "Create buttons for BUFFER containing rmail messages. |