diff options
Diffstat (limited to 'lisp/mh-e/mh-e.el')
-rw-r--r-- | lisp/mh-e/mh-e.el | 779 |
1 files changed, 434 insertions, 345 deletions
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index e0a8c3a004f..6a50563585a 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -102,7 +102,8 @@ (defvar mh-partial-folder-mode-line-annotation "select" "Annotation when displaying part of a folder. -The string is displayed after the folder's name. nil for no annotation.") +The string is displayed after the folder's name. nil for no +annotation.") @@ -133,15 +134,16 @@ The string is displayed after the folder's name. nil for no annotation.") "%<(zero)%17(friendly{from})%> " "%{subject}%<{body}<<%{body}%>") "*Scan format string for MH. -This string is passed to the scan program via the -format argument. -This format is identical to the default except that additional hints for -fontification have been added to the fifth column (remember that in Emacs, the -first column is 0). +This string is passed to the scan program via the -format +argument. This format is identical to the default except that +additional hints for fontification have been added to the fifth +column (remember that in Emacs, the first column is 0). -The values of the fifth column, in priority order, are: `-' if the message has -been replied to, t if an address on the To: line matches one of the -mailboxes of the current user, `c' if the Cc: line matches, `b' if the Bcc: -line matches, and `n' if a non-empty Newsgroups: header is present.") +The values of the fifth column, in priority order, are: `-' if +the message has been replied to, t if an address on the To: line +matches one of the mailboxes of the current user, `c' if the Cc: +line matches, `b' if the Bcc: line matches, and `n' if a +non-empty Newsgroups: header is present.") (defvar mh-scan-format-nmh (concat @@ -159,14 +161,15 @@ line matches, and `n' if a non-empty Newsgroups: header is present.") "%(decode{subject})%<{body}<<%{body}%>") "*Scan format string for nmh. This string is passed to the scan program via the -format arg. -This format is identical to the default except that additional hints for -fontification have been added to the fifth column (remember that in Emacs, the -first column is 0). +This format is identical to the default except that additional +hints for fontification have been added to the fifth +column (remember that in Emacs, the first column is 0). -The values of the fifth column, in priority order, are: `-' if the message has -been replied to, t if an address on the To: field matches one of the -mailboxes of the current user, `c' if the Cc: field matches, `b' if the Bcc: -field matches, and `n' if a non-empty Newsgroups: field is present.") +The values of the fifth column, in priority order, are: `-' if +the message has been replied to, t if an address on the To: field +matches one of the mailboxes of the current user, `c' if the Cc: +field matches, `b' if the Bcc: field matches, and `n' if a +non-empty Newsgroups: field is present.") (defvar mh-note-deleted ?D "Messages that have been deleted are marked by this character. @@ -182,101 +185,140 @@ See also `mh-scan-cur-msg-number-regexp'.") (defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^D^0-9]" "This regular expression matches \"good\" messages. -It must match from the beginning of the line. Note that the default setting of -`mh-folder-font-lock-keywords' expects this expression to contain at least one -parenthesized expression which matches the message number as in the default of -\"^\\\\( *[0-9]+\\\\)[^D^0-9]\". This expression includes the leading space -within the parenthesis since it looks better to highlight it as well. This -regular expression should be correct as it is needed by non-fontification + +It must match from the beginning of the line. Note that the +default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which +matches the message number as in the default of + + \"^\\\\( *[0-9]+\\\\)[^D^0-9]\". + +This expression includes the leading space within the parenthesis +since it looks better to highlight it as well. This regular +expression should be correct as it is needed by non-fontification functions.") (defvar mh-scan-deleted-msg-regexp "^\\( *[0-9]+\\)D" "This regular expression matches deleted messages. -It must match from the beginning of the line. Note that the default setting of -`mh-folder-font-lock-keywords' expects this expression to contain at least one -parenthesized expression which matches the message number as in the default of -\"^\\\\( *[0-9]+\\\\)D\". This expression includes the leading space within -the parenthesis since it looks better to highlight it as well. This regular -expression should be correct as it is needed by non-fontification functions. -See also `mh-note-deleted'.") + +It must match from the beginning of the line. Note that the +default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which +matches the message number as in the default of + + \"^\\\\( *[0-9]+\\\\)D\". + +This expression includes the leading space within the parenthesis +since it looks better to highlight it as well. This regular +expression should be correct as it is needed by non-fontification +functions. See also `mh-note-deleted'.") (defvar mh-scan-refiled-msg-regexp "^\\( *[0-9]+\\)\\^" "This regular expression matches refiled messages. -It must match from the beginning of the line. Note that the default setting of -`mh-folder-font-lock-keywords' expects this expression to contain at least one -parenthesized expression which matches the message number as in the default of -\"^\\\\( *[0-9]+\\\\)\\\\^\". This expression includes the leading space -within the parenthesis since it looks better to highlight it as well. This -regular expression should be correct as it is needed by non-fontification + +It must match from the beginning of the line. Note that the +default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which +matches the message number as in the default of + + \"^\\\\( *[0-9]+\\\\)\\\\^\". + +This expression includes the leading space within the parenthesis +since it looks better to highlight it as well. This regular +expression should be correct as it is needed by non-fontification functions. See also `mh-note-refiled'.") (defvar mh-scan-valid-regexp "^ *[0-9]" "This regular expression describes a valid scan line. -This is used to eliminate error messages that are occasionally produced by -\"inc\".") + +This is used to eliminate error messages that are occasionally +produced by \"inc\".") (defvar mh-scan-cur-msg-number-regexp "^\\( *[0-9]+\\+\\).*" "This regular expression matches the current message. -It must match from the beginning of the line. Note that the default setting of -`mh-folder-font-lock-keywords' expects this expression to contain at least one -parenthesized expression which matches the message number as in the default of -\"^\\\\( *[0-9]+\\\\+\\\\).*\". This expression includes the leading space and -current message marker \"+\" within the parenthesis since it looks better to -highlight these items as well. This regular expression should be correct as it -is needed by non-fontification functions. See also `mh-note-cur'.") + +It must match from the beginning of the line. Note that the +default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which +matches the message number as in the default of + + \"^\\\\( *[0-9]+\\\\+\\\\).*\". + +This expression includes the leading space and current message +marker \"+\" within the parenthesis since it looks better to +highlight these items as well. This regular expression should be +correct as it is needed by non-fontification functions. See also +`mh-note-cur'.") (defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)" "This regular expression matches a valid date. -It must not be anchored to the beginning or the end of the line. Note that the -default setting of `mh-folder-font-lock-keywords' expects this expression to -contain only one parenthesized expression which matches the date field as in -the default of \"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular -expression is not correct, the date will not be highlighted. See also + +It must not be anchored to the beginning or the end of the line. +Note that the default setting of `mh-folder-font-lock-keywords' +expects this expression to contain only one parenthesized +expression which matches the date field as in the default of +\"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular expression +is not correct, the date will not be highlighted. See also `mh-scan-format-regexp'.") (defvar mh-scan-rcpt-regexp "\\(To:\\)\\(..............\\)" "This regular expression specifies the recipient in messages you sent. + Note that the default setting of `mh-folder-font-lock-keywords' -expects this expression to contain two parenthesized expressions. The -first is expected to match the `To:' that the default scan format -file generates. The second is expected to match the recipient's name -as in the default of \"\\\\(To:\\\\)\\\\(..............\\\\)\". If this -regular expression is not correct, the recipient will not be highlighted.") +expects this expression to contain two parenthesized expressions. +The first is expected to match the `To:' that the default scan +format file generates. The second is expected to match the +recipient's name as in the default of +\"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular +expression is not correct, the recipient will not be +highlighted.") (defvar mh-scan-body-regexp "\\(<<\\([^\n]+\\)?\\)" "This regular expression matches the message body fragment. -Note that the default setting of `mh-folder-font-lock-keywords' expects this -expression to contain at least one parenthesized expression which matches the -body text as in the default of \"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this -regular expression is not correct, the body fragment will not be highlighted.") + +Note that the default setting of `mh-folder-font-lock-keywords' +expects this expression to contain at least one parenthesized +expression which matches the body text as in the default of +\"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this regular expression is +not correct, the body fragment will not be highlighted.") (defvar mh-scan-subject-regexp "^ *[0-9]+........[ ]*...................\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)" "This regular expression matches the subject. -It must match from the beginning of the line. Note that the default setting -of `mh-folder-font-lock-keywords' expects this expression to contain at least -three parenthesized expressions. The first is expected to match the `Re:' -string, if any. The second matches an optional bracketed number after `Re:', -such as in `Re[2]:' (and is thus a sub-expression of the first expression) and -the third is expected to match the subject line itself as in the default of -\(broken on multiple lines for readability): + +It must match from the beginning of the line. Note that the +default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least three parenthesized expressions. +The first is expected to match the `Re:' string, if any. The +second matches an optional bracketed number after `Re:', such as +in `Re[2]:' (and is thus a sub-expression of the first +expression) and the third is expected to match the subject line +itself as in the default of \(broken on multiple lines for +readability): + ^ *[0-9]+........[ ]*................... \\\\([Rr][Ee]\\\\(\\\\\\=[[0-9]+\\\\]\\\\)?:\\\\s-*\\\\)* \\\\([^<\\n]*\\\\) -This regular expression should be correct as it is needed by non-fontification -functions.") + +This regular expression should be correct as it is needed by +non-fontification functions.") (defvar mh-scan-format-regexp (concat "\\([bct]\\)" mh-scan-date-regexp " *\\(..................\\)") "This regular expression matches the output of scan. -Note that the default setting of `mh-folder-font-lock-keywords' expects this -expression to contain at least three parenthesized expressions. The first -should match the fontification hint (see `mh-scan-format-nmh'), the second is -found in `mh-scan-date-regexp', and the third should match the user name as in -the default of \"(concat \"\\\\([bct]\\\\)\" mh-scan-date-regexp - \"*\\\\(..................\\\\)\")\". -If this regular expression is not correct, the notation hints and the sender -will not be highlighted.") + +Note that the default setting of `mh-folder-font-lock-keywords' +expects this expression to contain at least three parenthesized +expressions. The first should match the fontification hint (see +`mh-scan-format-nmh'), the second is found in +`mh-scan-date-regexp', and the third should match the user name +as in the default of + + \"(concat \"\\\\([bct]\\\\)\" mh-scan-date-regexp + \"*\\\\(..................\\\\)\")\". + +If this regular expression is not correct, the notation hints and +the sender will not be highlighted.") @@ -313,22 +355,27 @@ will not be highlighted.") (defvar mh-scan-cmd-note-width 1 "Number of columns consumed by the cmd-note field in `mh-scan-format'. -This column will have one of the values: ` ', `D', `^', `+' and where -` ' is the default value, -`D' is the `mh-note-deleted' character, -`^' is the `mh-note-refiled' character, and -`+' is the `mh-note-cur' character.") + +This column will have one of the values: ` ', `D', `^', `+' and +where ` ' is the default value, + + `D' is the `mh-note-deleted' character, + `^' is the `mh-note-refiled' character, and + `+' is the `mh-note-cur' character.") (defvar mh-scan-destination-width 1 "Number of columns consumed by the destination field in `mh-scan-format'. -This column will have one of ' ', '%', '-', 't', 'c', 'b', or `n' in it. -A ' ' blank space is the default character. -A '%' indicates that the message in in a named MH sequence. -A '-' indicates that the message has been annotated with a replied field. -A 't' indicates that the message contains mymbox in the To: field. -A 'c' indicates that the message contains mymbox in the Cc: field. -A 'b' indicates that the message contains mymbox in the Bcc: field. -A 'n' indicates that the message contains a Newsgroups: field.") + +This column will have one of ' ', '%', '-', 't', 'c', 'b', or `n' +in it. + + ' ' blank space is the default character. + '%' indicates that the message in in a named MH sequence. + '-' indicates that the message has been annotated with a replied field. + 't' indicates that the message contains mymbox in the To: field. + 'c' indicates that the message contains mymbox in the Cc: field. + 'b' indicates that the message contains mymbox in the Bcc: field. + 'n' indicates that the message contains a Newsgroups: field.") (defvar mh-scan-date-width 5 "Number of columns consumed by the date field in `mh-scan-format'. @@ -336,7 +383,8 @@ This column will typically be of the form mm/dd.") (defvar mh-scan-date-flag-width 1 "Number of columns consumed to flag (in)valid dates in `mh-scan-format'. -This column will have ` ' for valid and `*' for invalid or missing dates.") +This column will have ` ' for valid and `*' for invalid or +missing dates.") (defvar mh-scan-from-mbox-width 17 "Number of columns consumed with the \"From:\" line in `mh-scan-format'. @@ -388,17 +436,17 @@ This column will only ever have spaces in it.") (defmacro mh-generate-sequence-font-lock (seq prefix face) "Generate the appropriate code to fontify messages in SEQ. -PREFIX is used to generate unique names for the variables and functions -defined by the macro. So a different prefix should be provided for every -invocation. +PREFIX is used to generate unique names for the variables and +functions defined by the macro. So a different prefix should be +provided for every invocation. FACE is the font-lock face used to display the matching scan lines." (let ((cache (intern (format "mh-folder-%s-seq-cache" prefix))) (func (intern (format "mh-folder-font-lock-%s" prefix)))) `(progn (defvar ,cache nil "Internal cache variable used for font-lock in MH-E. -Should only be non-nil through font-lock stepping, and nil once font-lock -is done highlighting.") +Should only be non-nil through font-lock stepping, and nil once +font-lock is done highlighting.") (make-variable-buffer-local ',cache) (defun ,func (limit) @@ -463,16 +511,19 @@ is done highlighting.") (defvar mh-delete-list nil "List of message numbers to delete. -This variable can be used by `mh-before-commands-processed-hook'.") +This variable can be used by +`mh-before-commands-processed-hook'.") (defvar mh-refile-list nil "List of folder names in `mh-seq-list'. -This variable can be used by `mh-before-commands-processed-hook'.") +This variable can be used by +`mh-before-commands-processed-hook'.") (defvar mh-folders-changed nil "Lists which folders were affected by deletes and refiles. -This list will always include the current folder `mh-current-folder'. -This variable can be used by `mh-before-commands-processed-hook'.") +This list will always include the current folder +`mh-current-folder'. This variable can be used by +`mh-before-commands-processed-hook'.") (defvar mh-next-direction 'forward "Direction to move to next message.") @@ -534,9 +585,11 @@ These operations include narrowing or threading.") ;;;###autoload (defun mh-rmail (&optional arg) - "Inc(orporate) new mail with MH. -Scan an MH folder if ARG is non-nil. This function is an entry point to MH-E, -the Emacs interface to the MH mail system." + "Incorporate new mail with MH. +Scan an MH folder if ARG is non-nil. + +This function is an entry point to MH-E, the Emacs interface to +the MH mail system." (interactive "P") (mh-find-path) (if arg @@ -548,8 +601,10 @@ the Emacs interface to the MH mail system." ;;;###autoload (defun mh-nmail (&optional arg) "Check for new mail in inbox folder. -Scan an MH folder if ARG is non-nil. This function is an entry point to MH-E, -the Emacs interface to the MH mail system." +Scan an MH folder if ARG is non-nil. + +This function is an entry point to MH-E, the Emacs interface to +the MH mail system." (interactive "P") (mh-find-path) ; init mh-inbox (if arg @@ -563,20 +618,21 @@ the Emacs interface to the MH mail system." (defun mh-delete-msg (range) "Delete RANGE\\<mh-folder-mode-map>. -To mark a message for deletion, use this command. A \"D\" is placed by the -message in the scan window, and the next undeleted message is displayed. If -the previous command had been \\[mh-previous-undeleted-msg], then the next -message displayed is the first undeleted message previous to the message just -deleted. Use \\[mh-next-undeleted-msg] to force subsequent \\[mh-delete-msg] -commands to move forward to the next undeleted message after deleting the -message under the cursor. - -The hook `mh-delete-msg-hook' is called after you mark a message for deletion. -For example, a past maintainer of MH-E used this once when he kept statistics -on his mail usage. - -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use." +To mark a message for deletion, use this command. A \"D\" is +placed by the message in the scan window, and the next undeleted +message is displayed. If the previous command had been +\\[mh-previous-undeleted-msg], then the next message displayed is +the first undeleted message previous to the message just deleted. +Use \\[mh-next-undeleted-msg] to force subsequent +\\[mh-delete-msg] commands to move forward to the next undeleted +message after deleting the message under the cursor. + +The hook `mh-delete-msg-hook' is called after you mark a message +for deletion. For example, a past maintainer of MH-E used this +once when he kept statistics on his mail usage. + +Check the documentation of `mh-interactive-range' to see how +RANGE is read in interactive use." (interactive (list (mh-interactive-range "Delete"))) (mh-delete-msg-no-motion range) (if (looking-at mh-scan-deleted-msg-regexp) @@ -585,11 +641,12 @@ interactive use." (defun mh-delete-msg-no-motion (range) "Delete RANGE, don't move to next message. -This command marks the RANGE for deletion but leaves the cursor at the current -message in case you wish to perform other operations on the message. +This command marks the RANGE for deletion but leaves the cursor +at the current message in case you wish to perform other +operations on the message. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use." +Check the documentation of `mh-interactive-range' to see how +RANGE is read in interactive use." (interactive (list (mh-interactive-range "Delete"))) (mh-iterate-on-range () range (mh-delete-a-msg nil))) @@ -597,16 +654,17 @@ interactive use." (defun mh-execute-commands () "Process outstanding delete and refile requests\\<mh-folder-mode-map>. -If you've marked messages to be deleted or refiled and you want to go ahead -and delete or refile the messages, use this command. Many MH-E commands that -may affect the numbering of the messages (such as \\[mh-rescan-folder] or -\\[mh-pack-folder]) will ask if you want to process refiles or deletes first -and then either run this command for you or undo the pending refiles and +If you've marked messages to be deleted or refiled and you want +to go ahead and delete or refile the messages, use this command. +Many MH-E commands that may affect the numbering of the +messages (such as \\[mh-rescan-folder] or \\[mh-pack-folder]) +will ask if you want to process refiles or deletes first and then +either run this command for you or undo the pending refiles and deletes, which are lost. -This function runs `mh-before-commands-processed-hook' before the commands are -processed and `mh-after-commands-processed-hook' after the commands are -processed." +This function runs `mh-before-commands-processed-hook' before the +commands are processed and `mh-after-commands-processed-hook' +after the commands are processed." (interactive) (if mh-folder-view-stack (mh-widen t)) (mh-process-commands mh-current-folder) @@ -643,15 +701,17 @@ Use the command \\[mh-show] to show the message normally again." "Incorporate new mail into a folder. You can incorporate mail from any file into the current folder by -specifying a prefix argument; you'll be prompted for the name of the -file to use as well as the destination folder +specifying a prefix argument; you'll be prompted for the name of +the file to use as well as the destination folder -The hook `mh-inc-folder-hook' is run after incorporating new mail. Do -not call this function from outside MH-E; use \\[mh-rmail] instead. +The hook `mh-inc-folder-hook' is run after incorporating new +mail. Do not call this function from outside MH-E; use +\\[mh-rmail] instead. -In a program optional argument MAILDROP-NAME specifies an alternate -maildrop from the default. The optional argument FOLDER specifies -where to incorporate mail instead of the default named by `mh-inbox'." +In a program optional argument MAILDROP-NAME specifies an +alternate maildrop from the default. The optional argument FOLDER +specifies where to incorporate mail instead of the default named +by `mh-inbox'." (interactive (list (if current-prefix-arg (expand-file-name (read-file-name "inc mail from file: " @@ -695,12 +755,12 @@ where to incorporate mail instead of the default named by `mh-inbox'." (defun mh-next-undeleted-msg (&optional count wait-after-complaining-flag) "Display next message. -This command can be given a prefix argument COUNT to specify how many unread -messages to skip. +This command can be given a prefix argument COUNT to specify how +many unread messages to skip. -In a program, pause for a second after printing message if we are at the last -undeleted message and optional argument WAIT-AFTER-COMPLAINING-FLAG is -non-nil." +In a program, pause for a second after printing message if we are +at the last undeleted message and optional argument +WAIT-AFTER-COMPLAINING-FLAG is non-nil." (interactive "p") (setq mh-next-direction 'forward) (forward-line 1) @@ -716,18 +776,19 @@ non-nil." The name of the folder is derived as follows: - a) The folder name associated with the first address found in the list - `mh-default-folder-list' is used. Each element in this list contains a - `Check Recipient' item. If this item is turned on, then the address is - checked against the recipient instead of the sender. This is useful for - mailing lists. + a) The folder name associated with the first address found in + the list `mh-default-folder-list' is used. Each element in + this list contains a `Check Recipient' item. If this item is + turned on, then the address is checked against the recipient + instead of the sender. This is useful for mailing lists. - b) An alias prefixed by `mh-default-folder-prefix' corresponding to the - address is used. The prefix is used to prevent clutter in your mail - directory. + b) An alias prefixed by `mh-default-folder-prefix' + corresponding to the address is used. The prefix is used to + prevent clutter in your mail directory. Return nil if a folder name was not derived, or if the variable -`mh-default-folder-must-exist-flag' is t and the folder does not exist." +`mh-default-folder-must-exist-flag' is t and the folder does not +exist." ;; Loop for all entries in mh-default-folder-list (save-restriction (goto-char (point-min)) @@ -792,15 +853,15 @@ The default folder name is generated by the option (defun mh-refile-msg (range folder &optional dont-update-last-destination-flag) "Refile (output) RANGE into FOLDER. -You are prompted for the folder name. Note that this command can also be used -to create folders. If you specify a folder that does not exist, you will be -prompted to create it. +You are prompted for the folder name. Note that this command can also +be used to create folders. If you specify a folder that does not +exist, you will be prompted to create it. -The hook `mh-refile-msg-hook' is called after a message is marked to be -refiled. +The hook `mh-refile-msg-hook' is called after a message is marked to +be refiled. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +Check the documentation of `mh-interactive-range' to see how RANGE is +read in interactive use. In a program, the variables `mh-last-destination' and `mh-last-destination-folder' are not updated if @@ -817,14 +878,14 @@ DONT-UPDATE-LAST-DESTINATION-FLAG is non-nil." (defun mh-refile-or-write-again (range &optional interactive-flag) "Repeat last output command. -If you are refiling several messages into the same folder, you can use this -command to repeat the last refile or write. You can use a range. +If you are refiling several messages into the same folder, you can use +this command to repeat the last refile or write. You can use a range. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +Check the documentation of `mh-interactive-range' to see how RANGE is +read in interactive use. -In a program, a non-nil INTERACTIVE-FLAG means that the function was called -interactively." +In a program, a non-nil INTERACTIVE-FLAG means that the function was +called interactively." (interactive (list (mh-interactive-range "Redo") t)) (if (null mh-last-destination) (error "No previous refile or write")) @@ -840,18 +901,20 @@ interactively." (defun mh-quit () "Quit the current MH-E folder. -When you want to quit using MH-E and go back to editing, you can use this -command. This buries the buffers of the current MH-E folder and restores the -buffers that were present when you first ran \\[mh-rmail]. It also removes any -MH-E working buffers whose name begins with \" *mh-\" or \"*MH-E \". You can -later restore your MH-E session by selecting the \"+inbox\" buffer or by -running \\[mh-rmail] again. - -The two hooks `mh-before-quit-hook' and `mh-quit-hook' are called by this -function. The former one is called before the quit occurs, so you might use it -to perform any MH-E operations; you could perform some query and abort the -quit or call `mh-execute-commands', for example. The latter is not run in an -MH-E context, so you might use it to modify the window setup." +When you want to quit using MH-E and go back to editing, you can use +this command. This buries the buffers of the current MH-E folder and +restores the buffers that were present when you first ran +\\[mh-rmail]. It also removes any MH-E working buffers whose name +begins with \" *mh-\" or \"*MH-E \". You can later restore your MH-E +session by selecting the \"+inbox\" buffer or by running \\[mh-rmail] +again. + +The two hooks `mh-before-quit-hook' and `mh-quit-hook' are called by +this function. The former one is called before the quit occurs, so you +might use it to perform any MH-E operations; you could perform some +query and abort the quit or call `mh-execute-commands', for example. +The latter is not run in an MH-E context, so you might use it to +modify the window setup." (interactive) (run-hooks 'mh-before-quit-hook) (let ((show-buffer (get-buffer mh-show-buffer))) @@ -874,9 +937,9 @@ MH-E context, so you might use it to modify the window setup." (defun mh-page-msg (&optional lines) "Display next page in message. -You can give this command a prefix argument that specifies the number of LINES -to scroll. This command will also show the next undeleted message if it is -used at the bottom of a message." +You can give this command a prefix argument that specifies the +number of LINES to scroll. This command will also show the next +undeleted message if it is used at the bottom of a message." (interactive "P") (if mh-showing-mode (if mh-page-to-next-msg-flag @@ -899,8 +962,8 @@ used at the bottom of a message." (defun mh-previous-page (&optional lines) "Display next page in message. -You can give this command a prefix argument that specifies the number of LINES -to scroll." +You can give this command a prefix argument that specifies the +number of LINES to scroll." (interactive "P") (mh-in-show-buffer (mh-show-buffer) (scroll-down lines))) @@ -908,12 +971,12 @@ to scroll." (defun mh-previous-undeleted-msg (&optional count wait-after-complaining-flag) "Display previous message. -This command can be given a prefix argument COUNT to specify how many unread -messages to skip. +This command can be given a prefix argument COUNT to specify how +many unread messages to skip. -In a program, pause for a second after printing message if we are at the last -undeleted message and optional argument WAIT-AFTER-COMPLAINING-FLAG is -non-nil." +In a program, pause for a second after printing message if we are +at the last undeleted message and optional argument +WAIT-AFTER-COMPLAINING-FLAG is non-nil." (interactive "p") (setq mh-next-direction 'backward) (beginning-of-line) @@ -925,8 +988,8 @@ non-nil." (defun mh-previous-unread-msg (&optional count) "Display previous unread message. -This command can be given a prefix argument COUNT to specify how many unread -messages to skip." +This command can be given a prefix argument COUNT to specify how +many unread messages to skip." (interactive "p") (unless (> count 0) (error "The function mh-previous-unread-msg expects positive argument")) @@ -958,9 +1021,11 @@ messages to skip." (defun mh-goto-next-button (backward-flag &optional criterion) "Search for next button satisfying criterion. -If BACKWARD-FLAG is non-nil search backward in the buffer for a mime button. If -CRITERION is a function or a symbol which has a function binding then that -function must return non-nil at the button we stop." + +If BACKWARD-FLAG is non-nil search backward in the buffer for a mime +button. +If CRITERION is a function or a symbol which has a function binding +then that function must return non-nil at the button we stop." (unless (or (and (symbolp criterion) (fboundp criterion)) (functionp criterion)) (setq criterion (lambda (x) t))) @@ -1003,11 +1068,11 @@ function must return non-nil at the button we stop." (defun mh-next-button (&optional backward-flag) "Go to the next button. -If the end of the buffer is reached then the search wraps over to the start of -the buffer. +If the end of the buffer is reached then the search wraps over to +the start of the buffer. -If an optional prefix argument BACKWARD-FLAG is given, the cursor will move to -the previous button." +If an optional prefix argument BACKWARD-FLAG is given, the cursor +will move to the previous button." (interactive (list current-prefix-arg)) (unless mh-showing-mode (mh-show)) @@ -1017,17 +1082,18 @@ the previous button." (defun mh-prev-button () "Go to the previous button. -If the beginning of the buffer is reached then the search wraps over to the -end of the buffer." +If the beginning of the buffer is reached then the search wraps +over to the end of the buffer." (interactive) (mh-next-button t)) (defun mh-folder-mime-action (part-index action include-security-flag) "Go to PART-INDEX and carry out ACTION. -If PART-INDEX is nil then go to the next part in the buffer. The search for -the next buffer wraps around if end of buffer is reached. If argument -INCLUDE-SECURITY-FLAG is non-nil then include security info buttons when -searching for a suitable parts." + +If PART-INDEX is nil then go to the next part in the buffer. The +search for the next buffer wraps around if end of buffer is reached. +If argument INCLUDE-SECURITY-FLAG is non-nil then include security +info buttons when searching for a suitable parts." (unless mh-showing-mode (mh-show)) (mh-in-show-buffer (mh-show-buffer) @@ -1058,15 +1124,17 @@ searching for a suitable parts." (defun mh-folder-toggle-mime-part (part-index) "View attachment. -This command displays (or hides) the attachment associated with the button -under the cursor. If the cursor is not located over a button, then the cursor -first moves to the next button, wrapping to the beginning of the message if -necessary. This command has the advantage over related commands of working -from the MH-Folder buffer. - -You can also provide a numeric prefix argument PART-INDEX to view the -attachment labeled with that number. If Emacs does not know how to display the -attachment, then Emacs offers to save the attachment in a file." +This command displays (or hides) the attachment associated with +the button under the cursor. If the cursor is not located over a +button, then the cursor first moves to the next button, wrapping +to the beginning of the message if necessary. This command has +the advantage over related commands of working from the MH-Folder +buffer. + +You can also provide a numeric prefix argument PART-INDEX to view +the attachment labeled with that number. If Emacs does not know +how to display the attachment, then Emacs offers to save the +attachment in a file." (interactive "P") (when (consp part-index) (setq part-index (car part-index))) (mh-folder-mime-action part-index #'mh-press-button t)) @@ -1074,14 +1142,15 @@ attachment, then Emacs offers to save the attachment in a file." (defun mh-folder-inline-mime-part (part-index) "Show attachment verbatim. -You can view the raw contents of an attachment with this command. This command -displays (or hides) the contents of the attachment associated with the button -under the cursor verbatim. If the cursor is not located over a button, then -the cursor first moves to the next button, wrapping to the beginning of the -message if necessary. +You can view the raw contents of an attachment with this command. +This command displays (or hides) the contents of the attachment +associated with the button under the cursor verbatim. If the +cursor is not located over a button, then the cursor first moves +to the next button, wrapping to the beginning of the message if +necessary. -You can also provide a numeric prefix argument PART-INDEX to view the -attachment labeled with that number." +You can also provide a numeric prefix argument PART-INDEX to view +the attachment labeled with that number." (interactive "P") (when (consp part-index) (setq part-index (car part-index))) (mh-folder-mime-action part-index #'mh-mime-inline-part nil)) @@ -1089,15 +1158,16 @@ attachment labeled with that number." (defun mh-folder-save-mime-part (part-index) "Save (output) attachment. -This command saves the attachment associated with the button under the cursor. -If the cursor is not located over a button, then the cursor first moves to the -next button, wrapping to the beginning of the message if necessary. +This command saves the attachment associated with the button under the +cursor. If the cursor is not located over a button, then the cursor +first moves to the next button, wrapping to the beginning of the +message if necessary. You can also provide a numeric prefix argument PART-INDEX to save the attachment labeled with that number. -This command prompts you for a filename and suggests a specific name if it is -available." +This command prompts you for a filename and suggests a specific name +if it is available." (interactive "P") (when (consp part-index) (setq part-index (car part-index))) (mh-folder-mime-action part-index #'mh-mime-save-part nil)) @@ -1116,16 +1186,17 @@ Also removes all content from the folder buffer." "Rescan folder\\<mh-folder-mode-map>. This command is useful to grab all messages in your \"+inbox\" after -processing your new mail for the first time. If you don't want to rescan the -entire folder, this command will accept a RANGE. Check the documentation of -`mh-interactive-range' to see how RANGE is read in interactive use. +processing your new mail for the first time. If you don't want to +rescan the entire folder, this command will accept a RANGE. Check the +documentation of `mh-interactive-range' to see how RANGE is read in +interactive use. -This command will ask if you want to process refiles or deletes first and then -either run \\[mh-execute-commands] for you or undo the pending refiles and -deletes, which are lost. +This command will ask if you want to process refiles or deletes first +and then either run \\[mh-execute-commands] for you or undo the +pending refiles and deletes, which are lost. -In a program, the processing of outstanding commands is not performed if -DONT-EXEC-PENDING is non-nil." +In a program, the processing of outstanding commands is not performed +if DONT-EXEC-PENDING is non-nil." (interactive (list (if current-prefix-arg (mh-read-range "Rescan" mh-current-folder t nil t mh-interpret-number-as-range-flag) @@ -1139,10 +1210,11 @@ DONT-EXEC-PENDING is non-nil." (defun mh-write-msg-to-file (message file no-header) "Append MESSAGE to end of FILE\\<mh-folder-mode-map>. -You are prompted for the filename. If the file already exists, the message is -appended to it. You can also write the message to the file without the header -by specifying a prefix argument NO-HEADER. Subsequent writes to the same file -can be made with the command \\[mh-refile-or-write-again]." +You are prompted for the filename. If the file already exists, +the message is appended to it. You can also write the message to +the file without the header by specifying a prefix argument +NO-HEADER. Subsequent writes to the same file can be made with +the command \\[mh-refile-or-write-again]." (interactive (list (mh-get-msg-num t) (let ((default-dir (if (eq 'write (car mh-last-destination-write)) @@ -1178,13 +1250,14 @@ can be made with the command \\[mh-refile-or-write-again]." (defun mh-undo (range) "Undo pending deletes or refiles in RANGE. -If you've deleted a message or refiled it, but changed your mind, you can -cancel the action before you've executed it. Use this command to undo a refile -on or deletion of a single message. You can also undo refiles and deletes for -messages that are found in a given RANGE. +If you've deleted a message or refiled it, but changed your mind, +you can cancel the action before you've executed it. Use this +command to undo a refile on or deletion of a single message. You +can also undo refiles and deletes for messages that are found in +a given RANGE. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use." +Check the documentation of `mh-interactive-range' to see how +RANGE is read in interactive use." (interactive (list (mh-interactive-range "Undo"))) (cond ((numberp range) (let ((original-position (point))) @@ -1210,8 +1283,8 @@ interactive use." (defun mh-folder-line-matches-show-buffer-p () "Return t if the message under point in folder-mode is in the show buffer. -Return nil in any other circumstance (no message under point, no show buffer, -the message in the show buffer doesn't match." +Return nil in any other circumstance (no message under point, no +show buffer, the message in the show buffer doesn't match." (and (eq major-mode 'mh-folder-mode) (mh-get-msg-num nil) mh-show-buffer @@ -1227,9 +1300,9 @@ the message in the show buffer doesn't match." (defmacro mh-macro-expansion-time-gnus-version () "Return Gnus version available at macro expansion time. -The macro evaluates the Gnus version at macro expansion time. If MH-E was -compiled then macro expansion happens at compile time." - gnus-version) +The macro evaluates the Gnus version at macro expansion time. If +MH-E was compiled then macro expansion happens at compile time." +gnus-version) (defun mh-run-time-gnus-version () "Return Gnus version available at run time." @@ -1271,9 +1344,9 @@ compiled then macro expansion happens at compile time." (defun mh-parse-flist-output-line (line &optional current-folder) "Parse LINE to generate folder name, unseen messages and total messages. -If CURRENT-FOLDER is non-nil then it contains the current folder name and it is -used to avoid problems in corner cases involving folders whose names end with a -'+' character." +If CURRENT-FOLDER is non-nil then it contains the current folder +name and it is used to avoid problems in corner cases involving +folders whose names end with a '+' character." (with-temp-buffer (insert line) (goto-char (point-max)) @@ -1328,27 +1401,31 @@ used to avoid problems in corner cases involving folders whose names end with a (defun mh-visit-folder (folder &optional range index-data) "Visit FOLDER. -When you want to read the messages that you have refiled into folders, use -this command to visit the folder. You are prompted for the folder name. +When you want to read the messages that you have refiled into folders, +use this command to visit the folder. You are prompted for the folder +name. -The folder buffer will show just unseen messages if there are any; otherwise, -it will show all the messages in the buffer as long there are fewer than -`mh-large-folder' messages. If there are more, then you are prompted for a -range of messages to scan. +The folder buffer will show just unseen messages if there are any; +otherwise, it will show all the messages in the buffer as long there +are fewer than `mh-large-folder' messages. If there are more, then you +are prompted for a range of messages to scan. -You can provide a prefix argument in order to specify a RANGE of messages to -show when you visit the folder. In this case, regions are not used to specify -the range and `mh-large-folder' is ignored. Check the documentation of -`mh-interactive-range' to see how RANGE is read in interactive use. +You can provide a prefix argument in order to specify a RANGE of +messages to show when you visit the folder. In this case, regions are +not used to specify the range and `mh-large-folder' is ignored. Check +the documentation of `mh-interactive-range' to see how RANGE is read +in interactive use. -Note that this command can also be used to create folders. If you specify a -folder that does not exist, you will be prompted to create it. +Note that this command can also be used to create folders. If you +specify a folder that does not exist, you will be prompted to create +it. Do not call this function from outside MH-E; use \\[mh-rmail] instead. -If, in a program, RANGE is nil (the default), then all messages in FOLDER are -displayed. If an index buffer is being created then INDEX-DATA is used to -initialize the index buffer specific data structures." +If, in a program, RANGE is nil (the default), then all messages in +FOLDER are displayed. If an index buffer is being created then +INDEX-DATA is used to initialize the index buffer specific data +structures." (interactive (let ((folder-name (mh-prompt-for-folder "Visit" mh-inbox t))) (list folder-name (mh-read-range "Scan" folder-name t nil @@ -1387,10 +1464,11 @@ initialize the index buffer specific data structures." (defun mh-update-sequences () "Flush MH-E's state out to MH. -This function updates the sequence specified by your \"Unseen-Sequence:\" -profile component, \"cur\", and the sequence listed by the `mh-tick-seq' -option which is \"tick\" by default. The message at the cursor is used for -\"cur\"." + +This function updates the sequence specified by your +\"Unseen-Sequence:\" profile component, \"cur\", and the sequence +listed by the `mh-tick-seq' option which is \"tick\" by default. +The message at the cursor is used for \"cur\"." (interactive) ;; mh-update-sequences is the opposite of mh-read-folder-sequences, ;; which updates MH-E's state from MH. @@ -1420,10 +1498,9 @@ option which is \"tick\" by default. The message at the cursor is used for (defun mh-delete-a-msg (message) "Delete MESSAGE. If MESSAGE is nil then the message at point is deleted. - -The hook `mh-delete-msg-hook' is called after you mark a message for deletion. -For example, a past maintainer of MH-E used this once when he kept statistics -on his mail usage." +The hook `mh-delete-msg-hook' is called after you mark a message +for deletion. For example, a past maintainer of MH-E used this +once when he kept statistics on his mail usage." (save-excursion (if (numberp message) (mh-goto-msg message nil t) @@ -1441,10 +1518,9 @@ on his mail usage." (defun mh-refile-a-msg (message folder) "Refile MESSAGE in FOLDER. If MESSAGE is nil then the message at point is refiled. - Folder is a symbol, not a string. -The hook `mh-refile-msg-hook' is called after a message is marked to be -refiled." +The hook `mh-refile-msg-hook' is called after a message is marked to +be refiled." (save-excursion (if (numberp message) (mh-goto-msg message nil t) @@ -1471,9 +1547,9 @@ refiled." (defun mh-next-msg (&optional wait-after-complaining-flag) "Move backward or forward to the next undeleted message in the buffer. -If optional argument WAIT-AFTER-COMPLAINING-FLAG is non-nil and we are at the -last message, then wait for a second after telling the user that there aren't -any more unread messages." +If optional argument WAIT-AFTER-COMPLAINING-FLAG is non-nil and +we are at the last message, then wait for a second after telling +the user that there aren't any more unread messages." (if (eq mh-next-direction 'forward) (mh-next-undeleted-msg 1 wait-after-complaining-flag) (mh-previous-undeleted-msg 1 wait-after-complaining-flag))) @@ -1481,8 +1557,8 @@ any more unread messages." (defun mh-next-unread-msg (&optional count) "Display next unread message. -This command can be given a prefix argument COUNT to specify how many unread -messages to skip." +This command can be given a prefix argument COUNT to specify how +many unread messages to skip." (interactive "p") (unless (> count 0) (error "The function mh-next-unread-msg expects positive argument")) @@ -1659,9 +1735,9 @@ Make it the current folder." (defmacro mh-write-file-functions-compat () "Return `write-file-functions' if it exists. -Otherwise return `local-write-file-hooks'. This macro exists purely for -compatibility. The former symbol is used in Emacs 21.4 onward while the latter -is used in previous versions and XEmacs." +Otherwise return `local-write-file-hooks'. This macro exists +purely for compatibility. The former symbol is used in Emacs 21.4 +onward while the latter is used in previous versions and XEmacs." (if (boundp 'write-file-functions) ''write-file-functions ;Emacs 21.4 ''local-write-file-hooks)) ;<Emacs 21.4, XEmacs @@ -1685,36 +1761,40 @@ is used in previous versions and XEmacs." (define-derived-mode mh-folder-mode fundamental-mode "MH-Folder" "Major MH-E mode for \"editing\" an MH folder scan listing.\\<mh-folder-mode-map> -You can show the message the cursor is pointing to, and step through the -messages. Messages can be marked for deletion or refiling into another -folder; these commands are executed all at once with a separate command. +You can show the message the cursor is pointing to, and step through +the messages. Messages can be marked for deletion or refiling into +another folder; these commands are executed all at once with a +separate command. -Options that control this mode can be changed with \\[customize-group]; -specify the \"mh\" group. In particular, please see the `mh-scan-format-file' -option if you wish to modify scan's format. +Options that control this mode can be changed with +\\[customize-group]; specify the \"mh\" group. In particular, please +see the `mh-scan-format-file' option if you wish to modify scan's +format. When a folder is visited, the hook `mh-folder-mode-hook' is run. Ranges ====== -Many commands that operate on individual messages, such as `mh-forward' or -`mh-refile-msg' take a RANGE argument. This argument can be used in several -ways. +Many commands that operate on individual messages, such as +`mh-forward' or `mh-refile-msg' take a RANGE argument. This argument +can be used in several ways. -If you provide the prefix argument (\\[universal-argument]) to these commands, -then you will be prompted for the message range. This can be any valid MH -range which can include messages, sequences, and the abbreviations (described -in the mh(1) man page): +If you provide the prefix argument (\\[universal-argument]) to +these commands, then you will be prompted for the message range. +This can be any valid MH range which can include messages, +sequences, and the abbreviations (described in the mh(1) man +page): <num1>-<num2> - Indicates all messages in the range <num1> to <num2>, inclusive. The range - must be nonempty. + Indicates all messages in the range <num1> to <num2>, inclusive. + The range must be nonempty. `<num>:N' `<num>:+N' `<num>:-N' - Up to N messages beginning with (or ending with) message num. Num may be - any of the predefined symbols: first, prev, cur, next or last. + Up to N messages beginning with (or ending with) message num. Num + may be any of the predefined symbols: first, prev, cur, next or + last. `first:N' `prev:N' @@ -1725,12 +1805,12 @@ in the mh(1) man page): `all' All of the messages. -For example, a range that shows all of these things is `1 2 3 5-10 last:5 -unseen'. +For example, a range that shows all of these things is `1 2 3 +5-10 last:5 unseen'. -If the option `transient-mark-mode' is set to t and you set a region in the -MH-Folder buffer, then the MH-E command will perform the operation on all -messages in that region. +If the option `transient-mark-mode' is set to t and you set a +region in the MH-Folder buffer, then the MH-E command will +perform the operation on all messages in that region. \\{mh-folder-mode-map}" (mh-do-in-gnu-emacs @@ -1835,10 +1915,10 @@ messages in that region. desktop-buffer-name desktop-buffer-misc) "Restore an MH folder buffer specified in a desktop file. -When desktop creates a buffer, DESKTOP-BUFFER-FILE-NAME holds the file name to -visit, DESKTOP-BUFFER-NAME holds the desired buffer name, and -DESKTOP-BUFFER-MISC holds a list of miscellaneous info used by the -`desktop-buffer-handlers' functions." +When desktop creates a buffer, DESKTOP-BUFFER-FILE-NAME holds the +file name to visit, DESKTOP-BUFFER-NAME holds the desired buffer +name, and DESKTOP-BUFFER-MISC holds a list of miscellaneous info +used by the `desktop-buffer-handlers' functions." (mh-find-path) (mh-visit-folder desktop-buffer-name) (current-buffer)) @@ -1851,13 +1931,14 @@ DESKTOP-BUFFER-MISC holds a list of miscellaneous info used by the (defun mh-scan-folder (folder range &optional dont-exec-pending) "Scan FOLDER over RANGE. -After the scan is performed, switch to the buffer associated with FOLDER. +After the scan is performed, switch to the buffer associated with +FOLDER. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +Check the documentation of `mh-interactive-range' to see how RANGE is +read in interactive use. -The processing of outstanding commands is not performed if DONT-EXEC-PENDING -is non-nil." +The processing of outstanding commands is not performed if +DONT-EXEC-PENDING is non-nil." (when (stringp range) (setq range (delete "" (split-string range "[ \t\n]")))) (cond ((null (get-buffer folder)) @@ -1880,11 +1961,12 @@ is non-nil." "Return the column for notations given message number WIDTH. Note that columns in Emacs start with 0. -If `mh-scan-format-file' is set to \"Use MH-E scan Format\" this means that -either `mh-scan-format-mh' or `mh-scan-format-nmh' are in use. This function -therefore assumes that the first column is empty (to provide room for the -cursor), the following WIDTH columns contain the message number, and the -column for notations comes after that." +If `mh-scan-format-file' is set to \"Use MH-E scan Format\" this +means that either `mh-scan-format-mh' or `mh-scan-format-nmh' are +in use. This function therefore assumes that the first column is +empty (to provide room for the cursor), the following WIDTH +columns contain the message number, and the column for notations +comes after that." (if (eq mh-scan-format-file t) (max (1+ width) 2) (error "%s %s" "Can't call mh-msg-num-width-to-column" @@ -1943,9 +2025,9 @@ If UPDATE, append the scan lines, otherwise replace." After doing an `mh-get-new-mail' operation in this FOLDER, at least one line that looks like a truncated message number was found. -Remove the text added by the last `mh-inc' command. It should be the messages -cur-last. Call `mh-set-cmd-note', adjusting the notation column with the width -of the largest message number in FOLDER. +Remove the text added by the last `mh-inc' command. It should be the +messages cur-last. Call `mh-set-cmd-note', adjusting the notation +column with the width of the largest message number in FOLDER. Reformat the message number width on each line in the buffer and trim the line length to fit in the window. @@ -2066,8 +2148,9 @@ Return in the current buffer." (defun mh-make-folder-mode-line (&optional ignored) "Set the fields of the mode line for a folder buffer. -The optional argument is now obsolete and IGNORED. It used to be used to pass -in what is now stored in the buffer-local variable `mh-mode-line-annotation'." +The optional argument is now obsolete and IGNORED. It used to be +used to pass in what is now stored in the buffer-local variable +`mh-mode-line-annotation'." (save-excursion (save-window-excursion (mh-first-msg) @@ -2107,8 +2190,8 @@ in what is now stored in the buffer-local variable `mh-mode-line-annotation'." (defun mh-add-sequence-notation (msg internal-seq-flag) "Add sequence notation to the MSG on the current line. -If INTERNAL-SEQ-FLAG is non-nil, then refontify the scan line if font-lock is -turned on." +If INTERNAL-SEQ-FLAG is non-nil, then refontify the scan line if +font-lock is turned on." (with-mh-folder-updating (t) (save-excursion (beginning-of-line) @@ -2129,10 +2212,11 @@ turned on." (defun mh-remove-sequence-notation (msg internal-seq-flag &optional all) "Remove sequence notation from the MSG on the current line. -If INTERNAL-SEQ-FLAG is non-nil, then `font-lock' was used to highlight the -sequence. In that case, no notation needs to be removed. Otherwise the effect -of inserting `mh-note-seq' needs to be reversed. -If ALL is non-nil, then all sequence marks on the scan line are removed." +If INTERNAL-SEQ-FLAG is non-nil, then `font-lock' was used to +highlight the sequence. In that case, no notation needs to be removed. +Otherwise the effect of inserting `mh-note-seq' needs to be reversed. +If ALL is non-nil, then all sequence marks on the scan line are +removed." (with-mh-folder-updating (t) ;; This takes care of internal sequences... (mh-notate nil nil mh-cmd-note) @@ -2172,8 +2256,8 @@ If ALL is non-nil, then all sequence marks on the scan line are removed." (defun mh-goto-cur-msg (&optional minimal-changes-flag) "Position the cursor at the current message. -When optional argument MINIMAL-CHANGES-FLAG is non-nil, the function doesn't -recenter the folder buffer." +When optional argument MINIMAL-CHANGES-FLAG is non-nil, the +function doesn't recenter the folder buffer." (let ((cur-msg (car (mh-seq-to-msgs 'cur)))) (cond ((and cur-msg (mh-goto-msg cur-msg t t)) @@ -2187,7 +2271,8 @@ recenter the folder buffer." (defun mh-process-or-undo-commands (folder) "If FOLDER has outstanding commands, then either process or discard them. -Called by functions like `mh-sort-folder', so also invalidate show buffer." +Called by functions like `mh-sort-folder', so also invalidate +show buffer." (set-buffer folder) (if (mh-outstanding-commands-p) (if (or mh-do-not-confirm-flag @@ -2202,9 +2287,9 @@ Called by functions like `mh-sort-folder', so also invalidate show buffer." (defun mh-process-commands (folder) "Process outstanding commands for FOLDER. -This function runs `mh-before-commands-processed-hook' before the commands are -processed and `mh-after-commands-processed-hook' after the commands are -processed." +This function runs `mh-before-commands-processed-hook' before the +commands are processed and `mh-after-commands-processed-hook' +after the commands are processed." (message "Processing deletes and refiles for %s..." folder) (set-buffer folder) (with-mh-folder-updating (nil) @@ -2334,8 +2419,8 @@ is updated." (defun mh-coalesce-msg-list (messages) "Given a list of MESSAGES, return a list of message number ranges. This is the inverse of `mh-read-msg-list', which expands ranges. -Message lists passed to MH programs should be processed by this function -to avoid exceeding system command line argument limits." +Message lists passed to MH programs should be processed by this +function to avoid exceeding system command line argument limits." (let ((msgs (sort (copy-sequence messages) 'mh-greaterp)) (range-high nil) (prev -1) @@ -2433,8 +2518,9 @@ Expands ranges into set of individual numbers." (defun mh-notate-user-sequences (&optional range) "Mark user-defined sequences in RANGE. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use; if nil all messages are notated." +Check the documentation of `mh-interactive-range' to see how +RANGE is read in interactive use; if nil all messages are +notated." (unless range (setq range (cons (point-min) (point-max)))) (let ((seqs mh-seq-list) @@ -2464,10 +2550,11 @@ interactive use; if nil all messages are notated." (defun mh-delete-msg-from-seq (range sequence &optional internal-flag) "Delete RANGE from SEQUENCE. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +Check the documentation of `mh-interactive-range' to see how +RANGE is read in interactive use. -In a program, non-nil INTERNAL-FLAG means do not inform MH of the change." +In a program, non-nil INTERNAL-FLAG means do not inform MH of the +change." (interactive (list (mh-interactive-range "Delete") (mh-read-seq-default "Delete from" t) nil)) @@ -2495,15 +2582,16 @@ In a program, non-nil INTERNAL-FLAG means do not inform MH of the change." (defun mh-catchup (range) "Delete RANGE from the \"unseen\" sequence. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use." +Check the documentation of `mh-interactive-range' to see how +RANGE is read in interactive use." (interactive (list (mh-interactive-range "Catchup" (cons (point-min) (point-max))))) (mh-delete-msg-from-seq range mh-unseen-seq)) (defun mh-delete-a-msg-from-seq (msg sequence internal-flag) "Delete MSG from SEQUENCE. -If INTERNAL-FLAG is non-nil, then do not inform MH of the change." +If INTERNAL-FLAG is non-nil, then do not inform MH of the +change." (let ((entry (mh-find-seq sequence))) (when (and entry (memq msg (mh-seq-msgs entry))) (if (not internal-flag) @@ -2530,7 +2618,8 @@ Signals an error if SEQ is an invalid name." (defun mh-seq-containing-msg (msg &optional include-internal-flag) "Return a list of the sequences containing MSG. -If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." +If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences +in list." (let ((l mh-seq-list) (seqs ())) (while l |