X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/9aecacd08a93bffb529cee59d74477890ce96f37..d8788e1e6f06cc719c4348c407015338a59a2f05:/lisp/mh-e/mh-scan.el diff --git a/lisp/mh-e/mh-scan.el b/lisp/mh-e/mh-scan.el index 07d3336851..5f0c081871 100644 --- a/lisp/mh-e/mh-scan.el +++ b/lisp/mh-e/mh-scan.el @@ -1,7 +1,6 @@ ;;; mh-scan.el --- MH-E scan line constants and utilities -;; Copyright (C) 1993, 1995, 1997, -;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1995, 1997, 2000-2012 Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -10,10 +9,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,9 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -62,7 +59,7 @@ "%{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 +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). @@ -110,14 +107,14 @@ non-empty Newsgroups: field is present.") 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 +\"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this regular expression is not correct, the body fragment will not be highlighted with the face `mh-folder-body'.") (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 +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 @@ -126,9 +123,9 @@ matches the message number as in the default of This expression includes the leading space and current message marker \"+\" within the parenthesis since it looks better to -highlight these items as well. The highlighting is done with the -face `mh-folder-cur-msg-number'. This regular expression should -be correct as it is needed by non-fontification functions. See +highlight these items as well. The highlighting is done with the +face `mh-folder-cur-msg-number'. 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]\\)" @@ -138,14 +135,14 @@ 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 +\"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular expression is not correct, the date will not be highlighted with the face `mh-folder-date'.") (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 +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 @@ -153,15 +150,15 @@ 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. The highlighting -is done with the face `mh-folder-deleted'. This regular +since it looks better to highlight it as well. The highlighting +is done with the face `mh-folder-deleted'. This regular expression should be correct as it is needed by non-fontification -functions. See also `mh-note-deleted'.") +functions. See also `mh-note-deleted'.") (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 +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 @@ -169,8 +166,8 @@ 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. The highlighting -is done with the face `mh-folder-msg-number'. This regular +since it looks better to highlight it as well. The highlighting +is done with the face `mh-folder-msg-number'. This regular expression should be correct as it is needed by non-fontification functions.") @@ -178,21 +175,21 @@ functions.") "This regular expression finds the message number width in a scan format. Note that the message number must be placed in a parenthesized -expression as in the default of \"%\\\\([0-9]*\\\\)(msg)\". This +expression as in the default of \"%\\\\([0-9]*\\\\)(msg)\". This variable is only consulted if `mh-scan-format-file' is set to \"Use MH-E scan Format\".") (defvar mh-scan-msg-format-string "%d" "This is a format string for width of the message number in a scan format. -Use \"0%d\" for zero-filled message numbers. This variable is only +Use \"0%d\" for zero-filled message numbers. This variable is only consulted if `mh-scan-format-file' is set to \"Use MH-E scan Format\".") (defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)" "This regular expression extracts the message number. -It must match from the beginning of the line. Note that the +It must match from the beginning of the line. Note that the message number must be placed in a parenthesized expression as in the default of \"^ *\\\\([0-9]+\\\\)\".") @@ -212,9 +209,9 @@ message number within the expression as in the default of 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 +format file generates. The second is expected to match the recipient's name as in the default of -\"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular +\"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular expression is not correct, the \"To:\" string will not be highlighted with the face `mh-folder-to' and the recipient will not be highlighted with the face `mh-folder-address'") @@ -222,7 +219,7 @@ not be highlighted with the face `mh-folder-address'") (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 +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 @@ -230,10 +227,10 @@ 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. The highlighting -is done with the face `mh-folder-refiled'. This regular +since it looks better to highlight it as well. The highlighting +is done with the face `mh-folder-refiled'. This regular expression should be correct as it is needed by non-fontification -functions. See also `mh-note-refiled'.") +functions. See also `mh-note-refiled'.") (defvar mh-scan-sent-to-me-sender-regexp "^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)" @@ -241,7 +238,7 @@ functions. See also `mh-note-refiled'.") Note that the default setting of `mh-folder-font-lock-keywords' expects this expression to contain at least two parenthesized -expressions. The first should match the fontification hint (see +expressions. The first should match the fontification hint (see `mh-scan-format-nmh') and the second should match the user name as in the default of @@ -256,15 +253,15 @@ highlighted with the face `mh-folder-sent-to-me-sender'.") "^ *[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 +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, and is -highlighted with the face `mh-folder-followup'. The second +highlighted with the face `mh-folder-followup'. 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 which -is highlighted with the face `mh-folder-subject'. For example, +is highlighted with the face `mh-folder-subject'. For example, the default (broken on multiple lines for readability) is ^ *[0-9]+........[ ]*................... @@ -297,9 +294,9 @@ Note that columns in Emacs start with 0.") (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, +This column will have one of the values: \" \", \"D\", \"^\", \"+\", 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.") @@ -311,7 +308,7 @@ 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 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. @@ -423,7 +420,7 @@ Note that columns in Emacs start with 0." (defun mh-scan-format () "Return the output format argument for the scan program." (if (equal mh-scan-format-file t) - (list "-format" (if (mh-variant-p 'nmh 'mu-mh) + (list "-format" (if (mh-variant-p 'nmh 'gnu-mh) (list (mh-update-scan-format mh-scan-format-nmh mh-cmd-note)) (list (mh-update-scan-format @@ -435,7 +432,7 @@ Note that columns in Emacs start with 0." "Return a scan format with the (msg) width in the FMT replaced with WIDTH. The message number width portion of the format is discovered -using `mh-scan-msg-format-regexp'. Its replacement is controlled +using `mh-scan-msg-format-regexp'. Its replacement is controlled with `mh-scan-msg-format-string'." (or (and (string-match mh-scan-msg-format-regexp fmt) @@ -452,8 +449,7 @@ with `mh-scan-msg-format-string'." (or mh-progs (mh-find-path)) (let ((tmp-buffer (get-buffer-create mh-temp-buffer)) (width 0)) - (save-excursion - (set-buffer tmp-buffer) + (with-current-buffer tmp-buffer (erase-buffer) (apply 'call-process (expand-file-name mh-scan-prog mh-progs) nil '(t nil) nil @@ -471,7 +467,7 @@ 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 +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." @@ -487,5 +483,4 @@ comes after that." ;; sentence-end-double-space: nil ;; End: -;; arch-tag: 5ab35d46-101e-443b-a2b6-5a908cf97528 ;;; mh-scan.el ends here