diff options
| author | Tom Tromey <tromey@redhat.com> | 2012-12-17 07:56:22 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2012-12-17 07:56:22 -0700 |
| commit | 3d6eced1ae51ffd0a782130e7c334052277e2724 (patch) | |
| tree | 5d1d2ad7cd3374f922886c4a72062511a035c168 /lisp/mail | |
| parent | bf69f522a9e135f9aa483cedd53e71e915f2bf75 (diff) | |
| parent | 7c3d167f48d6262ee4e5512aa50a07ee96bc1509 (diff) | |
| download | emacs-3d6eced1ae51ffd0a782130e7c334052277e2724.tar.gz | |
merge from trunk
Diffstat (limited to 'lisp/mail')
| -rw-r--r-- | lisp/mail/emacsbug.el | 136 | ||||
| -rw-r--r-- | lisp/mail/feedmail.el | 5 | ||||
| -rw-r--r-- | lisp/mail/mail-hist.el | 2 | ||||
| -rw-r--r-- | lisp/mail/mailabbrev.el | 55 | ||||
| -rw-r--r-- | lisp/mail/mailalias.el | 2 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 58 | ||||
| -rw-r--r-- | lisp/mail/rmailedit.el | 26 | ||||
| -rw-r--r-- | lisp/mail/rmailmm.el | 48 | ||||
| -rw-r--r-- | lisp/mail/rmailsum.el | 4 | ||||
| -rw-r--r-- | lisp/mail/sendmail.el | 9 | ||||
| -rw-r--r-- | lisp/mail/smtpmail.el | 12 | ||||
| -rw-r--r-- | lisp/mail/supercite.el | 22 | ||||
| -rw-r--r-- | lisp/mail/uce.el | 2 | ||||
| -rw-r--r-- | lisp/mail/unrmail.el | 41 |
14 files changed, 192 insertions, 230 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 6ee3c7898c5..68a47d91023 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -60,10 +60,6 @@ ;; User options end here. -(defvar report-emacs-bug-tracker-url "http://debbugs.gnu.org/cgi/" - "Base URL of the GNU bugtracker. -Used for querying duplicates and linking to existing bugs.") - (defvar report-emacs-bug-orig-text nil "The automatically-created initial text of the bug report.") @@ -160,11 +156,6 @@ Prompts for bug subject. Leaves you in a mail buffer." (when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version) (setq topic (concat (match-string 1 emacs-version) "; " topic)))) (let ((from-buffer (current-buffer)) - ;; Put these properties on semantically-void text. - ;; report-emacs-bug-hook deletes these regions before sending. - (prompt-properties '(field emacsbug-prompt - intangible but-helpful - rear-nonsticky t)) (can-insert-mail (or (report-emacs-bug-can-use-xdg-email) (report-emacs-bug-can-use-osx-open))) user-point message-end-point) @@ -194,7 +185,7 @@ Prompts for bug subject. Leaves you in a mail buffer." (insert (format "The report will be sent to %s.\n\n" report-emacs-bug-address)) (insert "This bug report will be sent to the ") - (insert-button + (insert-text-button "Bug-GNU-Emacs" 'face 'link 'help-echo (concat "mouse-2, RET: Follow this link") @@ -202,7 +193,7 @@ Prompts for bug subject. Leaves you in a mail buffer." (browse-url "http://lists.gnu.org/archive/html/bug-gnu-emacs/")) 'follow-link t) (insert " mailing list\nand the GNU bug tracker at ") - (insert-button + (insert-text-button "debbugs.gnu.org" 'face 'link 'help-echo (concat "mouse-2, RET: Follow this link") @@ -220,11 +211,10 @@ usually do not have translators for other languages.\n\n"))) (insert "Please describe exactly what actions triggered the bug, and\n" "the precise symptoms of the bug. If you can, give a recipe\n" "starting from `emacs -Q':\n\n") - (add-text-properties (save-excursion - (rfc822-goto-eoh) - (line-beginning-position 2)) - (point) - prompt-properties) + (let ((txt (delete-and-extract-region + (save-excursion (rfc822-goto-eoh) (line-beginning-position 2)) + (point)))) + (insert (propertize "\n" 'display txt))) (setq user-point (point)) (insert "\n\n") @@ -236,7 +226,8 @@ usually do not have translators for other languages.\n\n"))) (if (file-readable-p debug-file) (insert "For information about debugging Emacs, please read the file\n" debug-file ".\n"))) - (add-text-properties (1+ user-point) (point) prompt-properties) + (let ((txt (delete-and-extract-region (1+ user-point) (point)))) + (insert (propertize "\n" 'display txt))) (insert "\n\nIn " (emacs-version) "\n") (if (stringp emacs-bzr-version) @@ -248,6 +239,13 @@ usually do not have translators for other languages.\n\n"))) "', version " (mapconcat 'number-to-string (x-server-version) ".") "\n") (error t))) + (let ((lsb (with-temp-buffer + (if (eq 0 (ignore-errors + (call-process "lsb_release" nil '(t nil) + nil "-d"))) + (buffer-string))))) + (if (stringp lsb) + (insert "System " lsb "\n"))) (when (and system-configuration-options (not (equal system-configuration-options ""))) (insert "Configured using:\n `configure " @@ -308,9 +306,14 @@ usually do not have translators for other languages.\n\n"))) (insert "\n")) (insert "\n") (insert "Load-path shadows:\n") - (message "Checking for load-path shadows...") - (let ((shadows (list-load-path-shadows t))) - (message "Checking for load-path shadows...done") + (let* ((msg "Checking for load-path shadows...") + (result "done") + (shadows (progn (message "%s" msg) + (condition-case nil (list-load-path-shadows t) + (error + (setq result "error") + "Error during checking"))))) + (message "%s%s" msg result) (insert (if (zerop (length shadows)) "None found.\n" shadows))) @@ -422,99 +425,8 @@ and send the mail again%s." from)) (not (yes-or-no-p (format "Is `%s' really your email address? " from))) - (error "Please edit the From address and try again")))) - ;; Delete the uninteresting text that was just to help fill out the report. - (rfc822-goto-eoh) - (forward-line 1) - (let ((pos (1- (point)))) - (while (setq pos (text-property-any pos (point-max) - 'field 'emacsbug-prompt)) - (delete-region pos (field-end (1+ pos))))))) - - -;; Querying the bug database - -(defvar report-emacs-bug-bug-alist nil) -(make-variable-buffer-local 'report-emacs-bug-bug-alist) -(defvar report-emacs-bug-choice-widget nil) -(make-variable-buffer-local 'report-emacs-bug-choice-widget) - -(defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords) - (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*")) - (setq buffer-read-only t) - (let ((inhibit-read-only t)) - (erase-buffer) - (setq report-emacs-bug-bug-alist bugs) - (widget-insert (propertize (concat "Already known bugs (" - keywords "):\n\n") - 'face 'bold)) - (if bugs - (setq report-emacs-bug-choice-widget - (apply 'widget-create 'radio-button-choice - :value (caar bugs) - (let (items) - (dolist (bug bugs) - (push (list - 'url-link - :format (concat "Bug#" (number-to-string (nth 2 bug)) - ": " (cadr bug) "\n %[%v%]\n") - ;; FIXME: Why is only the link of the - ;; active item clickable? - (car bug)) - items)) - (nreverse items)))) - (widget-insert "No bugs matching your keywords found.\n")) - (widget-insert "\n") - (widget-create 'push-button - :notify (lambda (&rest ignore) - ;; TODO: Do something! - (message "Reporting new bug!")) - "Report new bug") - (when bugs - (widget-insert " ") - (widget-create 'push-button - :notify (lambda (&rest ignore) - (let ((val (widget-value report-emacs-bug-choice-widget))) - ;; TODO: Do something! - (message "Appending to bug %s!" - (nth 2 (assoc val report-emacs-bug-bug-alist))))) - "Append to chosen bug")) - (widget-insert " ") - (widget-create 'push-button - :notify (lambda (&rest ignore) - (kill-buffer)) - "Quit reporting bug") - (widget-insert "\n")) - (use-local-map widget-keymap) - (widget-setup) - (goto-char (point-min))) - -(defun report-emacs-bug-parse-query-results (status keywords) - (goto-char (point-min)) - (let (buglist) - (while (re-search-forward "<a href=\"bugreport\\.cgi\\?bug=\\([[:digit:]]+\\)\">\\([^<]+\\)</a>" nil t) - (let ((number (match-string 1)) - (subject (match-string 2))) - (when (not (string-match "^#" subject)) - (push (list - ;; first the bug URL - (concat report-emacs-bug-tracker-url - "bugreport.cgi?bug=" number) - ;; then the subject and number - subject (string-to-number number)) - buglist)))) - (report-emacs-bug-create-existing-bugs-buffer (nreverse buglist) keywords))) + (error "Please edit the From address and try again")))))) -;;;###autoload -(defun report-emacs-bug-query-existing-bugs (keywords) - "Query for KEYWORDS at `report-emacs-bug-tracker-url', and return the result. -The result is an alist with items of the form (URL SUBJECT NO)." - (interactive "sBug keywords (comma separated): ") - (url-retrieve (concat report-emacs-bug-tracker-url - "pkgreport.cgi?include=subject%3A" - (replace-regexp-in-string "[[:space:]]+" "+" keywords) - ";package=emacs") - 'report-emacs-bug-parse-query-results (list keywords))) (provide 'emacsbug) diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 520271940f2..4305094611a 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -139,9 +139,8 @@ ;; feedmail-send-it. Hers's the best way to use the stuff in this ;; file: ;; -;; Save this file as feedmail.el somewhere on your elisp -;; loadpath; byte-compile it. Put the following lines somewhere in -;; your ~/.emacs stuff: +;; Save this file as feedmail.el somewhere on your elisp loadpath; +;; byte-compile it. Put the following lines in your init file: ;; ;; (setq send-mail-function 'feedmail-send-it) ;; (autoload 'feedmail-send-it "feedmail") diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el index dd489e3c6a9..40d67b4e904 100644 --- a/lisp/mail/mail-hist.el +++ b/lisp/mail/mail-hist.el @@ -28,7 +28,7 @@ ;; time. ;; ;; To use this package, put it in a directory in your load-path, and -;; put this in your .emacs file: +;; put this in your init file: ;; ;; (load "mail-hist" nil t) ;; diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 290c57c1c55..aa507897243 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -391,35 +391,24 @@ double-quotes." (defun mail-abbrev-expand-hook () "For use as the fourth arg to `define-abbrev'. After expanding a mail-abbrev, if Auto Fill mode is on and we're past the -fill-column, break the line at the previous comma, and indent the next line." - ;; Disable abbrev mode to avoid recursion in indent-relative expanding - ;; part of the abbrev expansion as an abbrev itself. - (let ((abbrev-mode nil)) - (save-excursion - (let ((p (point)) - bol comma fp) - (beginning-of-line) - (setq bol (point)) - (goto-char p) - (while (and auto-fill-function - (>= (current-column) fill-column) - (search-backward "," bol t)) - (setq comma (point)) - (forward-char 1) ; Now we are just past the comma. - (insert "\n") - (delete-horizontal-space) - (setq p (point)) - (indent-relative) - (setq fp (buffer-substring p (point))) - ;; Go to the end of the new line. - (end-of-line) - (if (> (current-column) fill-column) - ;; It's still too long; do normal auto-fill. - (let ((fill-prefix (or fp "\t"))) - (do-auto-fill))) - ;; Resume the search. - (goto-char comma) - ))))) +fill-column, break the line at the previous comma, and indent the next line +with a space." + (when auto-fill-function + (let (p) + (save-excursion + (while (>= (current-column) fill-column) + (while (and (search-backward "," (point-at-bol) 'move) + (>= (current-column) (1- fill-column)) + (setq p (point)))) + (when (or (not (bolp)) + (and p (goto-char p))) + (setq p nil) + (forward-char 1) + (insert "\n") + (when (looking-at "[\t ]+") + (delete-region (point) (match-end 0))) + (insert " ") + (end-of-line))))))) ;;; Syntax tables and abbrev-expansion @@ -483,10 +472,12 @@ of a mail alias. The value is set up, buffer-local, when first needed.") (defun mail-abbrev-expand-wrapper (expand) (if (and mail-abbrevs (not (eq mail-abbrevs t))) - (if (mail-abbrev-in-expansion-header-p) + (if (or (mail-abbrev-in-expansion-header-p) + ;; Necessary for `message-read-from-minibuffer' to work. + (window-minibuffer-p)) - ;; We are in a To: (or CC:, or whatever) header, and - ;; should use word-abbrevs to expand mail aliases. + ;; We are in a To: (or CC:, or whatever) header or a minibuffer, + ;; and should use word-abbrevs to expand mail aliases. (let ((local-abbrev-table mail-abbrevs)) ;; Before anything else, resolve aliases if they need it. diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 0b55fe42e42..c7943fe40c8 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -427,6 +427,7 @@ For use on `completion-at-point-functions'." "Perform completion on header field or word preceding point. Completable headers are according to `mail-complete-alist'. If none matches current header, calls `mail-complete-function' and passes prefix ARG if any." + (declare (obsolete mail-completion-at-point-function "24.1")) (interactive "P") ;; Read the defaults first, if we have not done so. (sendmail-sync-aliases) @@ -439,7 +440,6 @@ current header, calls `mail-complete-function' and passes prefix ARG if any." (if data (apply #'completion-in-region data) (funcall mail-complete-function arg)))) -(make-obsolete 'mail-complete 'mail-completion-at-point-function "24.1") (defun mail-completion-expand (table) "Build new completion table that expands aliases. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index d88862b2d47..9c48788553b 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -100,6 +100,10 @@ its character representation and its display representation.") "The current header display style choice, one of 'normal (selected headers) or 'full (all headers).") +(defvar rmail-mime-decoded nil + "Non-nil if message has been processed by `rmail-show-mime-function'.") +(put 'rmail-mime-decoded 'permanent-local t) ; for rmail-edit + (defgroup rmail nil "Mail reader for Emacs." :group 'mail) @@ -2699,6 +2703,27 @@ N defaults to the current message." :group 'rmail :version "23.1") +;; FIXME? +;; rmail-show-mime-function does not unquote >From lines. Should it? +(defcustom rmail-mbox-format 'mboxrd + "The mbox format that your system uses. +There is no way to determine this, so you should set the appropriate value. +The formats quote lines containing \"From \" differently. +The choices are: + `mboxo' : lines that start with \"From \" quoted as \">From \" + `mboxrd': lines that start with \">*From \" quoted with another \">\" +The `mboxo' format is ambiguous, in that one cannot know whether +a line starting with \">From \" originally had a \">\" or not. + +It is not critical to set this to the correct value; it only affects +how Rmail displays lines starting with \">*From \" in non-MIME messages. + +See also `unrmail-mbox-format'." + :type '(choice (const mboxrd) + (const mboxro)) + :version "24.4" + :group 'rmail-files) + (defun rmail-show-message-1 (&optional msg) "Show message MSG (default: current message) using `rmail-view-buffer'. Return text to display in the minibuffer if MSG is out of @@ -2747,6 +2772,7 @@ The current mail message becomes the message displayed." (re-search-forward "mime-version: 1.0" nil t)) (let ((rmail-buffer mbox-buf) (rmail-view-buffer view-buf)) + (set (make-local-variable 'rmail-mime-decoded) t) (funcall rmail-show-mime-function)) (setq body-start (search-forward "\n\n" nil t)) (narrow-to-region beg (point)) @@ -2791,11 +2817,15 @@ The current mail message becomes the message displayed." ;; Prepare the separator (blank line) before the body. (goto-char (point-min)) (insert "\n") - ;; Unquote quoted From lines - (while (re-search-forward "^>+From " nil t) - (beginning-of-line) - (delete-char 1) - (forward-line)) + ;; Unquote quoted From lines. + (let ((fromline (if (eq 'mboxrd rmail-mbox-format) + "^>+From " + "^>From ")) + case-fold-search) + (while (re-search-forward fromline nil t) + (beginning-of-line) + (delete-char 1) + (forward-line))) (goto-char (point-min))) ;; Copy the headers to the front of the message view buffer. (rmail-copy-headers beg end) @@ -3869,6 +3899,7 @@ see the documentation of `rmail-resend'." (msgnum rmail-current-message) (subject (concat "[" (let ((from (or (mail-fetch-field "From") + ;; FIXME - huh? (mail-fetch-field ">From")))) (if from (concat (mail-strip-quoted-names from) ": ") @@ -4068,6 +4099,13 @@ The variable `rmail-retry-ignored-headers' is a regular expression specifying headers which should not be copied into the new message." (interactive) (require 'mail-utils) + (if rmail-enable-mime + (with-current-buffer rmail-buffer + (if (rmail-mime-message-p) + (let ((rmail-mime-mbox-buffer rmail-view-buffer) + (rmail-mime-view-buffer rmail-buffer)) + (rmail-mime-toggle-raw 'raw))))) + (let ((rmail-this-buffer (current-buffer)) (msgnum rmail-current-message) bounce-start bounce-end bounce-indent resending @@ -4187,6 +4225,7 @@ This has an effect only if a summary buffer exists." ;; Put the summary buffer back on the screen, if user wants that. (defun rmail-maybe-display-summary () (let ((selected (selected-window)) + (buffer (current-buffer)) window) ;; If requested, make sure the summary is displayed. (and rmail-summary-buffer (buffer-name rmail-summary-buffer) @@ -4208,7 +4247,8 @@ This has an effect only if a summary buffer exists." (progn (select-window window) (enlarge-window (- rmail-summary-window-size (window-height)))) - (select-window selected))))) + (select-window selected) + (set-buffer buffer))))) ;;;; *** Rmail Local Fontification *** @@ -4543,7 +4583,7 @@ encoded string (and the same mask) will decode the string." ;;; Start of automatically extracted autoloads. ;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el" -;;;;;; "7d558f958574f6003fa474ce2f3c80a8") +;;;;;; "791ea184628feb6335fe3e29f7234934") ;;; Generated autoloads from rmailedit.el (autoload 'rmail-edit-current-message "rmailedit" "\ @@ -4598,7 +4638,7 @@ With prefix argument N moves forward N messages with these labels. ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "cd7656f82944d0b92b0d093a5f3a4c36") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "f1937f85a1258de8880a089fa5ae5621") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ @@ -4700,7 +4740,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse order. ;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic ;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels -;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "bef21a376bd5bd59792a20dd86e6ec34") +;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "856fc6e337d5398b302c448ee7a2315e") ;;; Generated autoloads from rmailsum.el (autoload 'rmail-summary "rmailsum" "\ diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index 0b837a43d94..004eb2e3247 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -111,6 +111,8 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. ;; Even if the message is in `raw' state, boundaries etc ;; are still missing. All we can do is insert the real ;; raw message. (Bug#9840) + ;; FIXME? Since the 2012-09-17 changes to rmail-mime, + ;; can we just use that function now? (when (and entity (not (equal "text/plain" (car (rmail-mime-entity-type entity))))) @@ -165,10 +167,25 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (if (or rmail-old-mime-state (not rmail-old-pruned)) (forward-line 1)) - (while (re-search-forward "^>*From " nil t) - (beginning-of-line) - (insert ">") - (forward-line)) + ;; When editing a non-MIME message, rmail-show-message-1 has unescaped + ;; ^>*From lines according to rmail-mbox-format. We are editing + ;; the message as it was displayed, and need to put the escapes when done. + ;; When editing a MIME message, we are editing the "raw" message. + ;; ^>*From lines have not been escaped, but we still need to ensure + ;; a "^From " line is escaped so as not to break later parsing (?). + ;; With ^>+From lines, we have no way of knowing whether the person + ;; doing the editing escaped them or not, so it seems best to leave + ;; them alone. (This all assumes you are using rmailmm rather than + ;; something else that behaves differently.) + (let ((fromline (if (or (eq 'mboxo rmail-mbox-format) + rmail-mime-decoded) + "^From " + "^>*From ")) + case-fold-search) + (while (re-search-forward fromline nil t) + (beginning-of-line) + (insert ">") + (forward-line))) ;; Make sure buffer ends with a blank line so as not to run this ;; message together with the following one. (goto-char (point-max)) @@ -199,6 +216,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (setq buffer-undo-list t) (rmail-variables)) ;; If text has really changed, mark message as edited. + ;; FIXME we should do the comparison before escaping From lines. (unless (and (= (length old) (- (point-max) (point-min))) (string= old (buffer-substring (point-min) (point-max)))) (setq old nil) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 67b2e62275f..11bccd59765 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -389,13 +389,13 @@ Use `raw' for raw mode, and any other non-nil value for decoded mode." ;; Enter the raw mode. (rmail-mime-raw-mode entity) ;; Enter the shown mode. - (rmail-mime-shown-mode entity)) - (let ((inhibit-read-only t) - (modified (buffer-modified-p))) - (save-excursion - (goto-char (aref segment 1)) - (rmail-mime-insert entity) - (restore-buffer-modified-p modified))))) + (rmail-mime-shown-mode entity) + (let ((inhibit-read-only t) + (modified (buffer-modified-p))) + (save-excursion + (goto-char (aref segment 1)) + (rmail-mime-insert entity) + (restore-buffer-modified-p modified)))))) (defun rmail-mime-toggle-hidden () "Hide or show the body of the MIME-entity at point." @@ -832,7 +832,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'." (let ((boundary (cdr (assq 'boundary content-type))) (subtype (cadr (split-string (car content-type) "/"))) (index 0) - beg end next entities truncated) + beg end next entities truncated last) (unless boundary (rmail-mm-get-boundary-error-message "No boundary defined" content-type content-disposition @@ -867,7 +867,13 @@ The other arguments are the same as `rmail-mime-multipart-handler'." ;; Handle the rest of the truncated message ;; (if it isn't empty) by pretending that the boundary ;; appears at the end of the message. - (and (save-excursion + ;; We use `last' to distinguish this from the more + ;; likely situation of there being an epilogue + ;; after the last boundary, which should be ignored. + ;; See rmailmm-test-multipart-handler for an example, + ;; and also bug#10101. + (and (not last) + (save-excursion (skip-chars-forward "\n") (> (point-max) (point))) (setq truncated t end (point-max)))) @@ -875,7 +881,8 @@ The other arguments are the same as `rmail-mime-multipart-handler'." ;; epilogue, else hide the boundary only. Use a marker for ;; `next' because `rmail-mime-show' may change the buffer. (cond ((looking-at "--[ \t]*$") - (setq next (point-max-marker))) + (setq next (point-max-marker) + last t)) ((looking-at "[ \t]*\n") (setq next (copy-marker (match-end 0) t))) (truncated @@ -1212,7 +1219,7 @@ available." (if (rmail-mime-display-header current) (delete-char (- (aref segment 2) (aref segment 1)))) (insert-buffer-substring rmail-mime-mbox-buffer - (aref header 0) (aref header 1))) + (aref header 0) (aref header 1))) ;; tagline (if (rmail-mime-display-tagline current) (delete-char (- (aref segment 3) (aref segment 2)))) @@ -1261,14 +1268,17 @@ The arguments ARG and STATE have no effect in this case." (interactive (list current-prefix-arg nil)) (if rmail-enable-mime (with-current-buffer rmail-buffer - (if (rmail-mime-message-p) - (let ((rmail-mime-mbox-buffer rmail-view-buffer) - (rmail-mime-view-buffer rmail-buffer) - (entity (get-text-property - (progn - (or arg (goto-char (point-min))) - (point)) 'rmail-mime-entity))) - (if (or (not arg) entity) (rmail-mime-toggle-raw state))) + (if (or (rmail-mime-message-p) + (get-text-property (point-min) 'rmail-mime-hidden)) + (let* ((hidden (get-text-property (point-min) 'rmail-mime-hidden)) + (desired-hidden (if state (eq state 'raw) (not hidden)))) + (unless (eq hidden desired-hidden) + (if (not desired-hidden) + (rmail-show-message rmail-current-message) + (let ((rmail-enable-mime nil) + (inhibit-read-only t)) + (rmail-show-message rmail-current-message) + (add-text-properties (point-min) (point-max) '(rmail-mime-hidden t)))))) (message "Not a MIME message, just toggling headers") (rmail-toggle-header))) (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string)) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index d3a464161cb..cacc6e19416 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -428,7 +428,7 @@ nil for FUNCTION means all messages." ;; This is how rmail makes the summary buffer reappear. ;; We do this here to make the window the proper size. (rmail-select-summary nil) - (set-buffer rmail-summary-buffer)) + (set-buffer sumbuf)) (rmail-summary-goto-msg mesg t t) (rmail-summary-construct-io-menu) (message "Computing summary lines...done"))) @@ -785,7 +785,7 @@ the message being processed." (setq pos (point)) (forward-line 1) (setq str (buffer-substring pos (1- (point)))) - (while (looking-at "\\s ") + (while (looking-at "[ \t]") (setq str (concat str " " (buffer-substring (match-end 0) (line-end-position)))) diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index b75841489c9..afa13fe4e04 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -243,15 +243,14 @@ Used by `mail-yank-original' via `mail-indent-citation'." :type 'integer :group 'sendmail) -;; FIXME make it really obsolete. (defvar mail-yank-hooks nil "Obsolete hook for modifying a citation just inserted in the mail buffer. Each hook function can find the citation between (point) and (mark t). And each hook function should leave point and mark around the citation text as modified. - This is a normal hook, misnamed for historical reasons. -It is semi-obsolete and mail agents should no longer use it.") +It is obsolete and mail agents should no longer use it.") +(make-obsolete-variable 'mail-yank-hooks 'mail-citation-hook "19.34") ;;;###autoload (defcustom mail-citation-hook nil @@ -1414,6 +1413,7 @@ just append to the file, in Babyl format if necessary." (defun mail-sent-via () "Make a Sent-via header line from each To or CC header line." + (declare (obsolete "nobody can remember what it is for." "24.1")) (interactive) (save-excursion ;; put a marker at the end of the header @@ -1433,9 +1433,6 @@ just append to the file, in Babyl format if necessary." (point))))) ;; Insert a copy, with altered header field name. (insert-before-markers "Sent-via:" to-line)))))) - -(make-obsolete 'mail-sent-via "nobody can remember what it is for." "24.1") - (defun mail-to () "Move point to end of To field, creating it if necessary." diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 804fe7a8798..69a405436a7 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -200,10 +200,10 @@ The list is in preference order.") ;; local binding in the mail buffer will take effect. (smtpmail-mail-address (or (and mail-specify-envelope-from (mail-envelope-from)) - (smtpmail-user-mail-address) - (let ((from (mail-fetch-field "from"))) + (let ((from (mail-fetch-field "from"))) (and from - (cadr (mail-extract-address-components from)))))) + (cadr (mail-extract-address-components from)))) + (smtpmail-user-mail-address))) (smtpmail-code-conv-from (if enable-multibyte-characters (let ((sendmail-coding-system smtpmail-code-conv-from)) @@ -653,12 +653,10 @@ Returns an error if the server cannot be contacted." (or smtpmail-mail-address (and mail-specify-envelope-from (mail-envelope-from)) - (smtpmail-user-mail-address) - ;; Fall back on the From: header as the envelope From - ;; address. (let ((from (mail-fetch-field "from"))) (and from - (cadr (mail-extract-address-components from)))))) + (cadr (mail-extract-address-components from)))) + (smtpmail-user-mail-address))) response-code process-buffer result diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index d10b073eb12..99e5df82bef 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -506,8 +506,6 @@ string." ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ;; end user configuration variables -(define-obsolete-variable-alias 'sc-version 'emacs-version "23.1") - (defvar sc-mail-info nil "Alist of mail header information gleaned from reply buffer.") (defvar sc-attributions nil @@ -559,10 +557,8 @@ string." (define-key map "r" 'sc-recite-region) (define-key map "\C-p" 'sc-raw-mode-toggle) (define-key map "u" 'sc-uncite-region) - (define-key map "v" 'sc-version) (define-key map "w" 'sc-insert-reference) (define-key map "\C-t" sc-T-keymap) - (define-key map "\C-b" 'sc-submit-bug-report) (define-key map "?" 'sc-describe) map) "Keymap for Supercite quasi-mode.") @@ -1969,29 +1965,11 @@ cited." (insert (sc-mail-field "sc-citation")) (error "Line is already cited")))) -;; The argument logic here is crazy. -(defun sc-version (message) - "Return the current Supercite version. -If MESSAGE is non-nil (interactively, with no prefix argument), -echoes the version in the minibuffer. Otherwise, inserts the -version at point." - (interactive (list (not current-prefix-arg))) - (let ((verstr (format "Using Supercite.el %s" emacs-version))) - (if message - (message verstr) - (insert "`sc-version' says: " verstr)))) - -(make-obsolete 'sc-version 'emacs-version "23.1") - (defun sc-describe () "Read the Supercite info node." (interactive) (info "(SC)top")) -(make-obsolete 'sc-describe "read the SC manual using `info'." "23.1") - -(define-obsolete-function-alias 'sc-submit-bug-report 'report-emacs-bug "23.1") - ;; useful stuff (provide 'supercite) diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el index fdfe17a1a07..3d7495ffd1a 100644 --- a/lisp/mail/uce.el +++ b/lisp/mail/uce.el @@ -63,7 +63,7 @@ ;; Usage: ;; Place uce.el in your load-path (and optionally byte-compile it). -;; Add the following line to your ~/.emacs: +;; Add the following line to your init file: ;; (autoload 'uce-reply-to-uce "uce" "Reply to UCEs" t nil) ;; If you want to use it with Gnus rather than Rmail: ;; (setq uce-mail-reader 'gnus) diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index bf7b9abe2c1..fd7e49a65d5 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -1,6 +1,6 @@ -;;; unrmail.el --- convert Rmail Babyl files to mailbox files +;;; unrmail.el --- convert Rmail Babyl files to mbox files -;; Copyright (C) 1992, 2001-2012 Free Software Foundation, Inc. +;; Copyright (C) 1992, 2001-2012 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: mail @@ -26,7 +26,7 @@ ;;;###autoload (defun batch-unrmail () - "Convert old-style Rmail Babyl files to system inbox format. + "Convert old-style Rmail Babyl files to mbox format. Specify the input Rmail Babyl file names as command line arguments. For each Rmail file, the corresponding output file name is made by adding `.mail' at the end. @@ -45,9 +45,26 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (declare-function mail-mbox-from "mail-utils" ()) (defvar rmime-magic-string) ; in rmime.el, if you have it +(defcustom unrmail-mbox-format 'mboxrd + "The mbox format that `unrmail' should produce. +These formats separate messages using lines that start with \"From \". +Therefore any lines in the message bodies that start with \"From \" +must be quoted. The `mboxo' format just prepends a \">\" to such lines. +This is not reversible, because given a line starting with \">From \" in +an mboxo file, it is not possible to know whether the original had a \">\" +or not. The `mxbord' format avoids this by also quoting \">From \" as +\">>From \", and so on. For this reason, mboxrd is recommended. + +See also `rmail-mbox-format'." + :type '(choice (const mboxrd) + (const mboxro)) + :version "24.4" + :group 'rmail-files) + ;;;###autoload (defun unrmail (file to-file) - "Convert old-style Rmail Babyl file FILE to system inbox format file TO-FILE." + "Convert old-style Rmail Babyl file FILE to mbox format file TO-FILE. +The variable `unrmail-mbox-format' controls which mbox format to use." (interactive "fUnrmail (babyl file): \nFUnrmail into (new mailbox file): ") (with-temp-buffer ;; Read in the old Rmail file with no decoding. @@ -224,13 +241,15 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (when keywords (insert "X-RMAIL-KEYWORDS: " keywords "\n")) (goto-char (point-min)) - ;; ``Quote'' "\nFrom " as "\n>From " - ;; (note that this isn't really quoting, as there is no requirement - ;; that "\n[>]+From " be quoted in the same transparent way.) - (let ((case-fold-search nil)) - (while (search-forward "\nFrom " nil t) - (forward-char -5) - (insert ?>))) + ;; Convert From to >From, etc. + (let ((case-fold-search nil) + (fromline (if (eq 'mboxrd unrmail-mbox-format) + "^>*From " + "^From "))) + (while (re-search-forward fromline nil t) + (beginning-of-line) + (insert ?>) + (forward-line 1))) (goto-char (point-max)) ;; Add terminator blank line to message. (insert "\n") |
