aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mh-e
diff options
context:
space:
mode:
authorBill Wohler2006-02-01 23:24:34 +0000
committerBill Wohler2006-02-01 23:24:34 +0000
commitd5dc8c56355ef34ef00a46b487092ee7ee8fa61b (patch)
tree08f9336d93983b4f3479773bbe4f5537c12c91b4 /lisp/mh-e
parent05227fbee3ee5d14b6c0ba5ed196af471bc9d1ac (diff)
downloademacs-d5dc8c56355ef34ef00a46b487092ee7ee8fa61b.tar.gz
emacs-d5dc8c56355ef34ef00a46b487092ee7ee8fa61b.zip
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
instead of replace-regexp-in-string. (crm, multi-prompt): Use mh-require instead of require. (mh-goto-address-find-address-at-point): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. Use mh-match-string-no-properties instead of match-string-no-properties. * mh-comp.el (mh-modify-header-field): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-compat.el (mailabbrev): Use mh-require instead of require. (mh-assoc-string, mh-display-completion-list, mh-face-foreground) (mh-face-background): Make docstring consistent. (mh-require, mh-cancel-timer, mh-display-color-cells) (mh-line-beginning-position, mh-line-end-position) (mh-match-string-no-properties, mh-replace-regexp-in-string) (mh-view-mode-enter): Move definition here from mh-xemacs.el and add mh- prefix since compatibility functions should have our package prefix (mh-) by Emacs convention and to avoid messing up checks for the same functions in other packages. * mh-e.el (mh-compiling-flag): Move mh-xemacs-compiling-flag here from mh-xemacs.el and rename. (mh-xargs): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. (mh-defface-compat): Use mh-display-color-cells instead of display-color-cells. * mh-folder.el (which-func): Use mh-require instead of require. * mh-funcs.el (mh-list-folders): Use mh-view-mode-enter instead of view-mode-enter. * mh-gnus.el (gnus-util, mm-bodies, mm-decode, mm-view, mml): Use mh-require instead of require. * mh-letter.el (mh-letter-header-end, mh-letter-mode) (mh-letter-next-header-field): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-limit.el (mh-subject-to-sequence-unthreaded): Use mh-match-string-no-properties instead of match-string-no-properties. (mh-narrow-to-header-field): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-mime.el (mh-mime-inline-part, mh-mm-display-part) (mh-mh-quote-unescaped-sharp, mh-mh-directive-present-p): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-search.el (which-func): Use mh-require instead of require. (mh-make-pick-template, mh-index-visit-folder) (mh-pick-parse-search-buffer, mh-swish-next-result) (mh-mairix-next-result, mh-namazu-next-result) (mh-pick-next-result, mh-grep-next-result) (mh-index-create-imenu-index, mh-index-match-checksum) (mh-md5sum-parser, mh-openssl-parser, mh-index-update-maps): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-seq.el (mh-list-sequences): Use mh-view-mode-enter instead of view-mode-enter. (mh-folder-size-flist, mh-parse-flist-output-line) (mh-add-sequence-notation): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-show.el (mh-show-addr): Use mh-require instead of require. * mh-speed.el (mh-folder-speedbar-menu-items, mh-speed-toggle) (mh-speed-view, mh-folder-speedbar-buttons) (mh-speed-highlight, mh-speed-goto-folder) (mh-speed-add-buttons, mh-speed-parse-flists-output) (mh-speed-invalidate-map, mh-speedbar-change-expand-button-char) (mh-speed-add-folder): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. (mh-speed-flists): Use mh-cancel-timer instead of cancel-timer. * mh-thread.el (mh-thread-find-children) (mh-thread-parse-scan-line, mh-thread-generate): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-utils.el (mh-colors-available-p): Use mh-display-color-cells instead of display-color-cells. (mh-folder-list): Use mh-replace-regexp-in-string instead of replace-regexp-in-string. (mh-sub-folders-actual, mh-letter-toggle-header-field-display): Use mh-line-beginning-position and mh-line-end-position instead of line-beginning-position and line-end-position. * mh-comp.el (mh-send-sub): Don't find components file in current directory--this seems to have been a side-effect of commenting out the use of an old mh-etc variable. Improve error message.
Diffstat (limited to 'lisp/mh-e')
-rw-r--r--lisp/mh-e/ChangeLog107
-rw-r--r--lisp/mh-e/mh-alias.el14
-rw-r--r--lisp/mh-e/mh-comp.el2
-rw-r--r--lisp/mh-e/mh-compat.el106
-rw-r--r--lisp/mh-e/mh-e.el13
-rw-r--r--lisp/mh-e/mh-folder.el2
-rw-r--r--lisp/mh-e/mh-funcs.el2
-rw-r--r--lisp/mh-e/mh-gnus.el10
-rw-r--r--lisp/mh-e/mh-letter.el6
-rw-r--r--lisp/mh-e/mh-limit.el6
-rw-r--r--lisp/mh-e/mh-mime.el16
-rw-r--r--lisp/mh-e/mh-search.el61
-rw-r--r--lisp/mh-e/mh-seq.el8
-rw-r--r--lisp/mh-e/mh-show.el2
-rw-r--r--lisp/mh-e/mh-speed.el60
-rw-r--r--lisp/mh-e/mh-thread.el20
-rw-r--r--lisp/mh-e/mh-utils.el23
17 files changed, 328 insertions, 130 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index dc465888f44..0f149f2b061 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,10 +1,115 @@
12006-02-01 Bill Wohler <wohler@newt.com>
2
3 * mh-alias.el (mh-alias-gecos-name): Use
4 mh-replace-regexp-in-string instead of replace-regexp-in-string.
5 (crm, multi-prompt): Use mh-require instead of require.
6 (mh-goto-address-find-address-at-point): Use
7 mh-line-beginning-position and mh-line-end-position instead of
8 line-beginning-position and line-end-position. Use
9 mh-match-string-no-properties instead of
10 match-string-no-properties.
11
12 * mh-comp.el (mh-modify-header-field): Use
13 mh-line-beginning-position and mh-line-end-position instead of
14 line-beginning-position and line-end-position.
15
16 * mh-compat.el (mailabbrev): Use mh-require instead of require.
17 (mh-assoc-string, mh-display-completion-list, mh-face-foreground)
18 (mh-face-background): Make docstring consistent.
19 (mh-require, mh-cancel-timer, mh-display-color-cells)
20 (mh-line-beginning-position, mh-line-end-position)
21 (mh-match-string-no-properties, mh-replace-regexp-in-string)
22 (mh-view-mode-enter): Move definition here from mh-xemacs.el and
23 add mh- prefix since compatibility functions should have our
24 package prefix (mh-) by Emacs convention and to avoid messing up
25 checks for the same functions in other packages.
26
27 * mh-e.el (mh-compiling-flag): Move mh-xemacs-compiling-flag here
28 from mh-xemacs.el and rename.
29 (mh-xargs): Use mh-line-beginning-position and
30 mh-line-end-position instead of line-beginning-position and
31 line-end-position.
32 (mh-defface-compat): Use mh-display-color-cells instead of
33 display-color-cells.
34
35 * mh-folder.el (which-func): Use mh-require instead of require.
36
37 * mh-funcs.el (mh-list-folders): Use mh-view-mode-enter instead of
38 view-mode-enter.
39
40 * mh-gnus.el (gnus-util, mm-bodies, mm-decode, mm-view, mml): Use
41 mh-require instead of require.
42
43 * mh-letter.el (mh-letter-header-end, mh-letter-mode)
44 (mh-letter-next-header-field): Use mh-line-beginning-position and
45 mh-line-end-position instead of line-beginning-position and
46 line-end-position.
47
48 * mh-limit.el (mh-subject-to-sequence-unthreaded): Use
49 mh-match-string-no-properties instead of
50 match-string-no-properties.
51 (mh-narrow-to-header-field): Use mh-line-beginning-position and
52 mh-line-end-position instead of line-beginning-position and
53 line-end-position.
54
55 * mh-mime.el (mh-mime-inline-part, mh-mm-display-part)
56 (mh-mh-quote-unescaped-sharp, mh-mh-directive-present-p): Use
57 mh-line-beginning-position and mh-line-end-position instead of
58 line-beginning-position and line-end-position.
59
60 * mh-search.el (which-func): Use mh-require instead of require.
61 (mh-make-pick-template, mh-index-visit-folder)
62 (mh-pick-parse-search-buffer, mh-swish-next-result)
63 (mh-mairix-next-result, mh-namazu-next-result)
64 (mh-pick-next-result, mh-grep-next-result)
65 (mh-index-create-imenu-index, mh-index-match-checksum)
66 (mh-md5sum-parser, mh-openssl-parser, mh-index-update-maps): Use
67 mh-line-beginning-position and mh-line-end-position instead of
68 line-beginning-position and line-end-position.
69
70 * mh-seq.el (mh-list-sequences): Use mh-view-mode-enter instead of
71 view-mode-enter.
72 (mh-folder-size-flist, mh-parse-flist-output-line)
73 (mh-add-sequence-notation): Use mh-line-beginning-position and
74 mh-line-end-position instead of line-beginning-position and
75 line-end-position.
76
77 * mh-show.el (mh-show-addr): Use mh-require instead of require.
78
79 * mh-speed.el (mh-folder-speedbar-menu-items, mh-speed-toggle)
80 (mh-speed-view, mh-folder-speedbar-buttons)
81 (mh-speed-highlight, mh-speed-goto-folder)
82 (mh-speed-add-buttons, mh-speed-parse-flists-output)
83 (mh-speed-invalidate-map, mh-speedbar-change-expand-button-char)
84 (mh-speed-add-folder): Use mh-line-beginning-position and
85 mh-line-end-position instead of line-beginning-position and
86 line-end-position.
87 (mh-speed-flists): Use mh-cancel-timer instead of cancel-timer.
88
89 * mh-thread.el (mh-thread-find-children)
90 (mh-thread-parse-scan-line, mh-thread-generate): Use
91 mh-line-beginning-position and mh-line-end-position instead of
92 line-beginning-position and line-end-position.
93
94 * mh-utils.el (mh-colors-available-p): Use mh-display-color-cells
95 instead of display-color-cells.
96 (mh-folder-list): Use mh-replace-regexp-in-string instead of
97 replace-regexp-in-string.
98 (mh-sub-folders-actual, mh-letter-toggle-header-field-display):
99 Use mh-line-beginning-position and mh-line-end-position instead of
100 line-beginning-position and line-end-position.
101
102 * mh-comp.el (mh-send-sub): Don't find components file in current
103 directory--this seems to have been a side-effect of commenting out
104 the use of an old mh-etc variable. Improve error message.
105
12006-01-31 Bill Wohler <wohler@newt.com> 1062006-01-31 Bill Wohler <wohler@newt.com>
2 107
3 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name 108 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name
4 argument since compatibility functions should have our package 109 argument since compatibility functions should have our package
5 prefix (mh-) by Emacs convention and to avoid messing up checks 110 prefix (mh-) by Emacs convention and to avoid messing up checks
6 for the same functions in other packages. Use explicit argument 111 for the same functions in other packages. Use explicit argument
7 instead of forming name by adding mh-e prefix so that one can grep 112 instead of forming name by adding mh- prefix so that one can grep
8 and find the definition. 113 and find the definition.
9 114
10 * mh-alias.el (mh-alias-local-users, mh-alias-reload) 115 * mh-alias.el (mh-alias-local-users, mh-alias-reload)
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 23af886c320..9dc2871241f 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -125,10 +125,10 @@ COMMA-SEPARATOR is non-nil."
125 (setq res (match-string 1 res))) 125 (setq res (match-string 1 res)))
126 ;; Replace "&" with capitalized username 126 ;; Replace "&" with capitalized username
127 (if (string-match "&" res) 127 (if (string-match "&" res)
128 (setq res (replace-regexp-in-string "&" (capitalize username) res))) 128 (setq res (mh-replace-regexp-in-string "&" (capitalize username) res)))
129 ;; Remove " character 129 ;; Remove " character
130 (if (string-match "\"" res) 130 (if (string-match "\"" res)
131 (setq res (replace-regexp-in-string "\"" "" res))) 131 (setq res (mh-replace-regexp-in-string "\"" "" res)))
132 ;; If empty string, use username instead 132 ;; If empty string, use username instead
133 (if (string-equal "" res) 133 (if (string-equal "" res)
134 (setq res username)) 134 (setq res username))
@@ -258,8 +258,8 @@ Blind aliases or users from /etc/passwd are not expanded."
258 (t 258 (t
259 (mh-alias-ali alias)))) 259 (mh-alias-ali alias))))
260 260
261(require 'crm nil t) ; completing-read-multiple 261(mh-require 'crm nil t) ; completing-read-multiple
262(require 'multi-prompt nil t) 262(mh-require 'multi-prompt nil t)
263 263
264;;;###mh-autoload 264;;;###mh-autoload
265(defun mh-read-address (prompt) 265(defun mh-read-address (prompt)
@@ -606,12 +606,12 @@ filing messages."
606 606
607Then search backwards to beginning of line for the start of an 607Then search backwards to beginning of line for the start of an
608e-mail address. If no e-mail address found, return nil." 608e-mail address. If no e-mail address found, return nil."
609 (re-search-backward "[^-_A-z0-9.@]" (line-beginning-position) 'lim) 609 (re-search-backward "[^-_A-z0-9.@]" (mh-line-beginning-position) 'lim)
610 (if (or (looking-at mh-address-mail-regexp) ; already at start 610 (if (or (looking-at mh-address-mail-regexp) ; already at start
611 (and (re-search-forward mh-address-mail-regexp 611 (and (re-search-forward mh-address-mail-regexp
612 (line-end-position) 'lim) 612 (mh-line-end-position) 'lim)
613 (goto-char (match-beginning 0)))) 613 (goto-char (match-beginning 0))))
614 (match-string-no-properties 0))) 614 (mh-match-string-no-properties 0)))
615 615
616(defun mh-alias-apropos (regexp) 616(defun mh-alias-apropos (regexp)
617 "Show all aliases or addresses that match a regular expression REGEXP." 617 "Show all aliases or addresses that match a regular expression REGEXP."
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 2377151eeb3..5d2730f4afa 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -1031,7 +1031,7 @@ discarded."
1031 (cond ((and overwrite-flag 1031 (cond ((and overwrite-flag
1032 (mh-goto-header-field (concat field ":"))) 1032 (mh-goto-header-field (concat field ":")))
1033 (insert " " value) 1033 (insert " " value)
1034 (delete-region (point) (line-end-position))) 1034 (delete-region (point) (mh-line-end-position)))
1035 ((and (not overwrite-flag) 1035 ((and (not overwrite-flag)
1036 (mh-regexp-in-field-p (concat "\\b" value "\\b") field)) 1036 (mh-regexp-in-field-p (concat "\\b" value "\\b") field))
1037 ;; Already there, do nothing. 1037 ;; Already there, do nothing.
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index c60ae20d811..d726a85a38f 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -37,31 +37,60 @@
37;; macros we can retire. 37;; macros we can retire.
38 38
39;; Please use mh-gnus.el when providing compatibility with different 39;; Please use mh-gnus.el when providing compatibility with different
40;; versions of Gnus and mh-xemacs.el for compatibility with XEmacs. 40;; versions of Gnus.
41 41
42;; Items are listed alphabetically. 42;; Items are listed alphabetically (except for mh-require which is
43;; needed by a lesser character).
44
45(require 'mh-acros)
46
47(mh-do-in-gnu-emacs
48 (defalias 'mh-require 'require))
49
50(mh-do-in-xemacs
51 (defun mh-require (feature &optional filename noerror)
52 "If feature FEATURE is not loaded, load it from FILENAME.
53If FEATURE is not a member of the list `features', then the feature
54is not loaded; so load the file FILENAME.
55If FILENAME is omitted, the printname of FEATURE is used as the file name.
56If the optional third argument NOERROR is non-nil,
57then return nil if the file is not found instead of signaling an error.
58
59Simulate NOERROR argument in XEmacs which lacks it."
60 (if (not (featurep feature))
61 (if filename
62 (load filename noerror t)
63 (load (format "%s" feature) noerror t)))))
43 64
44(mh-defun-compat mh-assoc-string assoc-string (key list case-fold) 65(mh-defun-compat mh-assoc-string assoc-string (key list case-fold)
45 "Like `assoc' but specifically for strings. 66 "Like `assoc' but specifically for strings.
46Case is ignored if CASE-FOLD is non-nil. 67Case is ignored if CASE-FOLD is non-nil.
47This function added by MH-E for Emacs versions that lack 68This function is used by Emacs versions that lack `assoc-string',
48`assoc-string', introduced in Emacs 22." 69introduced in Emacs 22."
49 (if case-fold 70 (if case-fold
50 (assoc-ignore-case key list) 71 (assoc-ignore-case key list)
51 (assoc key list))) 72 (assoc key list)))
52 73
53(require 'mailabbrev nil t) 74;; For XEmacs.
54(mh-defun-compat mh-mail-abbrev-make-syntax-table 75(defalias 'mh-cancel-timer
55 mail-abbrev-make-syntax-table () 76 (if (fboundp 'cancel-timer)
56 "Emacs 21 and XEmacs don't have this function." 77 'cancel-timer
57 nil) 78 'delete-itimer))
79
80(mh-defun-compat mh-display-color-cells display-color-cells (&optional display)
81 "Return the number of color cells supported by DISPLAY.
82This function is used by XEmacs to always return 0 when compiling
83to avoid compiling errors. Otherwise uses `device-color-cells'."
84 (if mh-compiling-flag
85 0
86 (device-color-cells display)))
58 87
59(defmacro mh-display-completion-list (completions &optional common-substring) 88(defmacro mh-display-completion-list (completions &optional common-substring)
60 "Display the list of COMPLETIONS. 89 "Display the list of COMPLETIONS.
61See documentation for `display-completion-list' for a description of the 90See documentation for `display-completion-list' for a description of the
62arguments COMPLETIONS and perhaps COMMON-SUBSTRING. 91arguments COMPLETIONS and perhaps COMMON-SUBSTRING.
63This macro added by MH-E for Emacs versions that lack a 92This macro is used by Emacs versions that lack a COMMON-SUBSTRING
64COMMON-SUBSTRING argument, introduced in Emacs 22." 93argument, introduced in Emacs 22."
65 (if (< emacs-major-version 22) 94 (if (< emacs-major-version 22)
66 `(display-completion-list ,completions) 95 `(display-completion-list ,completions)
67 `(display-completion-list ,completions ,common-substring))) 96 `(display-completion-list ,completions ,common-substring)))
@@ -70,8 +99,8 @@ COMMON-SUBSTRING argument, introduced in Emacs 22."
70 "Return the foreground color name of FACE, or nil if unspecified. 99 "Return the foreground color name of FACE, or nil if unspecified.
71See documentation for `face-foreground' for a description of the 100See documentation for `face-foreground' for a description of the
72arguments FACE, FRAME, and perhaps INHERIT. 101arguments FACE, FRAME, and perhaps INHERIT.
73This macro added by MH-E for Emacs versions that lack an INHERIT 102This macro is used by Emacs versions that lack an INHERIT argument,
74argument, introduced in Emacs 22." 103introduced in Emacs 22."
75 (if (< emacs-major-version 22) 104 (if (< emacs-major-version 22)
76 `(face-foreground ,face ,frame) 105 `(face-foreground ,face ,frame)
77 `(face-foreground ,face ,frame ,inherit))) 106 `(face-foreground ,face ,frame ,inherit)))
@@ -80,12 +109,48 @@ argument, introduced in Emacs 22."
80 "Return the background color name of face, or nil if unspecified. 109 "Return the background color name of face, or nil if unspecified.
81See documentation for `back-foreground' for a description of the 110See documentation for `back-foreground' for a description of the
82arguments FACE, FRAME, and INHERIT. 111arguments FACE, FRAME, and INHERIT.
83This macro added by MH-E for Emacs versions that lack an INHERIT 112This macro is used by Emacs versions that lack an INHERIT argument,
84argument, introduced in Emacs 22." 113introduced in Emacs 22."
85 (if (< emacs-major-version 22) 114 (if (< emacs-major-version 22)
86 `(face-background ,face ,frame) 115 `(face-background ,face ,frame)
87 `(face-background ,face ,frame ,inherit))) 116 `(face-background ,face ,frame ,inherit)))
88 117
118;; For XEmacs.
119(defalias 'mh-line-beginning-position
120 (if (fboundp 'line-beginning-position)
121 'line-beginning-position
122 'point-at-bol))
123
124;; For XEmacs.
125(defalias 'mh-line-end-position
126 (if (fboundp 'line-end-position)
127 'line-end-position
128 'point-at-eol))
129
130(mh-require 'mailabbrev nil t)
131(mh-defun-compat mh-mail-abbrev-make-syntax-table
132 mail-abbrev-make-syntax-table ()
133 "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
134This function does nothing on those systems."
135 nil)
136
137(mh-defun-compat mh-match-string-no-properties
138 match-string-no-properties (num &optional string)
139 "Return string of text matched by last search, without text properties.
140This function is used by XEmacs that lacks `match-string-no-properties'.
141The function `buffer-substring-no-properties' is used instead.
142The argument STRING is ignored."
143 (buffer-substring-no-properties
144 (match-beginning num) (match-end num)))
145
146(mh-defun-compat mh-replace-regexp-in-string replace-regexp-in-string
147 (rep string &optional fixedcase literal subexp start)
148 "Replace REGEXP with REP everywhere in STRING and return result.
149This function is used by XEmacs that lacks `replace-regexp-in-string'.
150The function `replace-in-string' is used instead.
151The arguments FIXEDCASE, LITERAL, SUBEXP, and START are ignored."
152 (replace-in-string string regexp rep))
153
89;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21. 154;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21.
90(if (not (boundp 'url-unreserved-chars)) 155(if (not (boundp 'url-unreserved-chars))
91 (defconst mh-url-unresrved-chars 156 (defconst mh-url-unresrved-chars
@@ -111,6 +176,17 @@ This is a copy of `url-hexify-string' from url-util.el in Emacs
111 (char-to-string char))) 176 (char-to-string char)))
112 str "")) 177 str ""))
113 178
179(mh-defun-compat mh-view-mode-enter
180 view-mode-enter (&optional return-to exit-action)
181 "Enter View mode.
182This function is used by XEmacs that lacks `view-mode-enter'.
183The function `view-mode' is used instead.
184The arguments RETURN-TO and EXIT-ACTION are ignored."
185 ;; Shush compiler.
186 (if return-to nil)
187 (if exit-action nil)
188 (view-mode 1))
189
114(defmacro mh-write-file-functions () 190(defmacro mh-write-file-functions ()
115 "Return `write-file-functions' if it exists. 191 "Return `write-file-functions' if it exists.
116Otherwise return `local-write-file-hooks'. 192Otherwise return `local-write-file-hooks'.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 5b738933590..3b96575b3d4 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -101,7 +101,13 @@
101 101
102(eval-and-compile 102(eval-and-compile
103 (defvar mh-xemacs-flag (featurep 'xemacs) 103 (defvar mh-xemacs-flag (featurep 'xemacs)
104 "Non-nil means the current Emacs is XEmacs.")) 104 "Non-nil means the current Emacs is XEmacs.")
105 (defvar mh-compiling-flag nil
106 "Non-nil means we're compiling."))
107
108(eval-when (compile)
109 (setq mh-compiling-flag t))
110
105(mh-do-in-xemacs 111(mh-do-in-xemacs
106 (require 'mh-xemacs)) 112 (require 'mh-xemacs))
107 113
@@ -464,7 +470,8 @@ all the strings have been used."
464 (let ((arg-list (reverse args)) 470 (let ((arg-list (reverse args))
465 (count 0)) 471 (count 0))
466 (while (and (not (eobp)) (< count mh-index-max-cmdline-args)) 472 (while (and (not (eobp)) (< count mh-index-max-cmdline-args))
467 (push (buffer-substring-no-properties (point) (line-end-position)) 473 (push (buffer-substring-no-properties (point)
474 (mh-line-end-position))
468 arg-list) 475 arg-list)
469 (incf count) 476 (incf count)
470 (forward-line)) 477 (forward-line))
@@ -2970,7 +2977,7 @@ entirely if the display does not support the number of specified
2970colors." 2977colors."
2971 (if mh-min-colors-defined-flag 2978 (if mh-min-colors-defined-flag
2972 spec 2979 spec
2973 (let ((cells (display-color-cells)) 2980 (let ((cells (mh-display-color-cells))
2974 new-spec) 2981 new-spec)
2975 ;; Remove entries with min-colors, or delete them if we have fewer colors 2982 ;; Remove entries with min-colors, or delete them if we have fewer colors
2976 ;; than they specify. 2983 ;; than they specify.
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 5339363df19..59526986d35 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -516,7 +516,7 @@ font-lock is done highlighting.")
516 (cons (current-buffer) nil))))) 516 (cons (current-buffer) nil)))))
517 517
518;; Register mh-folder-mode as supporting which-function-mode... 518;; Register mh-folder-mode as supporting which-function-mode...
519(require 'which-func nil t) 519(mh-require 'which-func nil t)
520(when (boundp 'which-func-modes) 520(when (boundp 'which-func-modes)
521 (add-to-list 'which-func-modes 'mh-folder-mode)) 521 (add-to-list 'which-func-modes 'mh-folder-mode))
522 522
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index 0565ed42e6b..f7abb4cb389 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -154,7 +154,7 @@ Display the results only if something went wrong."
154 "-recurse" 154 "-recurse"
155 "-norecurse")) 155 "-norecurse"))
156 (goto-char (point-min)) 156 (goto-char (point-min))
157 (view-mode-enter) 157 (mh-view-mode-enter)
158 (setq view-exit-action 'kill-buffer) 158 (setq view-exit-action 'kill-buffer)
159 (message "Listing folders...done"))))) 159 (message "Listing folders...done")))))
160 160
diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el
index 8944db89f70..970f98556e2 100644
--- a/lisp/mh-e/mh-gnus.el
+++ b/lisp/mh-e/mh-gnus.el
@@ -32,11 +32,11 @@
32 32
33(require 'mh-e) 33(require 'mh-e)
34 34
35(require 'gnus-util nil t) 35(mh-require 'gnus-util nil t)
36(require 'mm-bodies nil t) 36(mh-require 'mm-bodies nil t)
37(require 'mm-decode nil t) 37(mh-require 'mm-decode nil t)
38(require 'mm-view nil t) 38(mh-require 'mm-view nil t)
39(require 'mml nil t) 39(mh-require 'mml nil t)
40 40
41;; Copy of function from gnus-util.el. 41;; Copy of function from gnus-util.el.
42(mh-defun-compat mh-gnus-local-map-property gnus-local-map-property (map) 42(mh-defun-compat mh-gnus-local-map-property gnus-local-map-property (map)
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index a5a7af24e91..c6af5c323a9 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -267,7 +267,7 @@ searching for `mh-mail-header-separator' in the buffer."
267 (goto-char (point-min)) 267 (goto-char (point-min))
268 (cond ((equal mh-mail-header-separator "") (point-min)) 268 (cond ((equal mh-mail-header-separator "") (point-min))
269 ((search-forward (format "\n%s\n" mh-mail-header-separator) nil t) 269 ((search-forward (format "\n%s\n" mh-mail-header-separator) nil t)
270 (line-beginning-position 0)) 270 (mh-line-beginning-position 0))
271 (t (point-min))))) 271 (t (point-min)))))
272 272
273 273
@@ -319,7 +319,7 @@ order).
319 (set (make-local-variable 'mh-mail-header-separator) 319 (set (make-local-variable 'mh-mail-header-separator)
320 (save-excursion 320 (save-excursion
321 (goto-char (mh-mail-header-end)) 321 (goto-char (mh-mail-header-end))
322 (buffer-substring-no-properties (point) (line-end-position)))) 322 (buffer-substring-no-properties (point) (mh-line-end-position))))
323 (make-local-variable 'mail-header-separator) 323 (make-local-variable 'mail-header-separator)
324 (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el 324 (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el
325 (mh-set-help mh-letter-mode-help-messages) 325 (mh-set-help mh-letter-mode-help-messages)
@@ -828,7 +828,7 @@ body."
828 ((< (point) (progn 828 ((< (point) (progn
829 (beginning-of-line) 829 (beginning-of-line)
830 (re-search-forward mh-letter-header-field-regexp 830 (re-search-forward mh-letter-header-field-regexp
831 (line-end-position) t) 831 (mh-line-end-position) t)
832 (point))) 832 (point)))
833 (beginning-of-line)) 833 (beginning-of-line))
834 (t (end-of-line))) 834 (t (end-of-line)))
diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el
index 68ec25a9470..7a90b890cad 100644
--- a/lisp/mh-e/mh-limit.el
+++ b/lisp/mh-e/mh-limit.el
@@ -211,7 +211,7 @@ Return number of messages put in the sequence:
211 (string-equal "" (match-string 3))) 211 (string-equal "" (match-string 3)))
212 (progn (message "No subject line") 212 (progn (message "No subject line")
213 nil) 213 nil)
214 (let ((subject (match-string-no-properties 3)) 214 (let ((subject (mh-match-string-no-properties 3))
215 (list)) 215 (list))
216 (if (> (length subject) mh-limit-max-subject-size) 216 (if (> (length subject) mh-limit-max-subject-size)
217 (setq subject (substring subject 0 mh-limit-max-subject-size))) 217 (setq subject (substring subject 0 mh-limit-max-subject-size)))
@@ -219,7 +219,7 @@ Return number of messages put in the sequence:
219 (if all 219 (if all
220 (goto-char (point-min))) 220 (goto-char (point-min)))
221 (while (re-search-forward mh-scan-subject-regexp nil t) 221 (while (re-search-forward mh-scan-subject-regexp nil t)
222 (let ((this-subject (match-string-no-properties 3))) 222 (let ((this-subject (mh-match-string-no-properties 3)))
223 (if (> (length this-subject) mh-limit-max-subject-size) 223 (if (> (length this-subject) mh-limit-max-subject-size)
224 (setq this-subject (substring this-subject 224 (setq this-subject (substring this-subject
225 0 mh-limit-max-subject-size))) 225 0 mh-limit-max-subject-size)))
@@ -310,7 +310,7 @@ The MH command pick is used to do the match."
310 (while (not (eobp)) 310 (while (not (eobp))
311 (let ((num (ignore-errors 311 (let ((num (ignore-errors
312 (string-to-number 312 (string-to-number
313 (buffer-substring (point) (line-end-position)))))) 313 (buffer-substring (point) (mh-line-end-position))))))
314 (when num (push num msg-list)) 314 (when num (push num msg-list))
315 (forward-line)))) 315 (forward-line))))
316 (if (null msg-list) 316 (if (null msg-list)
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 776f0c067a8..787f5c371fe 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -302,14 +302,14 @@ the attachment labeled with that number."
302 start end) 302 start end)
303 (cond ((and data (not inserted-flag) (not displayed-flag)) 303 (cond ((and data (not inserted-flag) (not displayed-flag))
304 (let ((contents (mm-get-part data))) 304 (let ((contents (mm-get-part data)))
305 (add-text-properties (line-beginning-position) (line-end-position) 305 (add-text-properties (mh-line-beginning-position)
306 '(mh-mime-inserted t)) 306 (mh-line-end-position) '(mh-mime-inserted t))
307 (setq start (point-marker)) 307 (setq start (point-marker))
308 (forward-line 1) 308 (forward-line 1)
309 (mm-insert-inline data contents) 309 (mm-insert-inline data contents)
310 (setq end (point-marker)) 310 (setq end (point-marker))
311 (add-text-properties 311 (add-text-properties
312 start (progn (goto-char start) (line-end-position)) 312 start (progn (goto-char start) (mh-line-end-position))
313 `(mh-region (,start . ,end))))) 313 `(mh-region (,start . ,end)))))
314 ((and data (or inserted-flag displayed-flag)) 314 ((and data (or inserted-flag displayed-flag))
315 (mh-press-button) 315 (mh-press-button)
@@ -746,7 +746,8 @@ buttons for alternative parts that are usually suppressed."
746 (mh-insert-mime-button handle id (mm-handle-displayed-p handle)) 746 (mh-insert-mime-button handle id (mm-handle-displayed-p handle))
747 (goto-char point) 747 (goto-char point)
748 (when region 748 (when region
749 (add-text-properties (line-beginning-position) (line-end-position) 749 (add-text-properties (mh-line-beginning-position)
750 (mh-line-end-position)
750 `(mh-region ,region))))))) 751 `(mh-region ,region)))))))
751 752
752(defun mh-mime-part-index (handle) 753(defun mh-mime-part-index (handle)
@@ -1500,9 +1501,9 @@ This function will quote all such characters."
1500 (goto-char (point-min)) 1501 (goto-char (point-min))
1501 (while (re-search-forward "^#" nil t) 1502 (while (re-search-forward "^#" nil t)
1502 (beginning-of-line) 1503 (beginning-of-line)
1503 (unless (mh-mh-directive-present-p (point) (line-end-position)) 1504 (unless (mh-mh-directive-present-p (point) (mh-line-end-position))
1504 (insert "#")) 1505 (insert "#"))
1505 (goto-char (line-end-position))))) 1506 (goto-char (mh-line-end-position)))))
1506 1507
1507;;;###mh-autoload 1508;;;###mh-autoload
1508(defun mh-mh-to-mime-undo (noconfirm) 1509(defun mh-mh-to-mime-undo (noconfirm)
@@ -1672,7 +1673,8 @@ buffer, while END defaults to the the end of the buffer."
1672 (block 'search-for-mh-directive 1673 (block 'search-for-mh-directive
1673 (goto-char begin) 1674 (goto-char begin)
1674 (while (re-search-forward "^#" end t) 1675 (while (re-search-forward "^#" end t)
1675 (let ((s (buffer-substring-no-properties (point) (line-end-position)))) 1676 (let ((s (buffer-substring-no-properties
1677 (point) (mh-line-end-position))))
1676 (cond ((equal s "")) 1678 (cond ((equal s ""))
1677 ((string-match "^forw[ \t\n]+" s) 1679 ((string-match "^forw[ \t\n]+" s)
1678 (return-from 'search-for-mh-directive t)) 1680 (return-from 'search-for-mh-directive t))
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index 9fc9355a065..b58539c615c 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -51,7 +51,7 @@
51 51
52(require 'gnus-util) 52(require 'gnus-util)
53(require 'imenu) 53(require 'imenu)
54(require 'which-func nil t) 54(mh-require 'which-func nil t)
55 55
56(defvar mh-searcher nil 56(defvar mh-searcher nil
57 "Cached value of chosen search program.") 57 "Cached value of chosen search program.")
@@ -358,12 +358,13 @@ configuration and is used when the search folder is dismissed."
358 (goto-char (point-min)) 358 (goto-char (point-min))
359 (dotimes (i 5) 359 (dotimes (i 5)
360 (add-text-properties (point) (1+ (point)) '(front-sticky t)) 360 (add-text-properties (point) (1+ (point)) '(front-sticky t))
361 (add-text-properties (- (line-end-position) 2) (1- (line-end-position)) 361 (add-text-properties (- (mh-line-end-position) 2)
362 (1- (mh-line-end-position))
362 '(rear-nonsticky t)) 363 '(rear-nonsticky t))
363 (add-text-properties (point) (1- (line-end-position)) '(read-only t)) 364 (add-text-properties (point) (1- (mh-line-end-position)) '(read-only t))
364 (forward-line)) 365 (forward-line))
365 (add-text-properties (point) (1+ (point)) '(front-sticky t)) 366 (add-text-properties (point) (1+ (point)) '(front-sticky t))
366 (add-text-properties (point) (1- (line-end-position)) '(read-only t)) 367 (add-text-properties (point) (1- (mh-line-end-position)) '(read-only t))
367 (goto-char (point-max))) 368 (goto-char (point-max)))
368 369
369;; Sequence Searches 370;; Sequence Searches
@@ -526,9 +527,10 @@ group of results."
526 (cond ((and (bolp) (eolp)) 527 (cond ((and (bolp) (eolp))
527 (ignore-errors (forward-line -1)) 528 (ignore-errors (forward-line -1))
528 (setq msg (mh-get-msg-num t))) 529 (setq msg (mh-get-msg-num t)))
529 ((equal (char-after (line-beginning-position)) ?+) 530 ((equal (char-after (mh-line-beginning-position)) ?+)
530 (setq folder (buffer-substring-no-properties 531 (setq folder (buffer-substring-no-properties
531 (line-beginning-position) (line-end-position)))) 532 (mh-line-beginning-position)
533 (mh-line-end-position))))
532 (t (setq msg (mh-get-msg-num t))))) 534 (t (setq msg (mh-get-msg-num t)))))
533 (when (not folder) 535 (when (not folder)
534 (setq folder (car (gethash (gethash msg mh-index-msg-checksum-map) 536 (setq folder (car (gethash (gethash msg mh-index-msg-checksum-map)
@@ -655,13 +657,13 @@ The cdr of the element is the pattern to search."
655 start begin) 657 start begin)
656 (goto-char (point-min)) 658 (goto-char (point-min))
657 (while (not (eobp)) 659 (while (not (eobp))
658 (if (search-forward "--------" (line-end-position) t) 660 (if (search-forward "--------" (mh-line-end-position) t)
659 (setq in-body-flag t) 661 (setq in-body-flag t)
660 (beginning-of-line) 662 (beginning-of-line)
661 (setq begin (point)) 663 (setq begin (point))
662 (setq start (if in-body-flag 664 (setq start (if in-body-flag
663 (point) 665 (point)
664 (search-forward ":" (line-end-position) t) 666 (search-forward ":" (mh-line-end-position) t)
665 (point))) 667 (point)))
666 (push (cons (and (not in-body-flag) 668 (push (cons (and (not in-body-flag)
667 (intern (downcase 669 (intern (downcase
@@ -669,7 +671,7 @@ The cdr of the element is the pattern to search."
669 begin (1- start))))) 671 begin (1- start)))))
670 (mh-index-parse-search-regexp 672 (mh-index-parse-search-regexp
671 (buffer-substring-no-properties 673 (buffer-substring-no-properties
672 start (line-end-position)))) 674 start (mh-line-end-position))))
673 pattern-list)) 675 pattern-list))
674 (forward-line)) 676 (forward-line))
675 pattern-list))) 677 pattern-list)))
@@ -979,8 +981,8 @@ is used to search."
979 (return nil)) 981 (return nil))
980 (when (equal (char-after (point)) ?#) 982 (when (equal (char-after (point)) ?#)
981 (return 'error)) 983 (return 'error))
982 (let* ((start (search-forward " " (line-end-position) t)) 984 (let* ((start (search-forward " " (mh-line-end-position) t))
983 (end (search-forward " " (line-end-position) t))) 985 (end (search-forward " " (mh-line-end-position) t)))
984 (unless (and start end) 986 (unless (and start end)
985 (return 'error)) 987 (return 'error))
986 (setq end (1- end)) 988 (setq end (1- end))
@@ -1058,7 +1060,7 @@ SEARCH-REGEXP-LIST is used to search."
1058 (return 'error)) 1060 (return 'error))
1059 (let ((start (point)) 1061 (let ((start (point))
1060 end msg-start) 1062 end msg-start)
1061 (setq end (line-end-position)) 1063 (setq end (mh-line-end-position))
1062 (unless (search-forward mh-mairix-folder end t) 1064 (unless (search-forward mh-mairix-folder end t)
1063 (return 'error)) 1065 (return 'error))
1064 (goto-char (match-beginning 0)) 1066 (goto-char (match-beginning 0))
@@ -1191,7 +1193,7 @@ is used to search."
1191 (block nil 1193 (block nil
1192 (when (eobp) (return nil)) 1194 (when (eobp) (return nil))
1193 (let ((file-name (buffer-substring-no-properties 1195 (let ((file-name (buffer-substring-no-properties
1194 (point) (line-end-position)))) 1196 (point) (mh-line-end-position))))
1195 (unless (equal (string-match mh-namazu-folder file-name) 0) 1197 (unless (equal (string-match mh-namazu-folder file-name) 0)
1196 (return 'error)) 1198 (return 'error))
1197 (unless (file-exists-p file-name) 1199 (unless (file-exists-p file-name)
@@ -1239,17 +1241,17 @@ is used to search."
1239 (prog1 1241 (prog1
1240 (block nil 1242 (block nil
1241 (when (eobp) (return nil)) 1243 (when (eobp) (return nil))
1242 (when (search-forward-regexp "^\+" (line-end-position) t) 1244 (when (search-forward-regexp "^\+" (mh-line-end-position) t)
1243 (setq mh-index-pick-folder 1245 (setq mh-index-pick-folder
1244 (buffer-substring-no-properties (line-beginning-position) 1246 (buffer-substring-no-properties (mh-line-beginning-position)
1245 (line-end-position))) 1247 (mh-line-end-position)))
1246 (return 'error)) 1248 (return 'error))
1247 (unless (search-forward-regexp "^[1-9][0-9]*$" (line-end-position) t) 1249 (unless (search-forward-regexp "^[1-9][0-9]*$" (mh-line-end-position) t)
1248 (return 'error)) 1250 (return 'error))
1249 (list mh-index-pick-folder 1251 (list mh-index-pick-folder
1250 (string-to-number 1252 (string-to-number
1251 (buffer-substring-no-properties (line-beginning-position) 1253 (buffer-substring-no-properties (mh-line-beginning-position)
1252 (line-end-position))) 1254 (mh-line-end-position)))
1253 nil)) 1255 nil))
1254 (forward-line))) 1256 (forward-line)))
1255 1257
@@ -1326,8 +1328,8 @@ record is invalid return 'error."
1326 (block nil 1328 (block nil
1327 (when (eobp) 1329 (when (eobp)
1328 (return nil)) 1330 (return nil))
1329 (let ((eol-pos (line-end-position)) 1331 (let ((eol-pos (mh-line-end-position))
1330 (bol-pos (line-beginning-position)) 1332 (bol-pos (mh-line-beginning-position))
1331 folder-start msg-end) 1333 folder-start msg-end)
1332 (goto-char bol-pos) 1334 (goto-char bol-pos)
1333 (unless (search-forward mh-user-path eol-pos t) 1335 (unless (search-forward mh-user-path eol-pos t)
@@ -1423,7 +1425,7 @@ being the list of messages originally from that folder."
1423 (save-excursion 1425 (save-excursion
1424 (beginning-of-line) 1426 (beginning-of-line)
1425 (push (cons (buffer-substring-no-properties 1427 (push (cons (buffer-substring-no-properties
1426 (point) (line-end-position)) 1428 (point) (mh-line-end-position))
1427 (set-marker (make-marker) (point))) 1429 (set-marker (make-marker) (point)))
1428 alist))) 1430 alist)))
1429 (setq imenu--index-alist (nreverse alist))))) 1431 (setq imenu--index-alist (nreverse alist)))))
@@ -1696,7 +1698,8 @@ folder, is removed from `mh-index-data'."
1696 (mh-exec-cmd-output mh-scan-prog nil "-width" "80" 1698 (mh-exec-cmd-output mh-scan-prog nil "-width" "80"
1697 "-format" "%{x-mhe-checksum}\n" folder msg) 1699 "-format" "%{x-mhe-checksum}\n" folder msg)
1698 (goto-char (point-min)) 1700 (goto-char (point-min))
1699 (string-equal (buffer-substring-no-properties (point) (line-end-position)) 1701 (string-equal (buffer-substring-no-properties
1702 (point) (mh-line-end-position))
1700 checksum))) 1703 checksum)))
1701 1704
1702 1705
@@ -1805,8 +1808,8 @@ PROC is used to convert the value to actual data."
1805 1808
1806(defun mh-md5sum-parser () 1809(defun mh-md5sum-parser ()
1807 "Parse md5sum output." 1810 "Parse md5sum output."
1808 (let ((begin (line-beginning-position)) 1811 (let ((begin (mh-line-beginning-position))
1809 (end (line-end-position)) 1812 (end (mh-line-end-position))
1810 first-space last-slash) 1813 first-space last-slash)
1811 (setq first-space (search-forward " " end t)) 1814 (setq first-space (search-forward " " end t))
1812 (goto-char end) 1815 (goto-char end)
@@ -1819,8 +1822,8 @@ PROC is used to convert the value to actual data."
1819 1822
1820(defun mh-openssl-parser () 1823(defun mh-openssl-parser ()
1821 "Parse openssl output." 1824 "Parse openssl output."
1822 (let ((begin (line-beginning-position)) 1825 (let ((begin (mh-line-beginning-position))
1823 (end (line-end-position)) 1826 (end (mh-line-end-position))
1824 last-space last-slash) 1827 last-space last-slash)
1825 (goto-char end) 1828 (goto-char end)
1826 (setq last-space (search-backward " " begin t)) 1829 (setq last-space (search-backward " " begin t))
@@ -1854,7 +1857,7 @@ origin-index) map is updated too."
1854 (let (msg checksum) 1857 (let (msg checksum)
1855 (while (not (eobp)) 1858 (while (not (eobp))
1856 (setq msg (buffer-substring-no-properties 1859 (setq msg (buffer-substring-no-properties
1857 (point) (line-end-position))) 1860 (point) (mh-line-end-position)))
1858 (forward-line) 1861 (forward-line)
1859 (save-excursion 1862 (save-excursion
1860 (cond ((not (string-match "^[0-9]*$" msg))) 1863 (cond ((not (string-match "^[0-9]*$" msg)))
@@ -1865,7 +1868,7 @@ origin-index) map is updated too."
1865 (t 1868 (t
1866 ;; update maps 1869 ;; update maps
1867 (setq checksum (buffer-substring-no-properties 1870 (setq checksum (buffer-substring-no-properties
1868 (point) (line-end-position))) 1871 (point) (mh-line-end-position)))
1869 (let ((msg (string-to-number msg))) 1872 (let ((msg (string-to-number msg)))
1870 (set-buffer folder) 1873 (set-buffer folder)
1871 (mh-index-update-single-msg msg checksum origin-map))))) 1874 (mh-index-update-single-msg msg checksum origin-map)))))
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index cf2027392bd..a5732d00bc6 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -175,7 +175,7 @@ The list appears in a buffer named \"*MH-E Sequences*\"."
175 (insert "\n")) 175 (insert "\n"))
176 (setq seq-list (cdr seq-list))) 176 (setq seq-list (cdr seq-list)))
177 (goto-char (point-min)) 177 (goto-char (point-min))
178 (view-mode-enter) 178 (mh-view-mode-enter)
179 (setq view-exit-action 'kill-buffer) 179 (setq view-exit-action 'kill-buffer)
180 (message "Listing sequences...done"))))) 180 (message "Listing sequences...done")))))
181 181
@@ -749,7 +749,7 @@ completion is over."
749 (goto-char (point-min)) 749 (goto-char (point-min))
750 (multiple-value-bind (folder unseen total) 750 (multiple-value-bind (folder unseen total)
751 (mh-parse-flist-output-line 751 (mh-parse-flist-output-line
752 (buffer-substring (point) (line-end-position))) 752 (buffer-substring (point) (mh-line-end-position)))
753 (values total unseen folder)))) 753 (values total unseen folder))))
754 754
755(defun mh-folder-size-folder (folder) 755(defun mh-folder-size-folder (folder)
@@ -777,7 +777,7 @@ folders whose names end with a '+' character."
777 (when (search-backward " out of " (point-min) t) 777 (when (search-backward " out of " (point-min) t)
778 (setq total (string-to-number 778 (setq total (string-to-number
779 (buffer-substring-no-properties 779 (buffer-substring-no-properties
780 (match-end 0) (line-end-position)))) 780 (match-end 0) (mh-line-end-position))))
781 (when (search-backward " in sequence " (point-min) t) 781 (when (search-backward " in sequence " (point-min) t)
782 (setq p (point)) 782 (setq p (point))
783 (when (search-backward " has " (point-min) t) 783 (when (search-backward " has " (point-min) t)
@@ -955,7 +955,7 @@ font-lock is turned on."
955 ;; the case of user sequences. 955 ;; the case of user sequences.
956 (mh-notate nil nil mh-cmd-note) 956 (mh-notate nil nil mh-cmd-note)
957 (when font-lock-mode 957 (when font-lock-mode
958 (font-lock-fontify-region (point) (line-end-position)))) 958 (font-lock-fontify-region (point) (mh-line-end-position))))
959 (forward-char (+ mh-cmd-note mh-scan-field-destination-offset)) 959 (forward-char (+ mh-cmd-note mh-scan-field-destination-offset))
960 (let ((stack (gethash msg mh-sequence-notation-history))) 960 (let ((stack (gethash msg mh-sequence-notation-history)))
961 (setf (gethash msg mh-sequence-notation-history) 961 (setf (gethash msg mh-sequence-notation-history)
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index f8728edb3e4..ab636ae8ab6 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -878,7 +878,7 @@ See also `mh-folder-mode'.
878(defun mh-show-addr () 878(defun mh-show-addr ()
879 "Use `goto-address'." 879 "Use `goto-address'."
880 (when mh-show-use-goto-addr-flag 880 (when mh-show-use-goto-addr-flag
881 (require 'goto-addr nil t) 881 (mh-require 'goto-addr nil t)
882 (if (fboundp 'goto-address) 882 (if (fboundp 'goto-address)
883 (goto-address)))) 883 (goto-address))))
884 884
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index 00cfd5ef961..ebf34abbd4c 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -69,13 +69,13 @@
69 ["Visit Folder" mh-speed-view 69 ["Visit Folder" mh-speed-view
70 (save-excursion 70 (save-excursion
71 (set-buffer speedbar-buffer) 71 (set-buffer speedbar-buffer)
72 (get-text-property (line-beginning-position) 'mh-folder))] 72 (get-text-property (mh-line-beginning-position) 'mh-folder))]
73 ["Expand Nested Folders" mh-speed-expand-folder 73 ["Expand Nested Folders" mh-speed-expand-folder
74 (and (get-text-property (line-beginning-position) 'mh-children-p) 74 (and (get-text-property (mh-line-beginning-position) 'mh-children-p)
75 (not (get-text-property (line-beginning-position) 'mh-expanded)))] 75 (not (get-text-property (mh-line-beginning-position) 'mh-expanded)))]
76 ["Contract Nested Folders" mh-speed-contract-folder 76 ["Contract Nested Folders" mh-speed-contract-folder
77 (and (get-text-property (line-beginning-position) 'mh-children-p) 77 (and (get-text-property (mh-line-beginning-position) 'mh-children-p)
78 (get-text-property (line-beginning-position) 'mh-expanded))] 78 (get-text-property (mh-line-beginning-position) 'mh-expanded))]
79 ["Refresh Speedbar" mh-speed-refresh t]) 79 ["Refresh Speedbar" mh-speed-refresh t])
80 "Extra menu items for speedbar.") 80 "Extra menu items for speedbar.")
81 81
@@ -157,7 +157,7 @@ The optional ARGS from speedbar are ignored."
157 (forward-line -1) 157 (forward-line -1)
158 (speedbar-change-expand-button-char ?+) 158 (speedbar-change-expand-button-char ?+)
159 (add-text-properties 159 (add-text-properties
160 (line-beginning-position) (1+ (line-beginning-position)) 160 (mh-line-beginning-position) (1+ (line-beginning-position))
161 '(mh-expanded nil))) 161 '(mh-expanded nil)))
162 (t 162 (t
163 (forward-line) 163 (forward-line)
@@ -165,7 +165,7 @@ The optional ARGS from speedbar are ignored."
165 (goto-char point) 165 (goto-char point)
166 (speedbar-change-expand-button-char ?-) 166 (speedbar-change-expand-button-char ?-)
167 (add-text-properties 167 (add-text-properties
168 (line-beginning-position) (1+ (line-beginning-position)) 168 (mh-line-beginning-position) (1+ (line-beginning-position))
169 `(mh-expanded t))))))) 169 `(mh-expanded t)))))))
170 170
171(defun mh-speed-view (&rest args) 171(defun mh-speed-view (&rest args)
@@ -173,7 +173,7 @@ The optional ARGS from speedbar are ignored."
173The optional ARGS from speedbar are ignored." 173The optional ARGS from speedbar are ignored."
174 (interactive) 174 (interactive)
175 (declare (ignore args)) 175 (declare (ignore args))
176 (let* ((folder (get-text-property (line-beginning-position) 'mh-folder)) 176 (let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder))
177 (range (and (stringp folder) 177 (range (and (stringp folder)
178 (mh-read-range "Scan" folder t nil nil 178 (mh-read-range "Scan" folder t nil nil
179 mh-interpret-number-as-range-flag)))) 179 mh-interpret-number-as-range-flag))))
@@ -199,9 +199,9 @@ created."
199 (forward-line -1) 199 (forward-line -1)
200 (setf (gethash nil mh-speed-folder-map) 200 (setf (gethash nil mh-speed-folder-map)
201 (set-marker (or (gethash nil mh-speed-folder-map) (make-marker)) 201 (set-marker (or (gethash nil mh-speed-folder-map) (make-marker))
202 (1+ (line-beginning-position)))) 202 (1+ (mh-line-beginning-position))))
203 (add-text-properties 203 (add-text-properties
204 (line-beginning-position) (1+ (line-beginning-position)) 204 (mh-line-beginning-position) (1+ (line-beginning-position))
205 `(mh-folder nil mh-expanded nil mh-children-p t mh-level 0)) 205 `(mh-folder nil mh-expanded nil mh-children-p t mh-level 0))
206 (mh-speed-stealth-update t) 206 (mh-speed-stealth-update t)
207 (when (> mh-speed-update-interval 0) 207 (when (> mh-speed-update-interval 0)
@@ -268,12 +268,12 @@ The update is always carried out if FORCE is non-nil."
268 (speedbar-with-writable 268 (speedbar-with-writable
269 (goto-char (gethash folder mh-speed-folder-map (point))) 269 (goto-char (gethash folder mh-speed-folder-map (point)))
270 (beginning-of-line) 270 (beginning-of-line)
271 (if (re-search-forward "([1-9][0-9]*/[0-9]+)" (line-end-position) t) 271 (if (re-search-forward "([1-9][0-9]*/[0-9]+)" (mh-line-end-position) t)
272 (setq face (mh-speed-bold-face face)) 272 (setq face (mh-speed-bold-face face))
273 (setq face (mh-speed-normal-face face))) 273 (setq face (mh-speed-normal-face face)))
274 (beginning-of-line) 274 (beginning-of-line)
275 (when (re-search-forward "\\[.\\] " (line-end-position) t) 275 (when (re-search-forward "\\[.\\] " (mh-line-end-position) t)
276 (put-text-property (point) (line-end-position) 'face face))))) 276 (put-text-property (point) (mh-line-end-position) 'face face)))))
277 277
278(defun mh-speed-normal-face (face) 278(defun mh-speed-normal-face (face)
279 "Return normal face for given FACE." 279 "Return normal face for given FACE."
@@ -313,7 +313,7 @@ The function will expand out parent folders of FOLDER if needed."
313 (while suffix-list 313 (while suffix-list
314 ;; We always need atleast one toggle. We need two if the directory list 314 ;; We always need atleast one toggle. We need two if the directory list
315 ;; is stale since a folder was added. 315 ;; is stale since a folder was added.
316 (when (equal prefix (get-text-property (line-beginning-position) 316 (when (equal prefix (get-text-property (mh-line-beginning-position)
317 'mh-folder)) 317 'mh-folder))
318 (mh-speed-toggle) 318 (mh-speed-toggle)
319 (unless (get-text-property (point) 'mh-expanded) 319 (unless (get-text-property (point) 'mh-expanded)
@@ -368,9 +368,9 @@ uses."
368 (setf (gethash folder-name mh-speed-folder-map) 368 (setf (gethash folder-name mh-speed-folder-map)
369 (set-marker (or (gethash folder-name mh-speed-folder-map) 369 (set-marker (or (gethash folder-name mh-speed-folder-map)
370 (make-marker)) 370 (make-marker))
371 (1+ (line-beginning-position)))) 371 (1+ (mh-line-beginning-position))))
372 (add-text-properties 372 (add-text-properties
373 (line-beginning-position) (1+ (line-beginning-position)) 373 (mh-line-beginning-position) (1+ (mh-line-beginning-position))
374 `(mh-folder ,folder-name 374 `(mh-folder ,folder-name
375 mh-expanded nil 375 mh-expanded nil
376 mh-children-p ,(not (not (cdr f))) 376 mh-children-p ,(not (not (cdr f)))
@@ -400,7 +400,7 @@ flists is run only for that one folder."
400 (interactive (list t)) 400 (interactive (list t))
401 (when force 401 (when force
402 (when mh-speed-flists-timer 402 (when mh-speed-flists-timer
403 (cancel-timer mh-speed-flists-timer) 403 (mh-cancel-timer mh-speed-flists-timer)
404 (setq mh-speed-flists-timer nil)) 404 (setq mh-speed-flists-timer nil))
405 (when (and (processp mh-speed-flists-process) 405 (when (and (processp mh-speed-flists-process)
406 (not (eq (process-status mh-speed-flists-process) 'exit))) 406 (not (eq (process-status mh-speed-flists-process) 'exit)))
@@ -471,25 +471,25 @@ be handled next."
471 face) 471 face)
472 (when pos 472 (when pos
473 (goto-char pos) 473 (goto-char pos)
474 (goto-char (line-beginning-position)) 474 (goto-char (mh-line-beginning-position))
475 (cond 475 (cond
476 ((null (get-text-property (point) 'mh-count)) 476 ((null (get-text-property (point) 'mh-count))
477 (goto-char (line-end-position)) 477 (goto-char (mh-line-end-position))
478 (setq face (get-text-property (1- (point)) 'face)) 478 (setq face (get-text-property (1- (point)) 'face))
479 (insert (format " (%s/%s)" unseen total)) 479 (insert (format " (%s/%s)" unseen total))
480 (mh-speed-highlight 'unknown face) 480 (mh-speed-highlight 'unknown face)
481 (goto-char (line-beginning-position)) 481 (goto-char (mh-line-beginning-position))
482 (add-text-properties (point) (1+ (point)) 482 (add-text-properties (point) (1+ (point))
483 `(mh-count (,unseen . ,total)))) 483 `(mh-count (,unseen . ,total))))
484 ((not (equal (get-text-property (point) 'mh-count) 484 ((not (equal (get-text-property (point) 'mh-count)
485 (cons unseen total))) 485 (cons unseen total)))
486 (goto-char (line-end-position)) 486 (goto-char (mh-line-end-position))
487 (setq face (get-text-property (1- (point)) 'face)) 487 (setq face (get-text-property (1- (point)) 'face))
488 (re-search-backward " " (line-beginning-position) t) 488 (re-search-backward " " (mh-line-beginning-position) t)
489 (delete-region (point) (line-end-position)) 489 (delete-region (point) (mh-line-end-position))
490 (insert (format " (%s/%s)" unseen total)) 490 (insert (format " (%s/%s)" unseen total))
491 (mh-speed-highlight 'unknown face) 491 (mh-speed-highlight 'unknown face)
492 (goto-char (line-beginning-position)) 492 (goto-char (mh-line-beginning-position))
493 (add-text-properties 493 (add-text-properties
494 (point) (1+ (point)) 494 (point) (1+ (point))
495 `(mh-count (,unseen . ,total)))))))))))) 495 `(mh-count (,unseen . ,total))))))))))))
@@ -519,15 +519,15 @@ be handled next."
519 (caar parent-kids))) 519 (caar parent-kids)))
520 (setq parent-change ? )))) 520 (setq parent-change ? ))))
521 (goto-char parent-position) 521 (goto-char parent-position)
522 (when (equal (get-text-property (line-beginning-position) 'mh-folder) 522 (when (equal (get-text-property (mh-line-beginning-position) 'mh-folder)
523 parent) 523 parent)
524 (when (get-text-property (line-beginning-position) 'mh-expanded) 524 (when (get-text-property (mh-line-beginning-position) 'mh-expanded)
525 (mh-speed-toggle)) 525 (mh-speed-toggle))
526 (when parent-change 526 (when parent-change
527 (speedbar-with-writable 527 (speedbar-with-writable
528 (mh-speedbar-change-expand-button-char parent-change) 528 (mh-speedbar-change-expand-button-char parent-change)
529 (add-text-properties 529 (add-text-properties
530 (line-beginning-position) (1+ (line-beginning-position)) 530 (mh-line-beginning-position) (1+ (mh-line-beginning-position))
531 `(mh-children-p ,(equal parent-change ?+))))) 531 `(mh-children-p ,(equal parent-change ?+)))))
532 (mh-speed-highlight mh-speed-last-selected-folder 'mh-speedbar-folder) 532 (mh-speed-highlight mh-speed-last-selected-folder 'mh-speedbar-folder)
533 (setq mh-speed-last-selected-folder nil) 533 (setq mh-speed-last-selected-folder nil)
@@ -541,7 +541,7 @@ be handled next."
541 "Change the expansion button character to CHAR for the current line." 541 "Change the expansion button character to CHAR for the current line."
542 (save-excursion 542 (save-excursion
543 (beginning-of-line) 543 (beginning-of-line)
544 (if (re-search-forward "\\[.\\]" (line-end-position) t) 544 (if (re-search-forward "\\[.\\]" (mh-line-end-position) t)
545 (speedbar-with-writable 545 (speedbar-with-writable
546 (backward-char 2) 546 (backward-char 2)
547 (delete-char 1) 547 (delete-char 1)
@@ -573,9 +573,9 @@ The function invalidates the latest ancestor that is present."
573 (speedbar-with-writable 573 (speedbar-with-writable
574 (mh-speedbar-change-expand-button-char ?+) 574 (mh-speedbar-change-expand-button-char ?+)
575 (add-text-properties 575 (add-text-properties
576 (line-beginning-position) (1+ (line-beginning-position)) 576 (mh-line-beginning-position) (1+ (mh-line-beginning-position))
577 `(mh-children-p t))) 577 `(mh-children-p t)))
578 (when (get-text-property (line-beginning-position) 'mh-expanded) 578 (when (get-text-property (mh-line-beginning-position) 'mh-expanded)
579 (mh-speed-toggle)) 579 (mh-speed-toggle))
580 (setq mh-speed-refresh-flag t)))) 580 (setq mh-speed-refresh-flag t))))
581 581
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index fa9719985a9..0686b10ac26 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -296,7 +296,7 @@ at the end."
296 (while (not (eobp)) 296 (while (not (eobp))
297 (forward-char address-start-offset) 297 (forward-char address-start-offset)
298 (unless (equal (string-match spaces (buffer-substring-no-properties 298 (unless (equal (string-match spaces (buffer-substring-no-properties
299 (point) (line-end-position))) 299 (point) (mh-line-end-position)))
300 0) 300 0)
301 (beginning-of-line) 301 (beginning-of-line)
302 (backward-char) 302 (backward-char)
@@ -456,9 +456,9 @@ are the same containers."
456If optional argument STRING is given then that is assumed to be 456If optional argument STRING is given then that is assumed to be
457the scan line. Otherwise uses the line at point as the scan line 457the scan line. Otherwise uses the line at point as the scan line
458to parse." 458to parse."
459 (let* ((string (or string 459 (let* ((string (or string (buffer-substring-no-properties
460 (buffer-substring-no-properties (line-beginning-position) 460 (mh-line-beginning-position)
461 (line-end-position)))) 461 (mh-line-end-position))))
462 (address-start (+ mh-cmd-note mh-scan-field-from-start-offset)) 462 (address-start (+ mh-cmd-note mh-scan-field-from-start-offset))
463 (body-start (+ mh-cmd-note mh-scan-field-from-end-offset)) 463 (body-start (+ mh-cmd-note mh-scan-field-from-end-offset))
464 (first-string (substring string 0 address-start))) 464 (first-string (substring string 0 address-start)))
@@ -599,18 +599,20 @@ Only information about messages in MSG-LIST are added to the tree."
599 (while (not (eobp)) 599 (while (not (eobp))
600 (block process-message 600 (block process-message
601 (let* ((index-line 601 (let* ((index-line
602 (prog1 (buffer-substring (point) (line-end-position)) 602 (prog1 (buffer-substring (point) (mh-line-end-position))
603 (forward-line))) 603 (forward-line)))
604 (index (string-to-number index-line)) 604 (index (string-to-number index-line))
605 (id (prog1 (buffer-substring (point) (line-end-position)) 605 (id (prog1 (buffer-substring (point) (mh-line-end-position))
606 (forward-line))) 606 (forward-line)))
607 (refs (prog1 (buffer-substring (point) (line-end-position)) 607 (refs (prog1
608 (buffer-substring (point) (mh-line-end-position))
608 (forward-line))) 609 (forward-line)))
609 (in-reply-to (prog1 (buffer-substring (point) 610 (in-reply-to (prog1 (buffer-substring (point)
610 (line-end-position)) 611 (mh-line-end-position))
611 (forward-line))) 612 (forward-line)))
612 (subject (prog1 613 (subject (prog1
613 (buffer-substring (point) (line-end-position)) 614 (buffer-substring
615 (point) (mh-line-end-position))
614 (forward-line))) 616 (forward-line)))
615 (subject-re-p nil)) 617 (subject-re-p nil))
616 (unless (gethash index mh-thread-scan-line-map) 618 (unless (gethash index mh-thread-scan-line-map)
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index b34ff8ee5b6..e948860058f 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -68,7 +68,7 @@ used in lieu of `search' in the CL package."
68(defun mh-colors-available-p () 68(defun mh-colors-available-p ()
69 "Check if colors are available in the Emacs being used." 69 "Check if colors are available in the Emacs being used."
70 (or mh-xemacs-flag 70 (or mh-xemacs-flag
71 (let ((color-cells (display-color-cells))) 71 (let ((color-cells (mh-display-color-cells)))
72 (and (numberp color-cells) (>= color-cells 8))))) 72 (and (numberp color-cells) (>= color-cells 8)))))
73 73
74;;;###mh-autoload 74;;;###mh-autoload
@@ -502,8 +502,8 @@ not be returned."
502 ;; top-level folders; otherwise mh-sub-folders returns all the 502 ;; top-level folders; otherwise mh-sub-folders returns all the
503 ;; files in / if given an empty string or +. 503 ;; files in / if given an empty string or +.
504 (when folder 504 (when folder
505 (setq folder (replace-regexp-in-string "^\+" "" folder)) 505 (setq folder (mh-replace-regexp-in-string "^\+" "" folder))
506 (setq folder (replace-regexp-in-string "/*$" "/" folder)) 506 (setq folder (mh-replace-regexp-in-string "/*$" "/" folder))
507 (if (equal folder "") 507 (if (equal folder "")
508 (setq folder nil))) 508 (setq folder nil)))
509 (loop for f in (mh-sub-folders folder) do 509 (loop for f in (mh-sub-folders folder) do
@@ -553,9 +553,10 @@ directories that aren't usually mail folders are hidden."
553 (apply #'call-process arg-list) 553 (apply #'call-process arg-list)
554 (goto-char (point-min)) 554 (goto-char (point-min))
555 (while (not (and (eolp) (bolp))) 555 (while (not (and (eolp) (bolp)))
556 (goto-char (line-end-position)) 556 (goto-char (mh-line-end-position))
557 (let ((start-pos (line-beginning-position)) 557 (let ((start-pos (mh-line-beginning-position))
558 (has-pos (search-backward " has " (line-beginning-position) t))) 558 (has-pos (search-backward " has "
559 (mh-line-beginning-position) t)))
559 (when (integerp has-pos) 560 (when (integerp has-pos)
560 (while (equal (char-after has-pos) ? ) 561 (while (equal (char-after has-pos) ? )
561 (decf has-pos)) 562 (decf has-pos))
@@ -570,7 +571,7 @@ directories that aren't usually mail folders are hidden."
570 (setq name (substring name 0 (1- (length name))))) 571 (setq name (substring name 0 (1- (length name)))))
571 (push 572 (push
572 (cons name 573 (cons name
573 (search-forward "(others)" (line-end-position) t)) 574 (search-forward "(others)" (mh-line-end-position) t))
574 results)))) 575 results))))
575 (forward-line 1)))) 576 (forward-line 1))))
576 (setq results (nreverse results)) 577 (setq results (nreverse results))
@@ -927,10 +928,12 @@ is hidden, if positive then the field is displayed."
927 (unwind-protect 928 (unwind-protect
928 (cond ((or (and (not arg) 929 (cond ((or (and (not arg)
929 (text-property-any begin end 'invisible 'vanish)) 930 (text-property-any begin end 'invisible 'vanish))
930 (and (numberp arg) (>= arg 0)) 931 (and (numberp arg)
931 (and (eq arg 'long) (> (line-beginning-position 5) end))) 932 (>= arg 0))
933 (and (eq arg 'long)
934 (> (mh-line-beginning-position 5) end)))
932 (remove-text-properties begin end '(invisible nil)) 935 (remove-text-properties begin end '(invisible nil))
933 (search-forward ":" (line-end-position) t) 936 (search-forward ":" (mh-line-end-position) t)
934 (mh-letter-skip-leading-whitespace-in-header-field)) 937 (mh-letter-skip-leading-whitespace-in-header-field))
935 ;; XXX Redesign to make usable by user. Perhaps use a positive 938 ;; XXX Redesign to make usable by user. Perhaps use a positive
936 ;; numeric prefix to make that many lines visible. 939 ;; numeric prefix to make that many lines visible.