* lisp/ibuf-macs.el (define-ibuffer-filter): Do not store
in 'ibuffer-filtering-qualifiers' a wrong filter (Bug#25042).
* test/lisp/ibuffer-tests.el (ibuffer-test-Bug25042): Add test.
qualifier))
(ibuffer-update nil t))
(push (list ',name ,description
- #'(lambda (buf qualifier)
- ,@body))
+ (lambda (buf qualifier)
+ (condition-case nil
+ ,@body
+ (error (ibuffer-pop-filter)
+ (when (eq ',name 'predicate)
+ (error "Wrong filter predicate: %S"
+ qualifier))))))
ibuffer-filtering-alist)
:autoload-end)))
(and (buffer-live-p it) (kill-buffer it))))))
+(ert-deftest ibuffer-test-Bug25042 ()
+ "Test for http://debbugs.gnu.org/25042 ."
+ (ibuffer)
+ (let ((filters ibuffer-filtering-qualifiers))
+ (unwind-protect
+ (progn
+ (ignore-errors ; Mistyped `match-string' instead of `string-match'.
+ (setq ibuffer-filtering-qualifiers nil)
+ (ibuffer-filter-by-predicate '(match-string "foo" (buffer-name))))
+ (should-not ibuffer-filtering-qualifiers))
+ (setq ibuffer-filtering-qualifiers filters))))
+
(provide 'ibuffer-tests)
;; ibuffer-tests.el ends here