summaryrefslogtreecommitdiff
path: root/lisp/mh-e/mh-search.el
diff options
context:
space:
mode:
authorBill Wohler <wohler@newt.com>2006-02-01 23:24:34 +0000
committerBill Wohler <wohler@newt.com>2006-02-01 23:24:34 +0000
commitd5dc8c56355ef34ef00a46b487092ee7ee8fa61b (patch)
tree08f9336d93983b4f3479773bbe4f5537c12c91b4 /lisp/mh-e/mh-search.el
parent05227fbee3ee5d14b6c0ba5ed196af471bc9d1ac (diff)
downloademacs-d5dc8c56355ef34ef00a46b487092ee7ee8fa61b.tar.gz
* 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/mh-search.el')
-rw-r--r--lisp/mh-e/mh-search.el61
1 files changed, 32 insertions, 29 deletions
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 @@
(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)
(goto-char (point-min))
- (string-equal (buffer-substring-no-properties (point) (line-end-position))
+ (string-equal (buffer-substring-no-properties
+ (point) (mh-line-end-position))
checksum)))
@@ -1805,8 +1808,8 @@ PROC is used to convert the value to actual data."
(defun mh-md5sum-parser ()
"Parse md5sum output."
- (let ((begin (line-beginning-position))
- (end (line-end-position))
+ (let ((begin (mh-line-beginning-position))
+ (end (mh-line-end-position))
first-space last-slash)
(setq first-space (search-forward " " end t))
(goto-char end)
@@ -1819,8 +1822,8 @@ PROC is used to convert the value to actual data."
(defun mh-openssl-parser ()
"Parse openssl output."
- (let ((begin (line-beginning-position))
- (end (line-end-position))
+ (let ((begin (mh-line-beginning-position))
+ (end (mh-line-end-position))
last-space last-slash)
(goto-char end)
(setq last-space (search-backward " " begin t))
@@ -1854,7 +1857,7 @@ origin-index) map is updated too."
(let (msg checksum)
(while (not (eobp))
(setq msg (buffer-substring-no-properties
- (point) (line-end-position)))
+ (point) (mh-line-end-position)))
(forward-line)
(save-excursion
(cond ((not (string-match "^[0-9]*$" msg)))
@@ -1865,7 +1868,7 @@ origin-index) map is updated too."
(t
;; update maps
(setq checksum (buffer-substring-no-properties
- (point) (line-end-position)))
+ (point) (mh-line-end-position)))
(let ((msg (string-to-number msg)))
(set-buffer folder)
(mh-index-update-single-msg msg checksum origin-map)))))