From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 18 09:03:56 2011 Received: (at submit) by debbugs.gnu.org; 18 Mar 2011 13:03:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0ZLP-0007BE-No for submit@debbugs.gnu.org; Fri, 18 Mar 2011 09:03:56 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0ZLN-0007B2-4Z for submit@debbugs.gnu.org; Fri, 18 Mar 2011 09:03:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0ZLG-0000cp-2S for submit@debbugs.gnu.org; Fri, 18 Mar 2011 09:03:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:53411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0ZLF-0000bU-TE for submit@debbugs.gnu.org; Fri, 18 Mar 2011 09:03:46 -0400 Received: from [140.186.70.92] (port=57415 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0ZCe-0001FL-DX for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2011 08:54:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0ZCc-0007Kq-07 for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2011 08:54:52 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:63877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0ZCb-0007Ki-Md for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2011 08:54:49 -0400 Received: by bwz17 with SMTP id 17so3710416bwz.0 for ; Fri, 18 Mar 2011 05:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=QeBMJf64s0DUDfUVDkrQxTfXayp+vAMFgGUGaB+MIpA=; b=jjM0F86vf5MaHvFGygFqSsDHTwKi6FyPydbGhYDZrIpVh97RQFqhF1BVcNlV5tSaoL ojFj384wh/Ov7kfVqhY7ExWK01pmB6yeRDiyvfaO3BVL/g9ZwWmBX/pWtZD2Cale/BXm sdEOCoWa+EyLteEGzyWivPcXleQQFbWj6qR80= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=kQaw8xvXY09gW2gRIDVZWiUPYzf54dCNYioX/7rA4e69N5I2Uik5vWEDhaR0O3iC6Z OdvRhmz9vUp8LsFcqf8Q5OsKYFQUphWqHs0zGmV8p2A5zH8SwaGQBVskJijXVz9cH6cA OkcNKMH4vHfWmhKTWFqOSrlSeDX588z8DoBv8= Received: by 10.204.162.66 with SMTP id u2mr943994bkx.19.1300452888631; Fri, 18 Mar 2011 05:54:48 -0700 (PDT) Received: from socrates (186.182.197-77.rev.gaoland.net [77.197.182.186]) by mx.google.com with ESMTPS id c11sm2121462bkc.14.2011.03.18.05.54.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 05:54:48 -0700 (PDT) From: fourquet.d@gmail.com (=?utf-8?Q?Rafa=C3=ABl?= Fourquet) To: bug-gnu-emacs@gnu.org Subject: 24.0.50; ibuffer: "filters to filter group" broken Date: Fri, 18 Mar 2011 13:53:59 +0100 Message-ID: <87oc58h9nc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) This bug is introduced by the fix of bug #7969, please tell me if I should have re-opened this one. The infinite loop indicated in #7969 was fixed in file ibuf-ext.el (commit 81911782 in git, Feb 2) by clearing all the filter groups (ibuffer-filter-groups) in addition to the active filters (ibuffer-filtering-qualifiers), in the function ibuffer-filter-disable. I am not sure that this is what this function was intended to do. At least it introduces an unwanted behavior: the function ibuffer-filters-to-filter-group is supposed to transform active filters into a filtering group, so it calls ibuffer-filter-disable once those filters have been set as groups. But now, this last function clears everything. This can be solved by adding an optional parameter in ibuffer-filter-disable, or by replacing at the call site in ibuffer-included-in-filter-p-1 the call to ibuffer-filter-disable by: (setq ibuffer-filtering-qualifiers nil) (setq ibuffer-filter-groups nil) (ibuffer-update nil t) But maybe removing all the cleaning at all, but keeping the error or returning nil (so an invalid filter becomes an always false filter), or asking the user, is better? So a user who has set complex filters interactively won't loose everything if she tries to load an invalid filter. More generally, I think that the parser should be more tolerant and accept the example given in the original message of #7969. The idea is that we have operator 'not, 'or, 'saved, but also a last kind of operator, 'and, which is implicit, but currently only allowed at the top level, it simply consists of a list of other filters. It is easy enough to create explicitly an 'and qualifier, for example: (define-ibuffer-filter and "and filter" (:description "and") (ibuffer-included-in-filters-p buf qualifier)) But why not extend the built-in behavior? Here is a patch, not well tested, but I'm just new to ibuffer and elisp in general, so I really don't know if it breaks something else. I tried to change as little as possible, but maybe the functions ibuffer-included-in-filters-p, ibuffer-included-in-filter-p, and ibuffer-included-in-filter-p-1 could be merged into one function or two (I may do this). It also updates ibuffer-format-qualifier and ibuffer-decompose-filter accordingly. Let me know if you see something else to update. The last part of the patch corrects a minor bug in a related function (a sanity check was done on the wrong variable). Thanks to the developers for this great piece of code. --- emacs/lisp/ibuf-ext.el.orig 2011-03-18 11:58:11.000000000 +0100 +++ emacs/lisp/ibuf-ext.el 2011-03-18 13:35:40.000000000 +0100 @@ -488,9 +488,12 @@ filters)))) (defun ibuffer-included-in-filter-p (buf filter) - (if (eq (car filter) 'not) - (not (ibuffer-included-in-filter-p-1 buf (cdr filter))) - (ibuffer-included-in-filter-p-1 buf filter))) + (if (consp (car filter)) + ;; an implicit "and": multiple filters + (ibuffer-included-in-filters-p buf filter) + (if (eq (car filter) 'not) + (not (ibuffer-included-in-filter-p buf (cdr filter))) + (ibuffer-included-in-filter-p-1 buf filter)))) (defun ibuffer-included-in-filter-p-1 (buf filter) (not @@ -505,7 +508,6 @@ (assoc (cdr filter) ibuffer-saved-filters))) (unless data - (ibuffer-filter-disable) (error "Unknown saved filter %s" (cdr filter))) (ibuffer-included-in-filters-p buf (cadr data)))) (t @@ -514,7 +516,6 @@ ;; filterdat should be like (TYPE DESCRIPTION FUNC) ;; just a sanity check (unless filterdat - (ibuffer-filter-disable) (error "Undefined filter %s" (car filter))) (not (not @@ -771,8 +772,7 @@ (defun ibuffer-filter-disable () "Disable all filters currently in effect in this buffer." (interactive) - (setq ibuffer-filtering-qualifiers nil - ibuffer-filter-groups nil) + (setq ibuffer-filtering-qualifiers nil) (let ((buf (ibuffer-current-buffer))) (ibuffer-update nil t) (when buf @@ -824,7 +824,10 @@ (push (cdr lim) ibuffer-filtering-qualifiers)) (t - (error "Filter type %s is not compound" (car lim))))) + (if (consp (car lim)) + (setq ibuffer-filtering-qualifiers + (append lim ibuffer-filtering-qualifiers)) + (error "Filter type %s is not compound" (car lim)))))) (ibuffer-update nil t)) ;;;###autoload @@ -950,9 +953,11 @@ " ")))) (defun ibuffer-format-qualifier (qualifier) - (if (eq (car-safe qualifier) 'not) - (concat " [NOT" (ibuffer-format-qualifier-1 (cdr qualifier)) "]") - (ibuffer-format-qualifier-1 qualifier))) + (if (consp (car-safe qualifier)) + (concat " [" (mapconcat #'ibuffer-format-qualifier qualifier " ") "]") + (if (eq (car-safe qualifier) 'not) + (concat " [NOT" (ibuffer-format-qualifier (cdr qualifier)) "]") + (ibuffer-format-qualifier-1 qualifier)))) (defun ibuffer-format-qualifier-1 (qualifier) (case (car qualifier) @@ -963,7 +968,7 @@ (cdr qualifier) "") "]")) (t (let ((type (assq (car qualifier) ibuffer-filtering-alist))) - (unless qualifier + (unless type (error "Ibuffer: bad qualifier %s" qualifier)) (concat " [" (cadr type) ": " (format "%s]" (cdr qualifier))))))) From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 05 14:25:06 2011 Received: (at control) by debbugs.gnu.org; 5 Jun 2011 18:25:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTI0Y-0003eI-6M for submit@debbugs.gnu.org; Sun, 05 Jun 2011 14:25:06 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTI0W-0003dq-FB for control@debbugs.gnu.org; Sun, 05 Jun 2011 14:25:04 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QTI0R-0006OS-7R for control@debbugs.gnu.org; Sun, 05 Jun 2011 14:24:59 -0400 Date: Sun, 05 Jun 2011 14:24:59 -0400 Message-Id: Subject: control message for bug 8804 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) merge 8280 8804 From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 14 14:12:41 2011 Received: (at 8280) by debbugs.gnu.org; 14 Aug 2011 18:12:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QsfAs-0006Qk-MG for submit@debbugs.gnu.org; Sun, 14 Aug 2011 14:12:40 -0400 Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QsfAo-0006Qb-QM for 8280@debbugs.gnu.org; Sun, 14 Aug 2011 14:12:36 -0400 Received: from furball ([64.134.68.235]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id p7EIAuBH003371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 14 Aug 2011 14:10:56 -0400 From: Chong Yidong To: fourquet.d@gmail.com (=?utf-8?Q?Rafa=C3=ABl?= Fourquet) Subject: Re: bug#8280: 24.0.50; ibuffer: "filters to filter group" broken References: <87oc58h9nc.fsf@gmail.com> Date: Sun, 14 Aug 2011 14:10:55 -0400 In-Reply-To: <87oc58h9nc.fsf@gmail.com> (=?utf-8?Q?=22Rafa=C3=ABl?= Fourquet"'s message of "Fri, 18 Mar 2011 13:53:59 +0100") Message-ID: <87hb5jg8y8.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8280 Cc: 8280@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) fourquet.d@gmail.com (Rafa=C3=ABl Fourquet) writes: > This bug is introduced by the fix of bug #7969, please tell me if I > should have re-opened this one. > > The infinite loop indicated in #7969 was fixed in file ibuf-ext.el > (commit 81911782 in git, Feb 2) by clearing all the filter groups > (ibuffer-filter-groups) in addition to the active filters > (ibuffer-filtering-qualifiers), in the function ibuffer-filter-disable. > I am not sure that this is what this function was intended to do. At > least it introduces an unwanted behavior: the function > ibuffer-filters-to-filter-group is supposed to transform active filters > into a filtering group, so it calls ibuffer-filter-disable once those > filters have been set as groups. But now, this last function clears > everything. Thanks for the analysis. I've committed the more conservative fix you suggested, i.e. adding an optional arg to ibuffer-filter-disable and using it in ibuffer-included-in-filter-p-1. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 14 14:12:52 2011 Received: (at control) by debbugs.gnu.org; 14 Aug 2011 18:12:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QsfB5-0006RB-Jo for submit@debbugs.gnu.org; Sun, 14 Aug 2011 14:12:52 -0400 Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QsfB2-0006R0-RV for control@debbugs.gnu.org; Sun, 14 Aug 2011 14:12:50 -0400 Received: from furball ([64.134.68.235]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id p7EIBA21003408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sun, 14 Aug 2011 14:11:11 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: close 8280 Date: Sun, 14 Aug 2011 14:11:09 -0400 Message-ID: <87k4afkgn6.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) close 8280 thanks From unknown Fri Aug 15 20:29:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 12 Sep 2011 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator