Commit 2cf248ab authored by Eli Zaretskii's avatar Eli Zaretskii

(iswitchb-get-matched-buffers): Handle invalid-regexp errors in

post-command-hook.
parent 94d4bafb
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment