From unknown Fri Aug 15 04:07:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58934 <58934@debbugs.gnu.org> To: bug#58934 <58934@debbugs.gnu.org> Subject: Status: 28.2; define-ibuffer-filter should let you compute a function on the qualifier before each update Reply-To: bug#58934 <58934@debbugs.gnu.org> Date: Fri, 15 Aug 2025 11:07:57 +0000 retitle 58934 28.2; define-ibuffer-filter should let you compute a function= on the qualifier before each update reassign 58934 emacs submitter 58934 Sean Devlin severity 58934 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 31 18:49:26 2022 Received: (at submit) by debbugs.gnu.org; 31 Oct 2022 22:49:26 +0000 Received: from localhost ([127.0.0.1]:42195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opdav-0004uF-Vf for submit@debbugs.gnu.org; Mon, 31 Oct 2022 18:49:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:46182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opdau-0004u7-9S for submit@debbugs.gnu.org; Mon, 31 Oct 2022 18:49:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opdau-0003ZV-3f for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 18:49:24 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opdar-0000rq-3G for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 18:49:23 -0400 Received: by mail-qk1-x72a.google.com with SMTP id k2so3001468qkk.7 for ; Mon, 31 Oct 2022 15:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20210112.gappssmtp.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=xpAbaV2TMP77HHVQngqvqk45zUU/9qejZrjWQ4Q90Nw=; b=n6VgHgSsTTGmzwXi1xgNO+84gxrSdUBs/jK+uK1CBJd0yPedbVHOy5f7xCGzSi++pk qNqTrrJxF/VPqtzHXOOpw7Dogr3flfFWx/DzrI+EXYxhcsUWYEKsl8ldtAgoEjbRF1e4 XGqX1NLYKl2kc5zYxmw9BejyiuotPR8BXYk2My03Co/dSPdCL3+IlNjIgIF4WxPDpgSR MNZdcC4goHeYTloTDKG8NNRvelNjLIi7HeMKtY8gEDZ3vY7bh54vdLUirq9PuU13FpHS /KeQEwf39aZkdSwMS6woqwIbeGhhH55iYS+F2NA4Y1awEkaomaMGkA5HePqU82XM+NRb beIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xpAbaV2TMP77HHVQngqvqk45zUU/9qejZrjWQ4Q90Nw=; b=AB0SCsmENVlFaOEZApDrV9qvPDM51tmUiMaQLZOgGeUDwsXDeYT8kXGriNVncvMuQz CURaRrOv0v7bsCdVF3BaC/k5mFCrfzWYPLN5OVn9wzpluhMVen4ugAQgwkq7hZ1xLrEn lj91qGdEAQtSX4BjXv5y+oKjMhy3IIytM2fxar0qiWky6hLvsQAchMedJp93cv40IrYu MMLIkKMz0hJOvFcywJWgAlhzKXb99kWo8rLZSEYaO1AntpB3c3cRKeNHHTSRgsUtid4a pmrCwYkAwYee4xzyqgFcSTbQ0tpw9gLNuZyYk9hrU6/4XlwTgEguDJwARW6chy6MNZ2p +a3A== X-Gm-Message-State: ACrzQf1TID6DEn1ncdKa+cDriCgtxXccS0gpo80K0D+9OoPJqGvJFKz5 ZlDPrB9Kz6jN5xmiv35OjU1rR5jLwZ5rk+Fu X-Google-Smtp-Source: AMsMyM5qU/1Y+7Y/PqIHx5IVef5L2O+sPezshrHDcC0nwLYdguHpZQbPCXYxpL8SHyBiZr0CMXPMcA== X-Received: by 2002:ae9:e401:0:b0:6e5:291d:4073 with SMTP id q1-20020ae9e401000000b006e5291d4073mr11073466qkc.635.1667256559420; Mon, 31 Oct 2022 15:49:19 -0700 (PDT) Received: from smtpclient.apple (pool-173-56-106-162.nycmny.ftas.verizon.net. [173.56.106.162]) by smtp.gmail.com with ESMTPSA id bq10-20020a05620a468a00b006ee77f1ecc3sm5505406qkb.31.2022.10.31.15.49.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2022 15:49:18 -0700 (PDT) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.51\)) Subject: 28.2; define-ibuffer-filter should let you compute a function on the qualifier before each update Message-Id: Date: Mon, 31 Oct 2022 18:49:08 -0400 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3731.300.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=spd@toadstyle.org; helo=mail-qk1-x72a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi folks, Ibuffer provides a macro define-ibuffer-filter to let users define their own interactive filters. When the filter is invoked, ibuffer reads a value from the user and stores it in a buffer-local list of qualifiers. During each update, ibuffer evaluates the body of the filter for each buffer and qualifier and hides the buffers that do not pass the test. Sometimes, it is useful to compute a function on the qualifier before using the result to test the buffer. For example, suppose you were to define the following project-based filter: (define-ibuffer-filter project "Limit current view to buffers with project matching QUALIFIER." (:description "project" :reader (project-current t)) (seq-contains-p (project-buffers qualifier) buf)) The intermediate list of project buffers is computed repeatedly when we update ibuffer, even though it depends only on the qualifier and not on the individual buffer to be tested. This can be expensive if the user has lots of buffers open. It would be useful if define-ibuffer-filter had some keyword to specify some precomputation over the qualifier once per ibuffer update. While we could do this precomputation when the filter is read, this would lead to stale results on future updates. For example, if we open new project buffers, those changes would not be reflected during future updates, i.e. those buffers would be hidden incorrectly. Thanks for any help! In GNU Emacs 28.2 System Description: macOS Configured using: 'configure --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs/28.2/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs/28.2 --with-gnutls --without-x --with-xml2 --without-dbus --with-modules --without-ns --without-imagemagick --without-selinux' Configured features: ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE PDUMPER THREADS ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (mailalias mailclient browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap help-mode pp shadow regexp-opt sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail tool-bar rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils term/xterm xterm byte-opt gv bytecomp byte-compile cconv iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue multi-tty make-network-process emacs) Memory information: ((conses 16 66399 9810) (symbols 48 7124 3) (strings 32 21563 2028) (string-bytes 1 682323) (vectors 16 12435) (vector-slots 8 141712 14429) (floats 8 28 313) (intervals 56 818 108) (buffers 992 13))