From: Tino Calancha <tino.calancha@gmail.com>
To: 24997@debbugs.gnu.org
Subject: bug#24997: 26.0.50; ibuffer-decompose-filter has side effects on error
Date: Wed, 23 Nov 2016 16:34:32 +0900 [thread overview]
Message-ID: <878tsa6453.fsf@gmail.com> (raw)
M-x ibuffer RET
/ m lisp-interaction-mode RET
/ > 10 RET
;; here `ibuffer-filtering-qualifiers' has value:
;; ((size-gt . 10) (used-mode . lisp-interaction-mode))
/ d
;; Signals error:
ibuffer-decompose-filter: Filter type size-gt is not compound
Note that previous command has side effects on `ibuffer-filtering-qualifiers'
even when there is an error; after this command the var has value:
((used-mode . lisp-interaction-mode))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 4540c12df119e247b5eb0a33c216375a43421e62 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Wed, 23 Nov 2016 16:28:49 +0900
Subject: [PATCH] ibuffer-decompose-filter: Avoid side effects on error
* lisp/ibuf-ext.el (ibuffer-decompose-filter):
Update 'ibuffer-filtering-qualifiers' only if there is no error (Bug#24997).
---
lisp/ibuf-ext.el | 39 +++++++++++++++++----------------------
1 file changed, 17 insertions(+), 22 deletions(-)
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 5ef0746..3d11972 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -840,29 +840,24 @@ ibuffer-decompose-filter
be a complex filter like (OR [name: foo] [mode: bar-mode]), will be
turned into two separate filters [name: foo] and [mode: bar-mode]."
(interactive)
- (when (null ibuffer-filtering-qualifiers)
+ (unless ibuffer-filtering-qualifiers
(error "No filters in effect"))
- (let ((lim (pop ibuffer-filtering-qualifiers)))
- (pcase (car lim)
- (`or
- (setq ibuffer-filtering-qualifiers (append
- (cdr lim)
- ibuffer-filtering-qualifiers)))
- (`saved
- (let ((data
- (assoc (cdr lim)
- ibuffer-saved-filters)))
- (unless data
- (ibuffer-filter-disable)
- (error "Unknown saved filter %s" (cdr lim)))
- (setq ibuffer-filtering-qualifiers (append
- (cadr data)
- ibuffer-filtering-qualifiers))))
- (`not
- (push (cdr lim)
- ibuffer-filtering-qualifiers))
- (_
- (error "Filter type %s is not compound" (car lim)))))
+ (let* ((filters ibuffer-filtering-qualifiers)
+ (head (cdar filters))
+ (tail (cdr filters))
+ (value
+ (pcase (caar filters)
+ (`or (nconc head tail))
+ (`saved
+ (let ((data (assoc head ibuffer-saved-filters)))
+ (unless data
+ (ibuffer-filter-disable)
+ (error "Unknown saved filter %s" head))
+ (nconc (cadr data) tail)))
+ (`not (cons head tail))
+ (_
+ (error "Filter type %s is not compound" (caar filters))))))
+ (setq ibuffer-filtering-qualifiers value))
(ibuffer-update nil t))
;;;###autoload
--
2.10.2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.5 (x86_64-pc-linux-gnu, GTK+ Version 3.22.3)
of 2016-11-23 built on calancha-pc
Repository revision: c542fab20f53374dd0c71dce949ef370fc76fa48
next reply other threads:[~2016-11-23 7:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 7:34 Tino Calancha [this message]
2016-11-23 15:44 ` bug#24997: 26.0.50; ibuffer-decompose-filter has side effects on error Eli Zaretskii
2016-11-24 1:57 ` Tino Calancha
2016-12-07 11:50 ` Tino Calancha
2016-11-27 3:54 ` Tino Calancha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878tsa6453.fsf@gmail.com \
--to=tino.calancha@gmail.com \
--cc=24997@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.