aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2005-06-04 18:50:38 +0000
committerEli Zaretskii2005-06-04 18:50:38 +0000
commit2cf248ab2e66c567e0b4722bfc89bb1d64b0fe3c (patch)
tree169e81dd9894c5d40439004594f35da05b066982
parent94d4bafbecabcc6e57c5ac7d2e368c082d9f5fb5 (diff)
downloademacs-2cf248ab2e66c567e0b4722bfc89bb1d64b0fe3c.tar.gz
emacs-2cf248ab2e66c567e0b4722bfc89bb1d64b0fe3c.zip
(iswitchb-get-matched-buffers): Handle invalid-regexp errors in
post-command-hook.
-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."
889 (do-string (stringp (car list))) 889 (do-string (stringp (car list)))
890 name 890 name
891 ret) 891 ret)
892 (mapcar 892 (catch 'invalid-regexp
893 (lambda (x) 893 (mapcar
894 894 (lambda (x)
895 (if do-string 895
896 (setq name x) ;We already have the name 896 (if do-string
897 (setq name (buffer-name x))) 897 (setq name x) ;We already have the name
898 898 (setq name (buffer-name x)))
899 (cond 899
900 ((and (or (and string-format (string-match regexp name)) 900 (cond
901 (and (null string-format) 901 ((and (or (and string-format
902 (string-match (regexp-quote regexp) name))) 902 (condition-case error
903 903 (string-match regexp name)
904 (not (iswitchb-ignore-buffername-p name))) 904 (invalid-regexp
905 (setq ret (cons name ret)) 905 (throw 'invalid-regexp (setq ret (cdr error))))))
906 ))) 906 (and (null string-format)
907 list) 907 (string-match (regexp-quote regexp) name)))
908
909 (not (iswitchb-ignore-buffername-p name)))
910 (setq ret (cons name ret))
911 )))
912 list))
908 ret)) 913 ret))
909 914
910(defun iswitchb-ignore-buffername-p (bufname) 915(defun iswitchb-ignore-buffername-p (bufname)