comparison lisp/mh-e/mh-utils.el @ 66477:117f8e71b37a

* mh-customize.el (mh-adaptive-cmd-note-flag) (mh-scan-format-file, mh-scan-prog): Sync docstrings with manual. * mh-e.el (mh-scan-format-mh, mh-note-deleted, mh-note-refiled) (mh-note-cur, mh-scan-good-msg-regexp) (mh-scan-deleted-msg-regexp, mh-scan-refiled-msg-regexp) (mh-scan-valid-regexp, mh-scan-cur-msg-number-regexp) (mh-scan-date-regexp, mh-scan-rcpt-regexp, mh-scan-body-regexp) (mh-scan-subject-regexp, mh-scan-format-regexp) (mh-folder-font-lock-keywords, mh-set-cmd-note): Sync docstrings with manual. * mh-funcs.el (mh-note-copied): Sync docstrings with manual. * mh-utils.el (mh-goto-msg): Use mh-scan-msg-search-regexp instead of hard-coded string. (mh-mail-header-separator, mh-signature-separator-regexp): Use "regular expression" in docstring instead of regexp. (mh-scan-msg-number-regexp) (mh-scan-msg-overflow-regexp, mh-scan-msg-format-regexp) (mh-scan-msg-format-string, mh-scan-msg-search-regexp) (mh-cmd-note): Sync docstrings with manual.
author Bill Wohler <wohler@newt.com>
date Fri, 28 Oct 2005 01:59:12 +0000
parents cf99ce27df54
children 7cc22b3f2300
comparison
equal deleted inserted replaced
66476:ea959f21cde8 66477:117f8e71b37a
84 84
85 85
86 ;;; Scan Line Formats 86 ;;; Scan Line Formats
87 87
88 (defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)" 88 (defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)"
89 "This regexp is used to extract the message number from a scan line. 89 "This regular expression extracts the message number.
90 It must match from the beginning of the line. Note that the message number
91 must be placed in a parenthesized expression as in the default of
92 \"^ *\\\\([0-9]+\\\\)\".")
93
94 (defvar mh-scan-msg-overflow-regexp "^[?0-9][0-9]"
95 "This regular expression matches overflowed message numbers.")
96
97 (defvar mh-scan-msg-format-regexp "%\\([0-9]*\\)(msg)"
98 "This regular expression finds the message number width in a scan format.
90 Note that the message number must be placed in a parenthesized expression as 99 Note that the message number must be placed in a parenthesized expression as
91 in the default of \"^ *\\\\([0-9]+\\\\)\".") 100 in the default of \"%\\\\([0-9]*\\\\)(msg)\". This variable is only consulted
92 101 if `mh-scan-format-file' is set to \"Use MH-E scan Format\".")
93 (defvar mh-scan-msg-overflow-regexp "^[?0-9][0-9]"
94 "This regexp matches scan lines in which the message number overflowed.")
95
96 (defvar mh-scan-msg-format-regexp "%\\([0-9]*\\)(msg)"
97 "This regexp is used to find the message number width in a scan format.
98 Note that the message number must be placed in a parenthesized expression as
99 in the default of \"%\\\\([0-9]*\\\\)(msg)\".")
100 102
101 (defvar mh-scan-msg-format-string "%d" 103 (defvar mh-scan-msg-format-string "%d"
102 "This is a format string for width of the message number in a scan format. 104 "This is a format string for width of the message number in a scan format.
103 Use `0%d' for zero-filled message numbers.") 105 Use `0%d' for zero-filled message numbers. This variable is only consulted if
106 `mh-scan-format-file' is set to \"Use MH-E scan Format\".")
104 107
105 (defvar mh-scan-msg-search-regexp "^[^0-9]*%d[^0-9]" 108 (defvar mh-scan-msg-search-regexp "^[^0-9]*%d[^0-9]"
106 "This format string regexp matches the scan line for a particular message. 109 "This regular expression matches a particular message.
107 Use `%d' to represent the location of the message number within the 110 It is a format string; use `%d' to represent the location of the message
108 expression as in the default of \"^[^0-9]*%d[^0-9]\".") 111 number within the expression as in the default of \"^[^0-9]*%d[^0-9]\".")
109 112
110 (defvar mh-cmd-note 4 113 (defvar mh-cmd-note 4
111 "This is the number of characters to skip over before inserting notation. 114 "Column where notations begin.
112 This variable should be set with the function `mh-set-cmd-note'. This variable 115 This variable should be set with the function `mh-set-cmd-note'. This variable
113 may be updated dynamically if `mh-adaptive-cmd-note-flag' is non-nil and 116 may be updated dynamically if `mh-adaptive-cmd-note-flag' is on and
114 `mh-scan-format-file' is t.") 117 `mh-scan-format-file' is set to \"Use MH-E scan Format\".
118
119 Note that columns in Emacs start with 0.")
115 (make-variable-buffer-local 'mh-cmd-note) 120 (make-variable-buffer-local 'mh-cmd-note)
116 121
117 (defvar mh-note-seq ?% 122 (defvar mh-note-seq ?%
118 "Messages in a user-defined sequence are marked by this character. 123 "Messages in a user-defined sequence are marked by this character.
119 Messages in the `search' sequence are marked by this character as well.") 124 Messages in the `search' sequence are marked by this character as well.")
131 This variable should not be used directly in programs. Programs should use 136 This variable should not be used directly in programs. Programs should use
132 `mail-header-separator' instead. `mail-header-separator' is initialized to 137 `mail-header-separator' instead. `mail-header-separator' is initialized to
133 `mh-mail-header-separator' in `mh-letter-mode'; in other contexts, you may 138 `mh-mail-header-separator' in `mh-letter-mode'; in other contexts, you may
134 have to perform this initialization yourself. 139 have to perform this initialization yourself.
135 140
136 Do not make this a regexp as it may be the argument to `insert' and it is 141 Do not make this a regular expression as it may be the argument to `insert'
137 passed through `regexp-quote' before being used by functions like 142 and it is passed through `regexp-quote' before being used by functions like
138 `re-search-forward'.") 143 `re-search-forward'.")
139 144
140 (defvar mh-signature-separator-regexp "^-- $" 145 (defvar mh-signature-separator-regexp "^-- $"
141 "Regexp used to find signature separator. 146 "This regular expression matches the signature separator.
142 See `mh-signature-separator'.") 147 See `mh-signature-separator'.")
143 148
144 (defvar mh-signature-separator "-- \n" 149 (defvar mh-signature-separator "-- \n"
145 "Text of a signature separator. 150 "Text of a signature separator.
146 A signature separator is used to separate the body of a message from the 151 A signature separator is used to separate the body of a message from the
1851 (interactive "NGo to message: ") 1856 (interactive "NGo to message: ")
1852 (setq number (prefix-numeric-value number)) 1857 (setq number (prefix-numeric-value number))
1853 (let ((point (point)) 1858 (let ((point (point))
1854 (return-value t)) 1859 (return-value t))
1855 (goto-char (point-min)) 1860 (goto-char (point-min))
1856 (unless (re-search-forward (format "^[ ]*%s[^0-9]+" number) nil t) 1861 (unless (re-search-forward (format mh-scan-msg-search-regexp number) nil t)
1857 (goto-char point) 1862 (goto-char point)
1858 (unless no-error-if-no-message 1863 (unless no-error-if-no-message
1859 (error "No message %d" number)) 1864 (error "No message %d" number))
1860 (setq return-value nil)) 1865 (setq return-value nil))
1861 (beginning-of-line) 1866 (beginning-of-line)