aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mh-e/ChangeLog9
-rw-r--r--lisp/mh-e/mh-limit.el12
-rw-r--r--lisp/mh-e/mh-utils.el17
3 files changed, 34 insertions, 4 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 36a02532455..b94c2522477 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,5 +1,11 @@
12006-02-28 Bill Wohler <wohler@newt.com> 12006-02-28 Bill Wohler <wohler@newt.com>
2 2
3 * mh-limit.el (mh-narrow-to-cc, mh-narrow-to-from)
4 (mh-narrow-to-subject, mh-narrow-to-to): Fix inability to narrow
5 to subjects with special characters by quoting regular expression
6 characters in pick expression derived from existing subjects and
7 other fields (closes SF #1432548).
8
3 * mh-utils.el (mh-image-load-path): Rename variable to 9 * mh-utils.el (mh-image-load-path): Rename variable to
4 mh-image-directory. 10 mh-image-directory.
5 (mh-image-load-path): Access mh-image-directory instead of 11 (mh-image-load-path): Access mh-image-directory instead of
@@ -9,6 +15,9 @@
9 the entire filesystem (or infinite loop). Don't append slash to 15 the entire filesystem (or infinite loop). Don't append slash to
10 folder. These fixes fix problems observed with the pick search. 16 folder. These fixes fix problems observed with the pick search.
11 Thanks to Thomas Baumann for the help (closes SF #1435381). 17 Thanks to Thomas Baumann for the help (closes SF #1435381).
18 (mh-pick-regexp-chars, mh-quote-pick-expr): New variable and
19 function for quoting pick regular expression characters (closes SF
20 #1432548).
12 21
132006-02-27 Bill Wohler <wohler@newt.com> 222006-02-27 Bill Wohler <wohler@newt.com>
14 23
diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el
index 7a90b890cad..f2609263b91 100644
--- a/lisp/mh-e/mh-limit.el
+++ b/lisp/mh-e/mh-limit.el
@@ -89,7 +89,8 @@ With a prefix argument, edit PICK-EXPR.
89 89
90Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." 90Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
91 (interactive 91 (interactive
92 (list (mh-edit-pick-expr (mh-current-message-header-field 'cc)))) 92 (list (mh-edit-pick-expr
93 (mh-quote-pick-expr (mh-current-message-header-field 'cc)))))
93 (mh-narrow-to-header-field 'cc pick-expr)) 94 (mh-narrow-to-header-field 'cc pick-expr))
94 95
95;;;###mh-autoload 96;;;###mh-autoload
@@ -99,7 +100,8 @@ With a prefix argument, edit PICK-EXPR.
99 100
100Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." 101Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
101 (interactive 102 (interactive
102 (list (mh-edit-pick-expr (mh-current-message-header-field 'from)))) 103 (list (mh-edit-pick-expr
104 (mh-quote-pick-expr (mh-current-message-header-field 'from)))))
103 (mh-narrow-to-header-field 'from pick-expr)) 105 (mh-narrow-to-header-field 'from pick-expr))
104 106
105;;;###mh-autoload 107;;;###mh-autoload
@@ -122,7 +124,8 @@ With a prefix argument, edit PICK-EXPR.
122 124
123Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." 125Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
124 (interactive 126 (interactive
125 (list (mh-edit-pick-expr (mh-current-message-header-field 'subject)))) 127 (list (mh-edit-pick-expr
128 (mh-quote-pick-expr (mh-current-message-header-field 'subject)))))
126 (mh-narrow-to-header-field 'subject pick-expr)) 129 (mh-narrow-to-header-field 'subject pick-expr))
127 130
128;;;###mh-autoload 131;;;###mh-autoload
@@ -132,7 +135,8 @@ With a prefix argument, edit PICK-EXPR.
132 135
133Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." 136Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
134 (interactive 137 (interactive
135 (list (mh-edit-pick-expr (mh-current-message-header-field 'to)))) 138 (list (mh-edit-pick-expr
139 (mh-quote-pick-expr (mh-current-message-header-field 'to)))))
136 (mh-narrow-to-header-field 'to pick-expr)) 140 (mh-narrow-to-header-field 'to pick-expr))
137 141
138 142
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index ebd342b6786..6ffaf6d499d 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -159,6 +159,23 @@ See also variable `mh-image-load-path-called-flag'."
159 (funcall function (car list)) 159 (funcall function (car list))
160 (setq list (cdr list)))) 160 (setq list (cdr list))))
161 161
162(defvar mh-pick-regexp-chars ".*$["
163 "List of special characters in pick regular expressions.")
164
165;;;###mh-autoload
166(defun mh-quote-pick-expr (pick-expr)
167 "Quote `mh-pick-regexp-chars' in PICK-EXPR.
168PICK-EXPR is a list of strings. Return nil if PICK-EXPR is nil."
169 (let ((quoted-pick-expr))
170 (dolist (string pick-expr)
171 (when (and string
172 (not (string-equal string "")))
173 (loop for i from 0 to (1- (length mh-pick-regexp-chars)) do
174 (let ((s (string ?\\ (aref mh-pick-regexp-chars i))))
175 (setq string (mh-replace-regexp-in-string s s string t t))))
176 (setq quoted-pick-expr (append quoted-pick-expr (list string)))))
177 quoted-pick-expr))
178
162;;;###mh-autoload 179;;;###mh-autoload
163(defun mh-replace-string (old new) 180(defun mh-replace-string (old new)
164 "Replace all occurrences of OLD with NEW in the current buffer. 181 "Replace all occurrences of OLD with NEW in the current buffer.