Commit d5dc8c56 authored by Bill Wohler's avatar Bill Wohler

* 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.
parent 05227fbe
2006-02-01 Bill Wohler <wohler@newt.com>
* 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.
2006-01-31 Bill Wohler <wohler@newt.com>
* mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name
argument 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. Use explicit argument
instead of forming name by adding mh-e prefix so that one can grep
instead of forming name by adding mh- prefix so that one can grep
and find the definition.
* mh-alias.el (mh-alias-local-users, mh-alias-reload)
......
......@@ -125,10 +125,10 @@ COMMA-SEPARATOR is non-nil."
(setq res (match-string 1 res)))
;; Replace "&" with capitalized username
(if (string-match "&" res)
(setq res (replace-regexp-in-string "&" (capitalize username) res)))
(setq res (mh-replace-regexp-in-string "&" (capitalize username) res)))
;; Remove " character
(if (string-match "\"" res)
(setq res (replace-regexp-in-string "\"" "" res)))
(setq res (mh-replace-regexp-in-string "\"" "" res)))
;; If empty string, use username instead
(if (string-equal "" res)
(setq res username))
......@@ -258,8 +258,8 @@ Blind aliases or users from /etc/passwd are not expanded."
(t
(mh-alias-ali alias))))
(require 'crm nil t) ; completing-read-multiple
(require 'multi-prompt nil t)
(mh-require 'crm nil t) ; completing-read-multiple
(mh-require 'multi-prompt nil t)
;;;###mh-autoload
(defun mh-read-address (prompt)
......@@ -606,12 +606,12 @@ filing messages."
Then search backwards to beginning of line for the start of an
e-mail address. If no e-mail address found, return nil."
(re-search-backward "[^-_A-z0-9.@]" (line-beginning-position) 'lim)
(re-search-backward "[^-_A-z0-9.@]" (mh-line-beginning-position) 'lim)
(if (or (looking-at mh-address-mail-regexp) ; already at start
(and (re-search-forward mh-address-mail-regexp
(line-end-position) 'lim)
(mh-line-end-position) 'lim)
(goto-char (match-beginning 0))))
(match-string-no-properties 0)))
(mh-match-string-no-properties 0)))
(defun mh-alias-apropos (regexp)
"Show all aliases or addresses that match a regular expression REGEXP."
......
......@@ -1031,7 +1031,7 @@ discarded."
(cond ((and overwrite-flag
(mh-goto-header-field (concat field ":")))
(insert " " value)
(delete-region (point) (line-end-position)))
(delete-region (point) (mh-line-end-position)))
((and (not overwrite-flag)
(mh-regexp-in-field-p (concat "\\b" value "\\b") field))
;; Already there, do nothing.
......
......@@ -37,31 +37,60 @@
;; macros we can retire.
;; Please use mh-gnus.el when providing compatibility with different
;; versions of Gnus and mh-xemacs.el for compatibility with XEmacs.
;; versions of Gnus.
;; Items are listed alphabetically.
;; Items are listed alphabetically (except for mh-require which is
;; needed by a lesser character).
(require 'mh-acros)
(mh-do-in-gnu-emacs
(defalias 'mh-require 'require))
(mh-do-in-xemacs
(defun mh-require (feature &optional filename noerror)
"If feature FEATURE is not loaded, load it from FILENAME.
If FEATURE is not a member of the list `features', then the feature
is not loaded; so load the file FILENAME.
If FILENAME is omitted, the printname of FEATURE is used as the file name.
If the optional third argument NOERROR is non-nil,
then return nil if the file is not found instead of signaling an error.
Simulate NOERROR argument in XEmacs which lacks it."
(if (not (featurep feature))
(if filename
(load filename noerror t)
(load (format "%s" feature) noerror t)))))
(mh-defun-compat mh-assoc-string assoc-string (key list case-fold)
"Like `assoc' but specifically for strings.
Case is ignored if CASE-FOLD is non-nil.
This function added by MH-E for Emacs versions that lack
`assoc-string', introduced in Emacs 22."
This function is used by Emacs versions that lack `assoc-string',
introduced in Emacs 22."
(if case-fold
(assoc-ignore-case key list)
(assoc key list)))
(require 'mailabbrev nil t)
(mh-defun-compat mh-mail-abbrev-make-syntax-table
mail-abbrev-make-syntax-table ()
"Emacs 21 and XEmacs don't have this function."
nil)
;; For XEmacs.
(defalias 'mh-cancel-timer
(if (fboundp 'cancel-timer)
'cancel-timer
'delete-itimer))
(mh-defun-compat mh-display-color-cells display-color-cells (&optional display)
"Return the number of color cells supported by DISPLAY.
This function is used by XEmacs to always return 0 when compiling
to avoid compiling errors. Otherwise uses `device-color-cells'."
(if mh-compiling-flag
0
(device-color-cells display)))
(defmacro mh-display-completion-list (completions &optional common-substring)
"Display the list of COMPLETIONS.
See documentation for `display-completion-list' for a description of the
arguments COMPLETIONS and perhaps COMMON-SUBSTRING.
This macro added by MH-E for Emacs versions that lack a
COMMON-SUBSTRING argument, introduced in Emacs 22."
This macro is used by Emacs versions that lack a COMMON-SUBSTRING
argument, introduced in Emacs 22."
(if (< emacs-major-version 22)
`(display-completion-list ,completions)
`(display-completion-list ,completions ,common-substring)))
......@@ -70,8 +99,8 @@ COMMON-SUBSTRING argument, introduced in Emacs 22."
"Return the foreground color name of FACE, or nil if unspecified.
See documentation for `face-foreground' for a description of the
arguments FACE, FRAME, and perhaps INHERIT.
This macro added by MH-E for Emacs versions that lack an INHERIT
argument, introduced in Emacs 22."
This macro is used by Emacs versions that lack an INHERIT argument,
introduced in Emacs 22."
(if (< emacs-major-version 22)
`(face-foreground ,face ,frame)
`(face-foreground ,face ,frame ,inherit)))
......@@ -80,12 +109,48 @@ argument, introduced in Emacs 22."
"Return the background color name of face, or nil if unspecified.
See documentation for `back-foreground' for a description of the
arguments FACE, FRAME, and INHERIT.
This macro added by MH-E for Emacs versions that lack an INHERIT
argument, introduced in Emacs 22."
This macro is used by Emacs versions that lack an INHERIT argument,
introduced in Emacs 22."
(if (< emacs-major-version 22)
`(face-background ,face ,frame)
`(face-background ,face ,frame ,inherit)))
;; For XEmacs.
(defalias 'mh-line-beginning-position
(if (fboundp 'line-beginning-position)
'line-beginning-position
'point-at-bol))
;; For XEmacs.
(defalias 'mh-line-end-position
(if (fboundp 'line-end-position)
'line-end-position
'point-at-eol))
(mh-require 'mailabbrev nil t)
(mh-defun-compat mh-mail-abbrev-make-syntax-table
mail-abbrev-make-syntax-table ()
"Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
This function does nothing on those systems."
nil)
(mh-defun-compat mh-match-string-no-properties
match-string-no-properties (num &optional string)
"Return string of text matched by last search, without text properties.
This function is used by XEmacs that lacks `match-string-no-properties'.
The function `buffer-substring-no-properties' is used instead.
The argument STRING is ignored."
(buffer-substring-no-properties
(match-beginning num) (match-end num)))
(mh-defun-compat mh-replace-regexp-in-string replace-regexp-in-string
(rep string &optional fixedcase literal subexp start)
"Replace REGEXP with REP everywhere in STRING and return result.
This function is used by XEmacs that lacks `replace-regexp-in-string'.
The function `replace-in-string' is used instead.
The arguments FIXEDCASE, LITERAL, SUBEXP, and START are ignored."
(replace-in-string string regexp rep))
;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21.
(if (not (boundp 'url-unreserved-chars))
(defconst mh-url-unresrved-chars
......@@ -111,6 +176,17 @@ This is a copy of `url-hexify-string' from url-util.el in Emacs
(char-to-string char)))
str ""))
(mh-defun-compat mh-view-mode-enter
view-mode-enter (&optional return-to exit-action)
"Enter View mode.
This function is used by XEmacs that lacks `view-mode-enter'.
The function `view-mode' is used instead.
The arguments RETURN-TO and EXIT-ACTION are ignored."
;; Shush compiler.
(if return-to nil)
(if exit-action nil)
(view-mode 1))
(defmacro mh-write-file-functions ()
"Return `write-file-functions' if it exists.
Otherwise return `local-write-file-hooks'.
......
......@@ -101,7 +101,13 @@
(eval-and-compile
(defvar mh-xemacs-flag (featurep 'xemacs)
"Non-nil means the current Emacs is XEmacs."))
"Non-nil means the current Emacs is XEmacs.")
(defvar mh-compiling-flag nil
"Non-nil means we're compiling."))
(eval-when (compile)
(setq mh-compiling-flag t))
(mh-do-in-xemacs
(require 'mh-xemacs))
......@@ -464,7 +470,8 @@ all the strings have been used."
(let ((arg-list (reverse args))
(count 0))
(while (and (not (eobp)) (< count mh-index-max-cmdline-args))
(push (buffer-substring-no-properties (point) (line-end-position))
(push (buffer-substring-no-properties (point)
(mh-line-end-position))
arg-list)
(incf count)
(forward-line))
......@@ -2970,7 +2977,7 @@ entirely if the display does not support the number of specified
colors."
(if mh-min-colors-defined-flag
spec
(let ((cells (display-color-cells))
(let ((cells (mh-display-color-cells))
new-spec)
;; Remove entries with min-colors, or delete them if we have fewer colors
;; than they specify.
......
......@@ -516,7 +516,7 @@ font-lock is done highlighting.")
(cons (current-buffer) nil)))))
;; Register mh-folder-mode as supporting which-function-mode...
(require 'which-func nil t)
(mh-require 'which-func nil t)
(when (boundp 'which-func-modes)
(add-to-list 'which-func-modes 'mh-folder-mode))
......
......@@ -154,7 +154,7 @@ Display the results only if something went wrong."
"-recurse"
"-norecurse"))
(goto-char (point-min))
(view-mode-enter)
(mh-view-mode-enter)
(setq view-exit-action 'kill-buffer)
(message "Listing folders...done")))))
......
......@@ -32,11 +32,11 @@
(require 'mh-e)
(require 'gnus-util nil t)
(require 'mm-bodies nil t)
(require 'mm-decode nil t)
(require 'mm-view nil t)
(require 'mml nil t)
(mh-require 'gnus-util nil t)
(mh-require 'mm-bodies nil t)
(mh-require 'mm-decode nil t)
(mh-require 'mm-view nil t)
(mh-require 'mml nil t)
;; Copy of function from gnus-util.el.
(mh-defun-compat mh-gnus-local-map-property gnus-local-map-property (map)
......
......@@ -267,7 +267,7 @@ searching for `mh-mail-header-separator' in the buffer."
(goto-char (point-min))
(cond ((equal mh-mail-header-separator "") (point-min))
((search-forward (format "\n%s\n" mh-mail-header-separator) nil t)
(line-beginning-position 0))
(mh-line-beginning-position 0))
(t (point-min)))))
......@@ -319,7 +319,7 @@ order).
(set (make-local-variable 'mh-mail-header-separator)
(save-excursion
(goto-char (mh-mail-header-end))
(buffer-substring-no-properties (point) (line-end-position))))
(buffer-substring-no-properties (point) (mh-line-end-position))))
(make-local-variable 'mail-header-separator)
(setq mail-header-separator mh-mail-header-separator) ;override sendmail.el
(mh-set-help mh-letter-mode-help-messages)
......@@ -828,7 +828,7 @@ body."
((< (point) (progn
(beginning-of-line)
(re-search-forward mh-letter-header-field-regexp
(line-end-position) t)
(mh-line-end-position) t)
(point)))
(beginning-of-line))
(t (end-of-line)))
......
......@@ -211,7 +211,7 @@ Return number of messages put in the sequence:
(string-equal "" (match-string 3)))
(progn (message "No subject line")
nil)
(let ((subject (match-string-no-properties 3))
(let ((subject (mh-match-string-no-properties 3))
(list))
(if (> (length subject) mh-limit-max-subject-size)
(setq subject (substring subject 0 mh-limit-max-subject-size)))
......@@ -219,7 +219,7 @@ Return number of messages put in the sequence:
(if all
(goto-char (point-min)))
(while (re-search-forward mh-scan-subject-regexp nil t)
(let ((this-subject (match-string-no-properties 3)))
(let ((this-subject (mh-match-string-no-properties 3)))
(if (> (length this-subject) mh-limit-max-subject-size)
(setq this-subject (substring this-subject
0 mh-limit-max-subject-size)))
......@@ -310,7 +310,7 @@ The MH command pick is used to do the match."
(while (not (eobp))
(let ((num (ignore-errors
(string-to-number
(buffer-substring (point) (line-end-position))))))
(buffer-substring (point) (mh-line-end-position))))))
(when num (push num msg-list))
(forward-line))))
(if (null msg-list)
......
......@@ -302,14 +302,14 @@ the attachment labeled with that number."
start end)
(cond ((and data (not inserted-flag) (not displayed-flag))
(let ((contents (mm-get-part data)))
(add-text-properties (line-beginning-position) (line-end-position)
'(mh-mime-inserted t))
(add-text-properties (mh-line-beginning-position)
(mh-line-end-position) '(mh-mime-inserted t))
(setq start (point-marker))
(forward-line 1)
(mm-insert-inline data contents)
(setq end (point-marker))
(add-text-properties
start (progn (goto-char start) (line-end-position))
start (progn (goto-char start) (mh-line-end-position))
`(mh-region (,start . ,end)))))
((and data (or inserted-flag displayed-flag))
(mh-press-button)
......@@ -746,7 +746,8 @@ buttons for alternative parts that are usually suppressed."
(mh-insert-mime-button handle id (mm-handle-displayed-p handle))
(goto-char point)
(when region
(add-text-properties (line-beginning-position) (line-end-position)
(add-text-properties (mh-line-beginning-position)
(mh-line-end-position)
`(mh-region ,region)))))))
(defun mh-mime-part-index (handle)
......@@ -1500,9 +1501,9 @@ This function will quote all such characters."
(goto-char (point-min))
(while (re-search-forward "^#" nil t)
(beginning-of-line)
(unless (mh-mh-directive-present-p (point) (line-end-position))
(unless (mh-mh-directive-present-p (point) (mh-line-end-position))
(insert "#"))
(goto-char (line-end-position)))))
(goto-char (mh-line-end-position)))))
;;;###mh-autoload
(defun mh-mh-to-mime-undo (noconfirm)
......@@ -1672,7 +1673,8 @@ buffer, while END defaults to the the end of the buffer."
(block 'search-for-mh-directive
(goto-char begin)
(while (re-search-forward "^#" end t)
(let ((s (buffer-substring-no-properties (point) (line-end-position))))
(let ((s (buffer-substring-no-properties
(point) (mh-line-end-position))))
(cond ((equal s ""))
((string-match "^forw[ \t\n]+" s)
(return-from 'search-for-mh-directive t))
......
......@@ -51,7 +51,7 @@
(require 'gnus-util)
(require 'imenu)
(require 'which-func nil t)
(mh-require 'which-func nil t)
(defvar mh-searcher nil
"Cached value of chosen search program.")
......@@ -358,12 +358,13 @@ configuration and is used when the search folder is dismissed."
(goto-char (point-min))
(dotimes (i 5)
(add-text-properties (point) (1+ (point)) '(front-sticky t))
(add-text-properties (- (line-end-position) 2) (1- (line-end-position))
(add-text-properties (- (mh-line-end-position) 2)
(1- (mh-line-end-position))
'(rear-nonsticky t))
(add-text-properties (point) (1- (line-end-position)) '(read-only t))
(add-text-properties (point) (1- (mh-line-end-position)) '(read-only t))
(forward-line))
(add-text-properties (point) (1+ (point)) '(front-sticky t))
(add-text-properties (point) (1- (line-end-position)) '(read-only t))
(add-text-properties (point) (1- (mh-line-end-position)) '(read-only t))
(goto-char (point-max)))
;; Sequence Searches
......@@ -526,9 +527,10 @@ group of results."
(cond ((and (bolp) (eolp))
(ignore-errors (forward-line -1))
(setq msg (mh-get-msg-num t)))
((equal (char-after (line-beginning-position)) ?+)
((equal (char-after (mh-line-beginning-position)) ?+)
(setq folder (buffer-substring-no-properties
(line-beginning-position) (line-end-position))))
(mh-line-beginning-position)
(mh-line-end-position))))
(t (setq msg (mh-get-msg-num t)))))
(when (not folder)
(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."
start begin)
(goto-char (point-min))
(while (not (eobp))
(if (search-forward "--------" (line-end-position) t)
(if (search-forward "--------" (mh-line-end-position) t)
(setq in-body-flag t)
(beginning-of-line)
(setq begin (point))
(setq start (if in-body-flag
(point)
(search-forward ":" (line-end-position) t)
(search-forward ":" (mh-line-end-position) t)
(point)))
(push (cons (and (not in-body-flag)
(intern (downcase
......@@ -669,7 +671,7 @@ The cdr of the element is the pattern to search."
begin (1- start)))))
(mh-index-parse-search-regexp
(buffer-substring-no-properties
start (line-end-position))))
start (mh-line-end-position))))
pattern-list))
(forward-line))
pattern-list)))
......@@ -979,8 +981,8 @@ is used to search."
(return nil))
(when (equal (char-after (point)) ?#)
(return 'error))
(let* ((start (search-forward " " (line-end-position) t))
(end (search-forward " " (line-end-position) t)))
(let* ((start (search-forward " " (mh-line-end-position) t))
(end (search-forward " " (mh-line-end-position) t)))
(unless (and start end)
(return 'error))
(setq end (1- end))
......@@ -1058,7 +1060,7 @@ SEARCH-REGEXP-LIST is used to search."
(return 'error))
(let ((start (point))
end msg-start)
(setq end (line-end-position))
(setq end (mh-line-end-position))
(unless (search-forward mh-mairix-folder end t)
(return 'error))
(goto-char (match-beginning 0))
......@@ -1191,7 +1193,7 @@ is used to search."
(block nil
(when (eobp) (return nil))
(let ((file-name (buffer-substring-no-properties
(point) (line-end-position))))
(point) (mh-line-end-position))))
(unless (equal (string-match mh-namazu-folder file-name) 0)
(return 'error))
(unless (file-exists-p file-name)
......@@ -1239,17 +1241,17 @@ is used to search."
(prog1
(block nil
(when (eobp) (return nil))
(when (search-forward-regexp "^\+" (line-end-position) t)
(when (search-forward-regexp "^\+" (mh-line-end-position) t)
(setq mh-index-pick-folder
(buffer-substring-no-properties (line-beginning-position)
(line-end-position)))
(buffer-substring-no-properties (mh-line-beginning-position)
(mh-line-end-position)))
(return 'error))
(unless (search-forward-regexp "^[1-9][0-9]*$" (line-end-position) t)
(unless (search-forward-regexp "^[1-9][0-9]*$" (mh-line-end-position) t)
(return 'error))
(list mh-index-pick-folder
(string-to-number
(buffer-substring-no-properties (line-beginning-position)
(line-end-position)))
(buffer-substring-no-properties (mh-line-beginning-position)
(mh-line-end-position)))
nil))
(forward-line)))
......@@ -1326,8 +1328,8 @@ record is invalid return 'error."
(block nil
(when (eobp)
(return nil))
(let ((eol-pos (line-end-position))
(bol-pos (line-beginning-position))
(let ((eol-pos (mh-line-end-position))
(bol-pos (mh-line-beginning-position))
folder-start msg-end)
(goto-char bol-pos)
(unless (search-forward mh-user-path eol-pos t)
......@@ -1423,7 +1425,7 @@ being the list of messages originally from that folder."
(save-excursion
(beginning-of-line)
(push (cons (buffer-substring-no-properties
(point) (line-end-position))
(point) (mh-line-end-position))
(set-marker (make-marker) (point)))
alist)))
(setq imenu--index-alist (nreverse alist)))))
......@@ -1696,7 +1698,8 @@ folder, is removed from `mh-index-data'."
(mh-exec-cmd-output mh-scan-prog nil "-width" "80"
"-format" "%{x-mhe-checksum}\n" folder msg)