diff options
Diffstat (limited to 'lisp/mail')
-rw-r--r-- | lisp/mail/binhex.el | 5 | ||||
-rw-r--r-- | lisp/mail/feedmail.el | 2 | ||||
-rw-r--r-- | lisp/mail/rmail.el | 65 | ||||
-rw-r--r-- | lisp/mail/rmailkwd.el | 3 | ||||
-rw-r--r-- | lisp/mail/rmailmm.el | 3 | ||||
-rw-r--r-- | lisp/mail/rmailout.el | 6 | ||||
-rw-r--r-- | lisp/mail/unrmail.el | 5 |
7 files changed, 60 insertions, 29 deletions
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el index 5332c0f14ba..32593462062 100644 --- a/lisp/mail/binhex.el +++ b/lisp/mail/binhex.el @@ -79,10 +79,11 @@ input and write the converted data to its standard output." ;;;###autoload (defconst binhex-begin-line - "^:...............................................................$") + "^:...............................................................$" + "Regular expression matching the start of a BinHex encoded region.") (defconst binhex-body-line "^[^:]...............................................................$") -(defconst binhex-end-line ":$") +(defconst binhex-end-line ":$") ; unused (defvar binhex-temporary-file-directory (cond ((fboundp 'temp-directory) (temp-directory)) diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 7167fa567d3..7e3d983a76c 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -2026,7 +2026,7 @@ backup file names and the like)." (if (looking-at ".*\r\n.*\r\n") (while (search-forward "\r\n" nil t) (replace-match "\n" nil t))) -;; ;; work around text-vs-binary wierdness +;; ;; work around text-vs-binary weirdness ;; ;; if we don't find the normal M-H-S, try reading the file a different way ;; (if (not (feedmail-find-eoh t)) ;; (let ((file-name-buffer-file-type-alist nil) (default-buffer-file-type nil)) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 184eaca6c4b..230424c1920 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -482,6 +482,7 @@ still the current message in the Rmail buffer.") ;; It's not clear what it should do now, since there is nothing that ;; records when a message is shown for the first time (unseen is not ;; necessarily the same thing). +;; See http://lists.gnu.org/archive/html/emacs-devel/2009-03/msg00013.html (defcustom rmail-message-filter nil "If non-nil, a filter function for new messages in RMAIL. Called with region narrowed to the message, including headers, @@ -489,30 +490,41 @@ before obeying `rmail-ignored-headers'." :group 'rmail-headers :type '(choice (const nil) function)) +(make-obsolete-variable 'rmail-message-filter + "it is not used (try `rmail-show-message-hook')." + "23.1") + (defcustom rmail-automatic-folder-directives nil - "List of directives specifying where to put a message. + "List of directives specifying how to automatically file messages. +Whenever Rmail shows a message in the folder that `rmail-file-name' +specifies, it calls `rmail-auto-file' to maybe file the message in +another folder according to this list. Messages that are already +marked as `filed', or are in different folders, are left alone. + Each element of the list is of the form: (FOLDERNAME FIELD REGEXP [ FIELD REGEXP ] ... ) -Where FOLDERNAME is the name of a folder to put the message. -If any of the field regexp's are nil, then it is ignored. +FOLDERNAME is the name of a folder in which to put the message. +If FOLDERNAME is nil then Rmail deletes the message, and moves on to +the next. If FOLDERNAME is \"/dev/null\", Rmail deletes the message, +but does not move to the next. -If FOLDERNAME is \"/dev/null\", it is deleted. -If FOLDERNAME is nil then it is deleted, and skipped. +FIELD is the name of a header field in the message, such as +\"subject\" or \"from\". A FIELD of \"to\" includes all text +from both the \"to\" and \"cc\" headers. -FIELD is the plain text name of a field in the message, such as -\"subject\" or \"from\". A FIELD of \"to\" will automatically include -all text from the \"cc\" field as well. +REGEXP is a regular expression to match (case-sensitively) against +the preceding specified FIELD. -REGEXP is an expression to match in the preceding specified FIELD. -FIELD/REGEXP pairs continue in the list. +There may be any number of FIELD/REGEXP pairs. +All pairs must match for a directive to apply to a message. +For a given message, Rmail applies only the first matching directive. -examples: +Examples: (\"/dev/null\" \"from\" \"@spam.com\") ; delete all mail from spam.com (\"RMS\" \"from\" \"rms@\") ; save all mail from RMS. - -Note that this is only applied in the folder specifed by `rmail-file-name'." +" :group 'rmail :version "21.1" :type '(repeat (sexp :tag "Directive"))) @@ -552,7 +564,9 @@ In a summary buffer, this holds the RMAIL buffer it is a summary for.") ;; Message counters and markers. Deleted flags. (defvar rmail-current-message nil - "Integer specifying the message currently being displayed in this folder.") + "Integer specifying the message currently being displayed in this folder. +Counts messages from 1 to `rmail-total-messages'. A value of 0 +means there are no messages in the folder.") (put 'rmail-current-message 'permanent-local t) (defvar rmail-total-messages nil @@ -2934,8 +2948,11 @@ Uses the face specified by `rmail-highlight-face'." (cons overlay rmail-overlay-list)))))))))) (defun rmail-auto-file () - "Automatically move a message into a sub-folder based on criteria. -Called when a new message is displayed." + "Automatically move a message into another sfolder based on criteria. +This moves messages according to `rmail-automatic-folder-directives'. +It only does something in the folder that `rmail-file-name' specifies. +The function `rmail-show-message' calls this whenever it shows a message. +This leaves a message alone if it already has the `filed' attribute." (if (or (zerop rmail-total-messages) (rmail-message-attr-p rmail-current-message "...F") (not (string= (buffer-file-name) @@ -2955,10 +2972,14 @@ Called when a new message is displayed." directive-loop (cdr (car d))) (while (and (car directive-loop) (let ((f (cond - ((string= (car directive-loop) "from") from) - ((string= (car directive-loop) "to") to) - ((string= (car directive-loop) "subject") subj) + ((string= (downcase (car directive-loop)) "from") + from) + ((string= (downcase (car directive-loop)) "to") + to) + ((string= (downcase (car directive-loop)) + "subject") subj) (t (mail-fetch-field (car directive-loop)))))) + ;; FIXME - shouldn't this ignore case? (and f (string-match (car (cdr directive-loop)) f)))) (setq directive-loop (cdr (cdr directive-loop)))) ;; If there are no directives left, then it was a complete match. @@ -3779,6 +3800,8 @@ which is an element of rmail-msgref-vector." With prefix argument, \"resend\" the message instead of forwarding it; see the documentation of `rmail-resend'." (interactive "P") + (if (zerop rmail-current-message) + (error "No message to forward")) (if resend (call-interactively 'rmail-resend) (let ((forward-buffer rmail-buffer) @@ -4461,7 +4484,7 @@ Edit the contents of this message. ;;;### (autoloads (rmail-next-labeled-message rmail-previous-labeled-message ;;;;;; rmail-read-label rmail-kill-label rmail-add-label) "rmailkwd" -;;;;;; "rmailkwd.el" "08c288c88cfe7be50830122c064e3884") +;;;;;; "rmailkwd.el" "ec13237a2b0a9e9c1893e38d36b11134") ;;; Generated autoloads from rmailkwd.el (autoload 'rmail-add-label "rmailkwd" "\ @@ -4504,7 +4527,7 @@ With prefix argument N moves forward N messages with these labels. ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "5ecb69456c4d86a4e905eb3008602a95") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "2cb1f29b88b0c724fdba389fd7b98b00") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el index 73542578bf6..472740aefd8 100644 --- a/lisp/mail/rmailkwd.el +++ b/lisp/mail/rmailkwd.el @@ -96,7 +96,8 @@ LABEL may be a symbol or string." (error "More than one label specified")) (with-current-buffer rmail-buffer (rmail-maybe-set-message-counters) - (or msg (setq msg rmail-current-message)) + (if (zerop (or msg (setq msg rmail-current-message))) + (error "No message")) ;; Force recalculation of summary for this message. (aset rmail-summary-vector (1- msg) nil) (let (attr-index) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index e53e0c0744e..d01cfc7f2c8 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -1269,7 +1269,8 @@ The arguments ARG and STATE have no effect in this case." (or arg (goto-char (point-min))) (point)) 'rmail-mime-entity))) (if (or (not arg) entity) (rmail-mime-toggle-raw state))) - (message "Not a MIME message"))) + (message "Not a MIME message, just toggling headers") + (rmail-toggle-header))) (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string)) (buf (get-buffer-create "*RMAIL*")) (rmail-mime-mbox-buffer rmail-view-buffer) diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index c168ca9d8f5..ad76a493483 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -468,6 +468,8 @@ from a non-Rmail buffer. In this case, COUNT is ignored." (if rmail-buffer (set-buffer rmail-buffer) (error "There is no Rmail buffer")) + (if (zerop rmail-total-messages) + (error "No messages to output")) (let ((orig-count count) beg end) (while (> count 0) @@ -533,6 +535,8 @@ so you should call `rmail-output' directly in that case." (if rmail-buffer (set-buffer rmail-buffer) (error "There is no Rmail buffer")) + (if (zerop rmail-total-messages) + (error "No messages to output")) (let ((orig-count count) (cur (current-buffer))) (while (> count 0) @@ -594,6 +598,8 @@ than appending to it. Deletes the message after writing if (expand-file-name file-name (and rmail-default-body-file (file-name-directory rmail-default-body-file)))) + (if (zerop rmail-current-message) + (error "No message to output")) (save-excursion (goto-char (point-min)) (search-forward "\n\n") diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index 9ed2e90b456..652693209e8 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -231,10 +231,9 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (while (search-forward "\nFrom " nil t) (forward-char -5) (insert ?>))) - ;; Make sure the message ends with two newlines (goto-char (point-max)) - (unless (looking-back "\n\n") - (insert "\n")) + ;; Add terminator blank line to message. + (insert "\n") ;; Write it to the output file, suitably encoded. (let ((coding-system-for-write coding)) (write-region (point-min) (point-max) to-file t |