summaryrefslogtreecommitdiff
path: root/lisp/iswitchb.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2005-06-04 18:50:38 +0000
committerEli Zaretskii <eliz@gnu.org>2005-06-04 18:50:38 +0000
commitc1c20deb6abaf3c88f2393e541e193e3575c3831 (patch)
treecf579fb510016c75b16563dab9d704f451a6f4c1 /lisp/iswitchb.el
parent7a8bd527e5bcd743550f27e9aebfc3e6591889d2 (diff)
downloademacs-c1c20deb6abaf3c88f2393e541e193e3575c3831.tar.gz
(iswitchb-get-matched-buffers): Handle invalid-regexp errors in
post-command-hook.
Diffstat (limited to 'lisp/iswitchb.el')
-rw-r--r--lisp/iswitchb.el37
1 files changed, 21 insertions, 16 deletions
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 52915c46950..5c01e77aabb 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -889,22 +889,27 @@ BUFFER-LIST can be list of buffers or list of strings."
(do-string (stringp (car list)))
name
ret)
- (mapcar
- (lambda (x)
-
- (if do-string
- (setq name x) ;We already have the name
- (setq name (buffer-name x)))
-
- (cond
- ((and (or (and string-format (string-match regexp name))
- (and (null string-format)
- (string-match (regexp-quote regexp) name)))
-
- (not (iswitchb-ignore-buffername-p name)))
- (setq ret (cons name ret))
- )))
- list)
+ (catch 'invalid-regexp
+ (mapcar
+ (lambda (x)
+
+ (if do-string
+ (setq name x) ;We already have the name
+ (setq name (buffer-name x)))
+
+ (cond
+ ((and (or (and string-format
+ (condition-case error
+ (string-match regexp name)
+ (invalid-regexp
+ (throw 'invalid-regexp (setq ret (cdr error))))))
+ (and (null string-format)
+ (string-match (regexp-quote regexp) name)))
+
+ (not (iswitchb-ignore-buffername-p name)))
+ (setq ret (cons name ret))
+ )))
+ list))
ret))
(defun iswitchb-ignore-buffername-p (bufname)