[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-limit.el ChangeLog
From: |
Bill Wohler |
Subject: |
[Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-limit.el ChangeLog |
Date: |
Wed, 01 Mar 2006 05:33:18 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch:
Changes by: Bill Wohler <address@hidden> 06/03/01 05:33:18
Modified files:
lisp/mh-e : mh-utils.el mh-limit.el ChangeLog
Log message:
* mh-limit.el (mh-narrow-to-cc, mh-narrow-to-from)
(mh-narrow-to-subject, mh-narrow-to-to): Fix inability to narrow to
subjects with special characters by quoting regular expression
characters in pick expression derived from existing subjects and other
fields (closes SF #1432548).
* mh-utils.el (mh-pick-regexp-chars, mh-quote-pick-expr): New variable
and function for quoting pick regular expression characters (closes SF
#1432548).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-utils.el.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-limit.el.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.165&tr2=1.166&r1=text&r2=text
Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.165 emacs/lisp/mh-e/ChangeLog:1.166
--- emacs/lisp/mh-e/ChangeLog:1.165 Tue Feb 28 23:54:53 2006
+++ emacs/lisp/mh-e/ChangeLog Wed Mar 1 05:33:18 2006
@@ -1,5 +1,11 @@
2006-02-28 Bill Wohler <address@hidden>
+ * mh-limit.el (mh-narrow-to-cc, mh-narrow-to-from)
+ (mh-narrow-to-subject, mh-narrow-to-to): Fix inability to narrow
+ to subjects with special characters by quoting regular expression
+ characters in pick expression derived from existing subjects and
+ other fields (closes SF #1432548).
+
* mh-utils.el (mh-image-load-path): Rename variable to
mh-image-directory.
(mh-image-load-path): Access mh-image-directory instead of
@@ -9,6 +15,9 @@
the entire filesystem (or infinite loop). Don't append slash to
folder. These fixes fix problems observed with the pick search.
Thanks to Thomas Baumann for the help (closes SF #1435381).
+ (mh-pick-regexp-chars, mh-quote-pick-expr): New variable and
+ function for quoting pick regular expression characters (closes SF
+ #1432548).
2006-02-27 Bill Wohler <address@hidden>
Index: emacs/lisp/mh-e/mh-limit.el
diff -u emacs/lisp/mh-e/mh-limit.el:1.3 emacs/lisp/mh-e/mh-limit.el:1.4
--- emacs/lisp/mh-e/mh-limit.el:1.3 Wed Feb 1 23:24:34 2006
+++ emacs/lisp/mh-e/mh-limit.el Wed Mar 1 05:33:18 2006
@@ -89,7 +89,8 @@
Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
(interactive
- (list (mh-edit-pick-expr (mh-current-message-header-field 'cc))))
+ (list (mh-edit-pick-expr
+ (mh-quote-pick-expr (mh-current-message-header-field 'cc)))))
(mh-narrow-to-header-field 'cc pick-expr))
;;;###mh-autoload
@@ -99,7 +100,8 @@
Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
(interactive
- (list (mh-edit-pick-expr (mh-current-message-header-field 'from))))
+ (list (mh-edit-pick-expr
+ (mh-quote-pick-expr (mh-current-message-header-field 'from)))))
(mh-narrow-to-header-field 'from pick-expr))
;;;###mh-autoload
@@ -122,7 +124,8 @@
Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
(interactive
- (list (mh-edit-pick-expr (mh-current-message-header-field 'subject))))
+ (list (mh-edit-pick-expr
+ (mh-quote-pick-expr (mh-current-message-header-field 'subject)))))
(mh-narrow-to-header-field 'subject pick-expr))
;;;###mh-autoload
@@ -132,7 +135,8 @@
Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
(interactive
- (list (mh-edit-pick-expr (mh-current-message-header-field 'to))))
+ (list (mh-edit-pick-expr
+ (mh-quote-pick-expr (mh-current-message-header-field 'to)))))
(mh-narrow-to-header-field 'to pick-expr))
Index: emacs/lisp/mh-e/mh-utils.el
diff -u emacs/lisp/mh-e/mh-utils.el:1.55 emacs/lisp/mh-e/mh-utils.el:1.56
--- emacs/lisp/mh-e/mh-utils.el:1.55 Tue Feb 28 23:54:53 2006
+++ emacs/lisp/mh-e/mh-utils.el Wed Mar 1 05:33:18 2006
@@ -159,6 +159,23 @@
(funcall function (car list))
(setq list (cdr list))))
+(defvar mh-pick-regexp-chars ".*$["
+ "List of special characters in pick regular expressions.")
+
+;;;###mh-autoload
+(defun mh-quote-pick-expr (pick-expr)
+ "Quote `mh-pick-regexp-chars' in PICK-EXPR.
+PICK-EXPR is a list of strings. Return nil if PICK-EXPR is nil."
+ (let ((quoted-pick-expr))
+ (dolist (string pick-expr)
+ (when (and string
+ (not (string-equal string "")))
+ (loop for i from 0 to (1- (length mh-pick-regexp-chars)) do
+ (let ((s (string ?\\ (aref mh-pick-regexp-chars i))))
+ (setq string (mh-replace-regexp-in-string s s string t t))))
+ (setq quoted-pick-expr (append quoted-pick-expr (list string)))))
+ quoted-pick-expr))
+
;;;###mh-autoload
(defun mh-replace-string (old new)
"Replace all occurrences of OLD with NEW in the current buffer.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-limit.el ChangeLog,
Bill Wohler <=