From unknown Mon Jun 23 14:59:58 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#64230 <64230@debbugs.gnu.org> To: bug#64230 <64230@debbugs.gnu.org> Subject: Status: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled Reply-To: bug#64230 <64230@debbugs.gnu.org> Date: Mon, 23 Jun 2025 21:59:58 +0000 retitle 64230 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mo= de enabled reassign 64230 emacs submitter 64230 Stephen Berman severity 64230 normal tag 64230 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 22 13:35:36 2023 Received: (at submit) by debbugs.gnu.org; 22 Jun 2023 17:35:36 +0000 Received: from localhost ([127.0.0.1]:36662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCODX-0006Me-Pc for submit@debbugs.gnu.org; Thu, 22 Jun 2023 13:35:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:45334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCODW-0006MV-8i for submit@debbugs.gnu.org; Thu, 22 Jun 2023 13:35:34 -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 1qCODW-0001ZI-0G for bug-gnu-emacs@gnu.org; Thu, 22 Jun 2023 13:35:34 -0400 Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCODU-000877-0a for bug-gnu-emacs@gnu.org; Thu, 22 Jun 2023 13:35:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1687455329; x=1688060129; i=stephen.berman@gmx.net; bh=+uOwpYMtYPTKVYE5zQi6tZKsH0lOCksyIxAmqT489vY=; h=X-UI-Sender-Class:From:To:Subject:Date; b=Qamfl+rqodAN4B3JQhW/ieF/4jfiNXAjzEtxqqnzgu6ZWkbRgJaJW0vzZxNJ+YjwwLBCtyQ 7IWJCYnQ6L8qnKlwBGzvu5HP7idS4LVGDJFgpxSGy7Vd5T8jH2kB/hy2HJ2hUs6LEI2YZiJEC V2GqSnSX+RcFHiBBnfO4FckqkNEtZJ0YQ+zfVmTqFAlvkAwWank6OkozqN5COfY0tZ9QG2/2k soSc9cVD4ZhOvOCtXqepUfBw+zWqzFjs+rpubRmVYe7Vyub36vjnnfUxRp4C22CNJW0ayxQeV DujMKVJKNso8MsvPVYwfkXnN7Sku/J//ZvlukPIn2BE0cMMbk5iQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs ([89.246.37.91]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXGrE-1qa9zr0C1G-00Ygai for ; Thu, 22 Jun 2023 19:35:29 +0200 From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled Date: Thu, 22 Jun 2023 19:35:28 +0200 Message-ID: <874jmzo0wv.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:Mrg95syKNiw67YBGqyshMQKTFrpQIt1vgwBmJrQ6f2GlZ8Afkm4 WUSyY2q+4rdBwO8urFm1tz1j174CbpTKZGES2YRS4HvIAA3yZgKnnoUwW7WzXJuKrWNa7QB Zd0VHP7DJbD+iGFFoQB/oEivVJ2pZJtQ2PhUFw8gsE31h7LMtsRhymdCir2R71ogfjeQDJG 9dBAvkHhT6ypDvmeLvVww== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:FePz6Shit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X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 (--) --=-=-= Content-Type: text/plain 0. emacs -Q 1. Type `M-x' and then TAB to pop up the *Completions* buffer, then type `C-g'. 2. Type `M-x ibuffer'. 3. Type `d' on the lines for the buffers *scratch* and *Completions* to flag them for deletion. 4. Type `C-c C-a' to enable ibuffer-auto-mode. 5. Type `x' and at the prompt "Really kill 2 buffers? (y or n)" type `y'. => The *Ibuffer* lines for *scratch* and *Completions* are deleted and the echo area displays this message: "Operation finished; killed 3 buffers". If you change this recipe by omitting step 4, then after the buffer lines are deleted the message displayed is "Operation finished; killed 2 buffers". The unexpected message with ibuffer-auto-mode enabled is displayed in Emacs 27-30 but not in Emacs 26. With Emacs 27+, on typing `x' at step 5, the buffer *Ibuffer confirmation* pops up and a line for this buffer immediately appears in the *Ibuffer* display, and this is counted by the function `ibuffer-map-lines', and on typing `y' not only are the two flagged buffers deleted, but also *Ibuffer confirmation*, hence "killed 3 buffers". In contrast, in Emacs 26, the popped up buffer *Ibuffer confirmation* does not get added to the *Ibuffer* display and thus is not counted by `ibuffer-map-lines'. AFAICT, this difference is not due to any ibuffer code changes after Emacs 26; rather, there appears to be a timing difference with respect to when Emacs updates the *Ibuffer* display: when I instrument `ibuffer-update' for Edebug and then type `x' (step 5 above), what happens in Emacs 26 is that I can confirm with `y', then the flagged lines are deleted, and only then does Edebug stop the execution so I can step into `ibuffer-update'; while in Emacs 27+, as soon as I type `x', Edebug stops execution, i.e., before the flagged lines are deleted. `ibuffer-update' is called in `ibuffer-auto-update-changed', which is added to post-command-hook in `ibuffer-auto-mode'. So it seems that in Emacs 26 post-command-hook runs or takes effect later than in Emacs 27+. Whether this is really the case, and if so, what change it is due to, I haven't determined, and I don't know how restore the Emacs 26 execution order (or if that's even desirable). But even if the difference is due to something else, the message displayed in Emacs 27+ after the deletion of the *Ibuffer* lines is at least misleading, since it clearly is meant to refer only to the flagged lines, as in Emacs 26. In lieu of a real fix, since it is, AFAICS, only the transient buffer *Ibuffer confirmation* that results in the problematic message, a workaround is simply to decrement the line count by one when ibuffer-auto-mode is enabled, as in the the attached patch (which also takes the opportunity to wrap an overlong line in `ibuffer-map-lines'). In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.6) of 2023-06-22 built on strobelfs Repository revision: a23a09a82fc59402f1f7c23a46c65fc7001eecdf Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: Linux From Scratch r11.3-65 Configured using: 'configure -C --with-xwidgets 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: Ibuffer patch diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index a26bb1811ec..50c3aeb7f62 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1872,7 +1872,8 @@ ibuffer-map-lines (let ((result (if (buffer-live-p (ibuffer-current-buffer)) (when (or (null group) - (when-let ((it (get-text-property (point) 'ibuffer-filter-group))) + (when-let ((it (get-text-property + (point) 'ibuffer-filter-group))) (equal group it))) (save-excursion (funcall function @@ -1897,7 +1898,9 @@ ibuffer-map-lines (t (cl-incf ibuffer-map-lines-count) (forward-line 1))))) - ibuffer-map-lines-count) + (if (and (featurep 'ibuf-ext) ibuffer-auto-mode) + (1- ibuffer-map-lines-count) + ibuffer-map-lines-count)) (progn (setq buffer-read-only t) (unless nomodify --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 10 10:03:30 2023 Received: (at control) by debbugs.gnu.org; 10 Sep 2023 14:03:30 +0000 Received: from localhost ([127.0.0.1]:50998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfL29-0008B8-LS for submit@debbugs.gnu.org; Sun, 10 Sep 2023 10:03:29 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:42070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfL26-0008Ak-D2 for control@debbugs.gnu.org; Sun, 10 Sep 2023 10:03:28 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-500760b296aso4323756e87.0 for ; Sun, 10 Sep 2023 07:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694354596; x=1694959396; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=xV/GuIzw5/YcfGvtbcqjUx3xTeMUGpts0FsbUH1bRpU=; b=DSzUxsvhPJEyEs42P3hMrCNigoGiBk6d1J7hY3bRMpnb+8IczIo3hwQuImgd+Vc4mt 9jEjrZKSmspoVUAkZVcIYJETrT3ifwCbFeHi+Mt+OG8AYroWb2cVrBs9AZgc4PScv/xY kqNO471Bc3dne4xJzomB0hent9lH+P+iD8cnxr3ajmNyQrLIbanoVXPdVZmJYOJHQ8f8 ijTDjf0FXBJtylAaXD6YrJZ/IyeS1IrrwXIB8fCerqnmPtrNXwl9MQ97Mg7Czd17NTXx lgosfs8ZZZybzi3aQlDqPc746g5/rcZZX5hXmgGyMA+jNQwlxaqSiVWT+d9pbr0hykee ERTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694354596; x=1694959396; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xV/GuIzw5/YcfGvtbcqjUx3xTeMUGpts0FsbUH1bRpU=; b=S9FbKmjFOxKsEwhVEzyYC5rSo3ePfNFFb+tUhQkf7ZwLYN0ZpToyNmDjqjkxt48F9N Cph2vgljmwdTIXyd6rmps+5Zlj04z5VjAq+u6O8uBV2+7DAOeCBN9909Ft8NQa4HIQEc 6JifZN31sezuZAMNbZT0PYMAY5cVfKkZCNI3KjWZhgJPFdBcAZWjsOVYTdtxO447ouUr eED2z95d3u1G99jqCuQF/6Km2aMtbeJ3TZAGk/3Cmw1cTNFcAla9r6/TBJrEC7WXjv4B 4Da1kz9RCth1geqGC2JpcZ23xPq3ItQgr3rTC179j9Ph5mJeTlpcVOnUO2mASwwMNFUp d3rA== X-Gm-Message-State: AOJu0Yxqz1S39ijJC/DJDDlEciKkuLavOa9i+dxtdRVa9luwc/QX2IKA wLiUjr1Vwck97RoXRIVNaK9WvEqDcCQkkFNujbxNQ5p+ X-Google-Smtp-Source: AGHT+IG/FQoX8MxVnQhemqB6Zd3lKJgXxXbZTiHpYnMxIxGFQlVSWwhBq+AlLwnS91fhD+xd43ZtE3joXDyeQmrdQEw= X-Received: by 2002:a05:6512:692:b0:4fb:8aca:6bb4 with SMTP id t18-20020a056512069200b004fb8aca6bb4mr3900092lfe.20.1694354596393; Sun, 10 Sep 2023 07:03:16 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 10 Sep 2023 07:03:16 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Sun, 10 Sep 2023 07:03:16 -0700 Message-ID: Subject: control message for bug #64230 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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: -1.0 (-) tags 64230 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 10 10:11:20 2023 Received: (at 64230) by debbugs.gnu.org; 10 Sep 2023 14:11:20 +0000 Received: from localhost ([127.0.0.1]:51038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfL9k-0008Nh-9f for submit@debbugs.gnu.org; Sun, 10 Sep 2023 10:11:20 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:61660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfL9h-0008N8-Im for 64230@debbugs.gnu.org; Sun, 10 Sep 2023 10:11:18 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-502a25ab777so2884915e87.2 for <64230@debbugs.gnu.org>; Sun, 10 Sep 2023 07:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694355068; x=1694959868; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=uTw/r12BJ6U4Sub+2c16y0Kv9Y5Zvx5Ysn416HO7Z7o=; b=Bd7rFzPes+LigykF6RMcFCjKkh1xmvPwxrYzoidOmeOlo9reAZoL6Px2K9mVo7vlpK RtxFRhvGsEw+J6gax6rh7bnYdLCOqkW78ggyqBnEWtgrGCb+2j9EnoSUNEQzblx2vETZ 5HbAdgGXf/J5Z0ROygDgLNXq0U/WM0c1wqgHLgG4uiE2NxEry3qT2tNn1d0ug2JoaCB3 PJoMKIq0o/vS38QdUiv7A17JJ9fHtTyfw1RuAZ+HcjhVPqIimb0Uf23jdT4KK7RhNGoL JmSNeo4DQZ/w8VkdN/HxPhXSzDTK6d/244WisfMhwyWmI0shwnh80txHBUHx3nCCPvUY gutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694355068; x=1694959868; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uTw/r12BJ6U4Sub+2c16y0Kv9Y5Zvx5Ysn416HO7Z7o=; b=Ebh1sPKp8QcZhxHisxwxYL4lnHVbbdFlyjNTf5cvuE+hM9Gz0aaKn8KqL9l8hK2i17 vuFjN6jEVIJXnotIOaRJnt8ZGVvxgsA1b4zDCRRb/HWSgU/b/nFE5xEojaaN68qzD3xR cL+ufwcfdXLzpFuTin/yBSPVmjUMFJCPVG8cd1xl3LDlhEgXBDq9s9LiTXLaEX1DO8BI 1dH12SYGIN8KQxBK7wLejsgdlzkl2owbswChnsYvUFRXAQ+OA1r/rIfViKajvd8sqLdD lLq9saZmpljnIOkDhoZkvBXNcoLEVKAtNih5hkfNfEcxvnMZjOXtl5Mv22eJ3almYALi ua7Q== X-Gm-Message-State: AOJu0Ywe/9KCtL39z2UmUmm4gHfYHXpcKJ6AScxQRzJi/TedcLj/D4to tsQc86nlLcRRpSJT6K/0beEZWEN8rMZgvtbOtnim+wQW X-Google-Smtp-Source: AGHT+IGY2Gek6eUPx4O3k9b4sLrTPx/0RmHJktf/kH0MVazmxCWaziRPgMoEeqyCMaIOyE1Rf+g3gCK/IGXHoR3JFi8= X-Received: by 2002:a19:435d:0:b0:500:cb2b:8678 with SMTP id m29-20020a19435d000000b00500cb2b8678mr5457444lfj.40.1694355067659; Sun, 10 Sep 2023 07:11:07 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 10 Sep 2023 07:11:07 -0700 From: Stefan Kangas In-Reply-To: <874jmzo0wv.fsf@gmx.net> (Stephen Berman's message of "Thu, 22 Jun 2023 19:35:28 +0200") References: <874jmzo0wv.fsf@gmx.net> MIME-Version: 1.0 Date: Sun, 10 Sep 2023 07:11:07 -0700 Message-ID: Subject: Re: bug#64230: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled To: Stephen Berman Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64230 Cc: 64230@debbugs.gnu.org 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: -1.0 (-) Stephen Berman writes: > 0. emacs -Q > 1. Type `M-x' and then TAB to pop up the *Completions* buffer, then type > `C-g'. > 2. Type `M-x ibuffer'. > 3. Type `d' on the lines for the buffers *scratch* and *Completions* to > flag them for deletion. > 4. Type `C-c C-a' to enable ibuffer-auto-mode. > 5. Type `x' and at the prompt "Really kill 2 buffers? (y or n)" type `y'. > => The *Ibuffer* lines for *scratch* and *Completions* are deleted and > the echo area displays this message: "Operation finished; killed 3 > buffers". > > If you change this recipe by omitting step 4, then after the buffer > lines are deleted the message displayed is "Operation finished; killed 2 > buffers". > > The unexpected message with ibuffer-auto-mode enabled is displayed in > Emacs 27-30 but not in Emacs 26. With Emacs 27+, on typing `x' at step > 5, the buffer *Ibuffer confirmation* pops up and a line for this buffer > immediately appears in the *Ibuffer* display, and this is counted by the > function `ibuffer-map-lines', and on typing `y' not only are the two > flagged buffers deleted, but also *Ibuffer confirmation*, hence "killed > 3 buffers". In contrast, in Emacs 26, the popped up buffer *Ibuffer > confirmation* does not get added to the *Ibuffer* display and thus is > not counted by `ibuffer-map-lines'. > > AFAICT, this difference is not due to any ibuffer code changes after > Emacs 26; rather, there appears to be a timing difference with respect > to when Emacs updates the *Ibuffer* display: when I instrument > `ibuffer-update' for Edebug and then type `x' (step 5 above), what > happens in Emacs 26 is that I can confirm with `y', then the flagged > lines are deleted, and only then does Edebug stop the execution so I can > step into `ibuffer-update'; while in Emacs 27+, as soon as I type `x', > Edebug stops execution, i.e., before the flagged lines are deleted. > > `ibuffer-update' is called in `ibuffer-auto-update-changed', which is > added to post-command-hook in `ibuffer-auto-mode'. So it seems that in > Emacs 26 post-command-hook runs or takes effect later than in Emacs 27+. > Whether this is really the case, and if so, what change it is due to, I > haven't determined, and I don't know how restore the Emacs 26 execution > order (or if that's even desirable). But even if the difference is due > to something else, the message displayed in Emacs 27+ after the deletion > of the *Ibuffer* lines is at least misleading, since it clearly is meant > to refer only to the flagged lines, as in Emacs 26. > > In lieu of a real fix, since it is, AFAICS, only the transient buffer > *Ibuffer confirmation* that results in the problematic message, a > workaround is simply to decrement the line count by one when > ibuffer-auto-mode is enabled, as in the the attached patch (which also > takes the opportunity to wrap an overlong line in `ibuffer-map-lines'). Your analysis and patch makes sense to me. Please install, but add a brief comment explaining why we do that decrement there. Thanks. > In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version > 3.24.37, cairo version 1.17.6) of 2023-06-22 built on strobelfs > Repository revision: a23a09a82fc59402f1f7c23a46c65fc7001eecdf > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 > System Description: Linux From Scratch r11.3-65 > > Configured using: > 'configure -C --with-xwidgets 'CFLAGS=-Og -g3' > PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig' > > Configured features: > ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG > JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG > SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP > X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB > > diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el > index a26bb1811ec..50c3aeb7f62 100644 > --- a/lisp/ibuffer.el > +++ b/lisp/ibuffer.el > @@ -1872,7 +1872,8 @@ ibuffer-map-lines > (let ((result > (if (buffer-live-p (ibuffer-current-buffer)) > (when (or (null group) > - (when-let ((it (get-text-property (point) 'ibuffer-filter-group))) > + (when-let ((it (get-text-property > + (point) 'ibuffer-filter-group))) > (equal group it))) > (save-excursion > (funcall function > @@ -1897,7 +1898,9 @@ ibuffer-map-lines > (t > (cl-incf ibuffer-map-lines-count) > (forward-line 1))))) > - ibuffer-map-lines-count) > + (if (and (featurep 'ibuf-ext) ibuffer-auto-mode) > + (1- ibuffer-map-lines-count) > + ibuffer-map-lines-count)) > (progn > (setq buffer-read-only t) > (unless nomodify From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 10:18:59 2023 Received: (at 64230) by debbugs.gnu.org; 11 Sep 2023 14:18:59 +0000 Received: from localhost ([127.0.0.1]:54238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhkg-0006Ta-Sy for submit@debbugs.gnu.org; Mon, 11 Sep 2023 10:18:59 -0400 Received: from mout.gmx.net ([212.227.17.21]:39041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhkd-0006TK-6G for 64230@debbugs.gnu.org; Mon, 11 Sep 2023 10:18:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1694441924; x=1695046724; i=stephen.berman@gmx.net; bh=ICrvlqhYeDty819qNpsAK+RlsT/rRoLKKS5abUGTqHY=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=CSAGOzYbXnqQ9BtcnIv2cEJ7g4ReZ8RglXbQA2iHCjGRwatgyssuvVVebCqYJAfpukGBHst o6oO+X2+gac3h3b+6C0Mx+GP+C6TGHpNq42Z7EBtxx30NQJZ0o1tkgtmLs8RZy9k3Dj6XRZ2V /Ay1mHcuJMR0nmua95Tko31UBaT/kEsXpXQL8SoMHUmff7tkH7/eTzUa57mPs8iv9KMHabA2d 859TZEYzUqQH7erzSGJWPo1EqCTcxfcYKbehoMYtdjpSItz+iTAMz13lrgohiv2czt6P4k21c yVasxqkpMQtoeHUnMpXZuSNy5gX4XpSz/FqxLjr2iB97ICBXylpg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.196.156]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M3UZG-1qf9mb48vq-000fpa; Mon, 11 Sep 2023 16:18:44 +0200 From: Stephen Berman To: Stefan Kangas Subject: Re: bug#64230: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled In-Reply-To: (Stefan Kangas's message of "Sun, 10 Sep 2023 07:11:07 -0700") References: <874jmzo0wv.fsf@gmx.net> Date: Mon, 11 Sep 2023 16:18:43 +0200 Message-ID: <87cyyox070.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:2TuUnXK9kRKJ1wmZ+sGwRqYqlOd1gHjwW1qosdOU9zA//INe8LT 1Z23ILhdveUUv9mEUscLp6mg6/gLBLfqEfEnRrDoHnJPTTinFn7uNpHTcTYKcRZCs6VY7pg 21oPiucxbWXSqKUXvl6Bz0iTOyb4vFPJzHyi6hRKlUWJqb7xEYzSl0qIG1/x1QUn6p4PWDQ gkQ4y2JPgUZ1+hN/riXgg== X-Spam-Flag: NO UI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s-Envelope-To: 64230 Cc: 64230@debbugs.gnu.org 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: -1.7 (-) On Sun, 10 Sep 2023 07:11:07 -0700 Stefan Kangas wrote: > Stephen Berman writes: > >> 0. emacs -Q >> 1. Type `M-x' and then TAB to pop up the *Completions* buffer, then type >> `C-g'. >> 2. Type `M-x ibuffer'. >> 3. Type `d' on the lines for the buffers *scratch* and *Completions* to >> flag them for deletion. >> 4. Type `C-c C-a' to enable ibuffer-auto-mode. >> 5. Type `x' and at the prompt "Really kill 2 buffers? (y or n)" type `y'. >> => The *Ibuffer* lines for *scratch* and *Completions* are deleted and >> the echo area displays this message: "Operation finished; killed 3 >> buffers". >> >> If you change this recipe by omitting step 4, then after the buffer >> lines are deleted the message displayed is "Operation finished; killed 2 >> buffers". >> >> The unexpected message with ibuffer-auto-mode enabled is displayed in >> Emacs 27-30 but not in Emacs 26. With Emacs 27+, on typing `x' at step >> 5, the buffer *Ibuffer confirmation* pops up and a line for this buffer >> immediately appears in the *Ibuffer* display, and this is counted by the >> function `ibuffer-map-lines', and on typing `y' not only are the two >> flagged buffers deleted, but also *Ibuffer confirmation*, hence "killed >> 3 buffers". In contrast, in Emacs 26, the popped up buffer *Ibuffer >> confirmation* does not get added to the *Ibuffer* display and thus is >> not counted by `ibuffer-map-lines'. >> >> AFAICT, this difference is not due to any ibuffer code changes after >> Emacs 26; rather, there appears to be a timing difference with respect >> to when Emacs updates the *Ibuffer* display: when I instrument >> `ibuffer-update' for Edebug and then type `x' (step 5 above), what >> happens in Emacs 26 is that I can confirm with `y', then the flagged >> lines are deleted, and only then does Edebug stop the execution so I can >> step into `ibuffer-update'; while in Emacs 27+, as soon as I type `x', >> Edebug stops execution, i.e., before the flagged lines are deleted. >> >> `ibuffer-update' is called in `ibuffer-auto-update-changed', which is >> added to post-command-hook in `ibuffer-auto-mode'. So it seems that in >> Emacs 26 post-command-hook runs or takes effect later than in Emacs 27+. >> Whether this is really the case, and if so, what change it is due to, I >> haven't determined, and I don't know how restore the Emacs 26 execution >> order (or if that's even desirable). But even if the difference is due >> to something else, the message displayed in Emacs 27+ after the deletion >> of the *Ibuffer* lines is at least misleading, since it clearly is meant >> to refer only to the flagged lines, as in Emacs 26. >> >> In lieu of a real fix, since it is, AFAICS, only the transient buffer >> *Ibuffer confirmation* that results in the problematic message, a >> workaround is simply to decrement the line count by one when >> ibuffer-auto-mode is enabled, as in the the attached patch (which also >> takes the opportunity to wrap an overlong line in `ibuffer-map-lines'). > > Your analysis and patch makes sense to me. Please install, but add a > brief comment explaining why we do that decrement there. Done, and pushed as commit ca95e45f7e8. Thanks. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 10:45:03 2023 Received: (at 64230-done) by debbugs.gnu.org; 11 Sep 2023 14:45:03 +0000 Received: from localhost ([127.0.0.1]:54359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfi9v-0007CD-G6 for submit@debbugs.gnu.org; Mon, 11 Sep 2023 10:45:03 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:58571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfi9t-0007BR-F1 for 64230-done@debbugs.gnu.org; Mon, 11 Sep 2023 10:45:02 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2bceca8a41aso72473241fa.0 for <64230-done@debbugs.gnu.org>; Mon, 11 Sep 2023 07:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694443491; x=1695048291; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=mrf5bqv6F1nQcaqCl6lE8/X42wRmzs226QHOjuM0v74=; b=q68VQzkFhEdsLy+5Qbit4R9um8RKuDOMtU2eZg+62qfv8VnS8gCr1oikhEEJ4Btlht /P9IcQfoiLH8mKvHkbUHwR2Nh8MgeoAZXdXvjSDPgQa8JoZkT2wDlHkgxo6R0xjJUJwB g376oWlaU4SFRDiewRWStzfCZn8ERxRE4p6GUMQw4Gqr8d7VPEmjKKqeRYCEsyee7C1B dmmfTjon4T02Nc47ifaCtB+STjnc3HNqlSpqHRkUgbTbNnWqgzpE7SIvWP6BB7Cexs5f GFbgtea0CZGkxQccJNRtWlfd1lefWhKUboeXQu+XpiefFtNWXaCKEc9b7/FN5iWGz5cy VG5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694443491; x=1695048291; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mrf5bqv6F1nQcaqCl6lE8/X42wRmzs226QHOjuM0v74=; b=K1Iuf/asnKJJswpdBA4ecdF4HHSnL19FlsmjrXuNxbLTWlbq7ydVMwkOd6htg9j33p 7GjOq6xKHhIZpbhdSv+NNu1qBTVRFsSSMwngi4CbA4iHGFOE3/V8OEaeE/73B2AU9L9I W/mM9uAxYCA195TsXy3gH5vt4haJbtcNR/cwOOKqmuRZwyYHtvdryS9UCrGXUUCpw4Qy wwE0fL9CuZceWzq1oHR560cUD6e7H+JEnrTkEKgB73+mxO0gk1oU/wb6zyUgvp3n4byr eVzEIVFe8q+2zrafUynaKhtd/UHOLvMRgBsZ4ytZchiIeU7j/c4gVMpMFZonlTqP9PIs 0RCw== X-Gm-Message-State: AOJu0YwvPcfuxjrdJhQ6/xKYWEF/6lHTAmrNO37qaPqAGbZfB/Lwm5GK tQZXAhYaTI7rLk9TUut3cV4kkio4OCmNyaZyLB8= X-Google-Smtp-Source: AGHT+IEEgnfMVu7A09T5XQaJJc+jU/2d31HDB8p7opE+tO1hJDksx39BRASW/P+owVaSV9ZdbZDe5bHRnjyUt8ofy7E= X-Received: by 2002:a05:651c:82:b0:2bc:eea7:834e with SMTP id 2-20020a05651c008200b002bceea7834emr7195062ljq.40.1694443491009; Mon, 11 Sep 2023 07:44:51 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 11 Sep 2023 07:44:50 -0700 From: Stefan Kangas In-Reply-To: <87cyyox070.fsf@gmx.net> References: <874jmzo0wv.fsf@gmx.net> <87cyyox070.fsf@gmx.net> MIME-Version: 1.0 Date: Mon, 11 Sep 2023 07:44:50 -0700 Message-ID: Subject: Re: bug#64230: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled To: Stephen Berman Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64230-done Cc: 64230-done@debbugs.gnu.org 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: -1.0 (-) Version: 30.1 Stephen Berman writes: > Done, and pushed as commit ca95e45f7e8. Thanks. Thanks, I'm therefore closing the bug. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 13 14:52:06 2023 Received: (at 64230) by debbugs.gnu.org; 13 Sep 2023 18:52:07 +0000 Received: from localhost ([127.0.0.1]:36025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgUy6-0004uv-Al for submit@debbugs.gnu.org; Wed, 13 Sep 2023 14:52:06 -0400 Received: from mout.gmx.net ([212.227.17.22]:41455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgUy0-0004u8-0z for 64230@debbugs.gnu.org; Wed, 13 Sep 2023 14:52:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1694631107; x=1695235907; i=stephen.berman@gmx.net; bh=YfkfZDPnd6hjXw0Qx3lhtZWfIiVN/KM7UwKKj4MQcSU=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=FFSTwR+rnsVeQY3RKCDMbyJ+VnwIhb6ZHklC9P1TePXj2G68ZeUY+f7sy6skyXQAHo8FmYLj140 e/fGWB9eAnTohw9tzPMEjRBKeQA4/ujXtukfSU9Y0ebhh9+lEW8AJErno1kfraf93bNli5c3MjLGc SUN5DBX9d/Vj6E7/DgcIQ5xJ5qGXnryYMhKKYbZhJvuxOwog0Z+ZarKvdEvWXY/6j9+31Nw5OwN46 Gi+LakVLaukoLnpsLpi49T+P69T7wHBOlZj5M7r5kikdZeJR1mjh/hcX9jrMjayBuzBuwQRoDThNk Cvpew6Gsgpata2Ay23MhChBZoB1FnNDIRBzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.196.129]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M7K3Y-1qoDfj2sUG-007oSZ; Wed, 13 Sep 2023 20:51:47 +0200 From: Stephen Berman To: Stefan Kangas Subject: Re: bug#64230: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled In-Reply-To: <87cyyox070.fsf@gmx.net> (Stephen Berman's message of "Mon, 11 Sep 2023 16:18:43 +0200") References: <874jmzo0wv.fsf@gmx.net> <87cyyox070.fsf@gmx.net> Date: Wed, 13 Sep 2023 20:51:47 +0200 Message-ID: <87il8d9a9o.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:HAg4+3NzbwOYc7tC3HKB60LVRazFCkgsphmTZfEFyYum4FlhFHx tMvA/f2lfTfdVr08Mev8dp0gRyYfSGEdC7ZSGCVMuAgdvjm+No6hGIOTC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ZCnDEjePzpbSL+ImBBIEaEaCKB9EwBpqw22OxXVtYvVcYLpdu6EviUbTBRTEZ NuCC0g== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 64230 Cc: 64230@debbugs.gnu.org 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: -1.7 (-) --=-=-= Content-Type: text/plain On Mon, 11 Sep 2023 16:18:43 +0200 Stephen Berman wrote: > On Sun, 10 Sep 2023 07:11:07 -0700 Stefan Kangas wrote: > >> Stephen Berman writes: >> >>> 0. emacs -Q >>> 1. Type `M-x' and then TAB to pop up the *Completions* buffer, then type >>> `C-g'. >>> 2. Type `M-x ibuffer'. >>> 3. Type `d' on the lines for the buffers *scratch* and *Completions* to >>> flag them for deletion. >>> 4. Type `C-c C-a' to enable ibuffer-auto-mode. >>> 5. Type `x' and at the prompt "Really kill 2 buffers? (y or n)" type `y'. >>> => The *Ibuffer* lines for *scratch* and *Completions* are deleted and >>> the echo area displays this message: "Operation finished; killed 3 >>> buffers". >>> >>> If you change this recipe by omitting step 4, then after the buffer >>> lines are deleted the message displayed is "Operation finished; killed 2 >>> buffers". >>> >>> The unexpected message with ibuffer-auto-mode enabled is displayed in >>> Emacs 27-30 but not in Emacs 26. With Emacs 27+, on typing `x' at step >>> 5, the buffer *Ibuffer confirmation* pops up and a line for this buffer >>> immediately appears in the *Ibuffer* display, and this is counted by the >>> function `ibuffer-map-lines', and on typing `y' not only are the two >>> flagged buffers deleted, but also *Ibuffer confirmation*, hence "killed >>> 3 buffers". In contrast, in Emacs 26, the popped up buffer *Ibuffer >>> confirmation* does not get added to the *Ibuffer* display and thus is >>> not counted by `ibuffer-map-lines'. >>> >>> AFAICT, this difference is not due to any ibuffer code changes after >>> Emacs 26; rather, there appears to be a timing difference with respect >>> to when Emacs updates the *Ibuffer* display: when I instrument >>> `ibuffer-update' for Edebug and then type `x' (step 5 above), what >>> happens in Emacs 26 is that I can confirm with `y', then the flagged >>> lines are deleted, and only then does Edebug stop the execution so I can >>> step into `ibuffer-update'; while in Emacs 27+, as soon as I type `x', >>> Edebug stops execution, i.e., before the flagged lines are deleted. >>> >>> `ibuffer-update' is called in `ibuffer-auto-update-changed', which is >>> added to post-command-hook in `ibuffer-auto-mode'. So it seems that in >>> Emacs 26 post-command-hook runs or takes effect later than in Emacs 27+. >>> Whether this is really the case, and if so, what change it is due to, I >>> haven't determined, and I don't know how restore the Emacs 26 execution >>> order (or if that's even desirable). But even if the difference is due >>> to something else, the message displayed in Emacs 27+ after the deletion >>> of the *Ibuffer* lines is at least misleading, since it clearly is meant >>> to refer only to the flagged lines, as in Emacs 26. >>> >>> In lieu of a real fix, since it is, AFAICS, only the transient buffer >>> *Ibuffer confirmation* that results in the problematic message, a >>> workaround is simply to decrement the line count by one when >>> ibuffer-auto-mode is enabled, as in the the attached patch (which also >>> takes the opportunity to wrap an overlong line in `ibuffer-map-lines'). >> >> Your analysis and patch makes sense to me. Please install, but add a >> brief comment explaining why we do that decrement there. > > Done, and pushed as commit ca95e45f7e8. Thanks. Unfortunately, I didn't test that commit adequately before pushing it and have found two regressions it introduced: - If you delete exactly one buffer in Ibuffer with ibuffer-auto-mode enabled, it now emits the message "Operation finished; killed 0 buffers". - If you delete two buffers in Ibuffer with ibuffer-auto-mode enabled and with ibuffer-expert non-nil, it emits the message "Operation finished; killed 1 buffers" (in general, one less than the number of buffers deleted). The first attached patch fixes these regressions while retaining the improvement in ca95e45f7e8. While debugging I noticed two unrelated infelicities in the Ibuffer feedback: - The message reporting deletion of one buffer is grammatically incorrect: "killed 1 buffers". - If you type `x' in an Ibuffer buffer containing no marked buffer lines and with point not on one of the buffer lines (e.g. at (point-min) or (point-max)), you are prompted with "Really kill buffer *Ibuffer*? (y or n)" and if you type `y', the resulting message is "Operation finished; killed 0 buffers". This statement is correct, since no buffer was killed (without the first patch, the message is nonsensical: "killed -1 buffers"), but then Ibuffer appears to be ignoring the user's response to its prompt. However, I think the prompt itself is a mistake, and instead, Ibuffer should point out that there's no buffer on the current line and do nothing else (but again, only when there are no marked buffer lines.) The second attached patch fixes these problems (to see the effect I had to bootstrap; just regenerating ibuffer-loaddefs.el and loaddefs.el was insufficient). Should I install both patches? I've tested all combinations of deleting just one or more than buffer with ibuffer-auto-mode disabled and enabled and ibuffer-expert nil and non-nil, but perhaps I've again overlooked something, so I'll wait for a go-ahead. Also, since the second patch is strictly unrelated to the original bug report, a new bug report for it might be preferred. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: ibuffer-map-lines patch diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index b5a7f2d04e0..c30c38a90fd 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1898,14 +1898,17 @@ ibuffer-map-lines (t (cl-incf ibuffer-map-lines-count) (forward-line 1))))) - ;; With `ibuffer-auto-mode' enabled, the preceding loop - ;; counts the automatically popped up (and hence not - ;; user-marked) buffer "*Ibuffer confirmation*". Since - ;; Ibuffer reports how many user-marked buffers were acted - ;; upon, and in this case the reported count would be too - ;; high by one, we decrement the count to avoid the + ;; With `ibuffer-auto-mode' enabled, `ibuffer-expert' + ;; non-nil and more than one marked buffer lines, the + ;; preceding loop counts the automatically popped up (and + ;; hence not user-marked) buffer "*Ibuffer confirmation*". + ;; Since Ibuffer reports how many marked buffers lines were + ;; acted upon, and in this case the reported count would be + ;; too high by one, we decrement the count to avoid the ;; confusing message (see bug#64230). - (if (and (featurep 'ibuf-ext) ibuffer-auto-mode) + (if (and (featurep 'ibuf-ext) ibuffer-auto-mode + (> ibuffer-map-lines-count 1) + (not ibuffer-expert)) (1- ibuffer-map-lines-count) ibuffer-map-lines-count)) (progn --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: define-ibuffer-op patch diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index c38dfefe0c5..36616389f99 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el @@ -230,6 +230,9 @@ define-ibuffer-op (_ 'ibuffer-marked-buffer-names))))) (when (null marked-names) + (cl-assert (get-text-property (line-beginning-position) + 'ibuffer-properties) + nil "No buffer on this line") (setq marked-names (list (buffer-name (ibuffer-current-buffer)))) (ibuffer-set-mark ,(pcase mark (:deletion @@ -243,7 +246,9 @@ define-ibuffer-op ()) (and after `(,after)) ; post-operation form. `((ibuffer-redisplay t) - (message ,(concat "Operation finished; " opstring " %s buffers") count)))) + (message ,(concat "Operation finished; " opstring + " %s %s") + count (ngettext "buffer" "buffers" count))))) (inner-body (if complex `(progn ,@body) `(progn --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 13 16:58:26 2023 Received: (at 64230) by debbugs.gnu.org; 13 Sep 2023 20:58:26 +0000 Received: from localhost ([127.0.0.1]:36216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgWwI-0008D3-3D for submit@debbugs.gnu.org; Wed, 13 Sep 2023 16:58:26 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:49626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgWwC-0008Cl-Gb for 64230@debbugs.gnu.org; Wed, 13 Sep 2023 16:58:21 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-502984f5018so348309e87.3 for <64230@debbugs.gnu.org>; Wed, 13 Sep 2023 13:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694638685; x=1695243485; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=X9mbPOGT03s5MbE/CTuLagMtN129eSlQcZhyfZC3zY0=; b=VnHqdll9bLysaAjqYQ0r31UEM+XXjfOG+QDyEuwzvBQPrR+11gshwC4nTIH7o/4j63 jYAOCsMnyJbkhMT+HinyV2W3qFeMFHmKnosEza26ZKqgSqok2zv6xvPYzgBRhtqSKNa0 aYqPj0BOOkUDDYO61Czz/mDiA5ZLsb9+DGBVAt/AtzGQ3YxnNWwu0BUsPgZyh7qoY6M2 wCjGozVZFWOFUcxB7daHBTGddlO9t7A6V9WoYRh9eTvuae0iwg7ospn9+oslIsReAr05 XvRU51wCcG87jr7n6qT/VB999Ij793SYIOFW77AQSAf+u4Od39qN7WQP930mHKuzYmv8 h1Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694638685; x=1695243485; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X9mbPOGT03s5MbE/CTuLagMtN129eSlQcZhyfZC3zY0=; b=psFh0IIEuqEXcHC62l0K8Kwf9ITptk7vt7JticC8TM7vlFExtLbvrsAKuI5DrNW+41 oXo6FlNmEFumuYiEhfKU7Xrt7ARBbERPyFTGJSpNILT3O+24RCbFK9IWO6+g9+jqPZ3+ Bi68nlw0k9SJxLsczzF1cF+EiH07Fj20ksj2LMYYkzW4MtPCaC3YPa+dQBMpaggu1VRD NqaF7J4/pFyplruvS6KqOEzP/Nn36dPPMPatEYEZ4RLynT1Q3eQj92VcHBfTvBM/xWSj YQ+uoqYK+E7G8VI7yu2Rbu1wu258Xfzq8qArYiZmqcUl7ioAFdUUfVj3bteJETb+ARuu uD2Q== X-Gm-Message-State: AOJu0Yzhx00BDBWzpI9r1JOcTHrmSxMR2mq2ziuQkV/acFmYCVYNrJ9J ZBnfS5YMl8XKh7u2p/UokN29iv7IiYonAdcOI1hkiUsxSso= X-Google-Smtp-Source: AGHT+IHjWpAvTN7wn1iKVM0tGWspLUI1V+J0yGAX5iNKaIenTafJgKkAIWjqUS0roSriRTCGPzPymi2dzE5UCrqq96c= X-Received: by 2002:a19:6508:0:b0:4fe:25bc:71f5 with SMTP id z8-20020a196508000000b004fe25bc71f5mr2811605lfb.11.1694638684407; Wed, 13 Sep 2023 13:58:04 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 13 Sep 2023 13:58:03 -0700 From: Stefan Kangas In-Reply-To: <87il8d9a9o.fsf@gmx.net> References: <874jmzo0wv.fsf@gmx.net> <87cyyox070.fsf@gmx.net> <87il8d9a9o.fsf@gmx.net> MIME-Version: 1.0 Date: Wed, 13 Sep 2023 13:58:03 -0700 Message-ID: Subject: Re: bug#64230: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled To: Stephen Berman Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64230 Cc: 64230@debbugs.gnu.org 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: -1.0 (-) Stephen Berman writes: > Should I install both patches? I've tested all combinations of deleting > just one or more than buffer with ibuffer-auto-mode disabled and enabled > and ibuffer-expert nil and non-nil, but perhaps I've again overlooked > something, so I'll wait for a go-ahead. Thanks, please install. Your reasoning and patches make sense to me, though I only gave them the most cursory testing. > Also, since the second patch is strictly unrelated to the original bug > report, a new bug report for it might be preferred. I don't have any preference. Perhaps it's fine to keep it in the same report since the issue was discovered here. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 13 17:50:13 2023 Received: (at 64230) by debbugs.gnu.org; 13 Sep 2023 21:50:13 +0000 Received: from localhost ([127.0.0.1]:36283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgXkT-0003pY-2m for submit@debbugs.gnu.org; Wed, 13 Sep 2023 17:50:13 -0400 Received: from mout.gmx.net ([212.227.17.21]:58167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgXkQ-0003pF-BW for 64230@debbugs.gnu.org; Wed, 13 Sep 2023 17:50:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1694641798; x=1695246598; i=stephen.berman@gmx.net; bh=FDMkAfpvWViKe9TWq0KAp43UAHW9jy8VsU4HG6cy634=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Krk0YzVgJB+7oqW1YiiW0bZML1kaYBk6GdEMSnKzfVBKgWjVtYcdeF08K2U1baEZmCxQOJNPlSk ssY8OWa3lOCNIgWnGDSkeaTEBUgyN9vWZK9Gvuwa8vuUIRjGeylkarFxrgO6JK3A9WsXHb5nmVZmq XsAjm0DII2HpUo9aAU6s5rlL1bD6Q6Q+BUGuuqlFalZ/NQJz496hA4Yw86vdcs95ZkRkwf8Q1ifOf w0x0FyXF4l8eWIOylvOIyd8DmF1P+i54hcN0BeWQsJ9yOZhy1OzVd+6QRyfgVy7OdUoiW5N1zFaKy YYUM7WHX6AVq8yTi1Ki6ZfL1uD8weDFaqOng== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.196.129]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MSbx3-1r9RZX0KL3-00StsM; Wed, 13 Sep 2023 23:49:58 +0200 From: Stephen Berman To: Stefan Kangas Subject: Re: bug#64230: 30.0.50; Ibuffer reports 1 file too many with ibuffer-auto-mode enabled In-Reply-To: (Stefan Kangas's message of "Wed, 13 Sep 2023 13:58:03 -0700") References: <874jmzo0wv.fsf@gmx.net> <87cyyox070.fsf@gmx.net> <87il8d9a9o.fsf@gmx.net> Date: Wed, 13 Sep 2023 23:49:57 +0200 Message-ID: <87edj1920q.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K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rhEhIpgqI6wJ+2 CS3ad9rsAYTCF08D30TfB0q8s8dV8rQRbLJ4ScdqSjTRNf6L9wgRO92CzIZ94LlfiJPIiv04v WJUOfdoalngSqipn0zu99IIWS0dcvwbi/AYwxrFFkI49N8PjEQFswTHFFEQLko+jNVctFabcp bpMR6w== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 64230 Cc: 64230@debbugs.gnu.org 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: -1.7 (-) On Wed, 13 Sep 2023 13:58:03 -0700 Stefan Kangas wrote: > Stephen Berman writes: > >> Should I install both patches? I've tested all combinations of deleting >> just one or more than buffer with ibuffer-auto-mode disabled and enabled >> and ibuffer-expert nil and non-nil, but perhaps I've again overlooked >> something, so I'll wait for a go-ahead. > > Thanks, please install. Your reasoning and patches make sense to me, > though I only gave them the most cursory testing. > >> Also, since the second patch is strictly unrelated to the original bug >> report, a new bug report for it might be preferred. > > I don't have any preference. Perhaps it's fine to keep it in the same > report since the issue was discovered here. Thanks, I went ahead and pushed both patches (after fixing a small typo in the comment to read "`ibuffer-expert' nil") as commit 9d9570bfbf5. Steve Berman From unknown Mon Jun 23 14:59:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Oct 2023 11:24:09 +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