GNU bug report logs - #24855
26.0.50; Buffer-menu-no-header fails if fake header starts with white space

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Wed, 2 Nov 2016 05:23:01 UTC

Severity: normal

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24855 in the body.
You can then email your comments to 24855 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24855; Package emacs. (Wed, 02 Nov 2016 05:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 Nov 2016 05:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Buffer-menu-no-header fails if fake header starts with
 white space
Date: Wed, 2 Nov 2016 14:21:46 +0900 (JST)
emacs -r -Q -eval "(setq Buffer-menu-use-header-line nil)"
C-x C-b C-x o
M-: (Buffer-menu-no-header) RET
=> t


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 7385a0952923cc3ec435fe9097cd5c81da4c59eb Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 2 Nov 2016 14:14:58 +0900
Subject: [PATCH] Buffer-menu-no-header: Detect a fake header

* lisp/buff-menu.el (Buffer-menu-no-header): Match fake
headers starting with a white space (Bug#24855).
---
 lisp/buff-menu.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 4742628..41bcfab 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -328,7 +328,7 @@ Buffer-menu-buffer
 (defun Buffer-menu-no-header ()
   (beginning-of-line)
   (if (or Buffer-menu-use-header-line
-	  (not (eq (char-after) ?C)))
+	  (not (looking-at-p "^ ?C")))
       t
     (ding)
     (forward-line 1)
-- 
2.10.1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.2)
 of 2016-11-02 built on calancha-pc
Repository revision: c3640fcc96ed80368209c73d7ac9a0f0d1833d93




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24855; Package emacs. (Wed, 02 Nov 2016 07:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 24855 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24855 <at> debbugs.gnu.org
Subject: Re: bug#24855: 26.0.50;
 Buffer-menu-no-header fails if fake header starts with white space
Date: Wed, 02 Nov 2016 16:47:45 +0900
Or we might add a new predicate `tabulated-list-no-header-p':

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 91c45beea1ea8bfc4931f03ef391ffbe15e99c64 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 2 Nov 2016 16:38:23 +0900
Subject: [PATCH] Buffer-menu-no-header: Detect a fake header

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-no-header-p):
New predicate.
* lisp/buff-menu.el (Buffer-menu-no-header): Use it (Bug#24855).
---
 lisp/buff-menu.el                 | 2 +-
 lisp/emacs-lisp/tabulated-list.el | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 4742628..22f7abe 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -328,7 +328,7 @@ Buffer-menu-buffer
 (defun Buffer-menu-no-header ()
   (beginning-of-line)
   (if (or Buffer-menu-use-header-line
-	  (not (eq (char-after) ?C)))
+	  (tabulated-list-no-header-p (point)))
       t
     (ding)
     (forward-line 1)
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 00b029d..415cd24 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -257,6 +257,9 @@ tabulated-list-print-fake-header
                     (make-overlay (point-min) (point))))
       (overlay-put tabulated-list--header-overlay 'face 'underline))))
 
+(defsubst tabulated-list-no-header-p (&optional pos)
+  (null (overlays-at (or pos (point-min)))))
+
 (defun tabulated-list-revert (&rest ignored)
   "The `revert-buffer-function' for `tabulated-list-mode'.
 It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
@@ -312,7 +315,7 @@ tabulated-list-print
 method which is faster if most entries haven't changed since the
 last print.  The only difference in outcome is that tags will not
 be removed from entries that haven't changed (see
-`tabulated-list-put-tag').  Don't use this immediately after
+(erase-buffer)`tabulated-list-put-tag').  Don't use this immediately after
 changing `tabulated-list-sort-key'."
   (let ((inhibit-read-only t)
 	(entries (if (functionp tabulated-list-entries)
-- 
2.10.1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.5 (x86_64-pc-linux-gnu, GTK+ Version 3.22.2)
 of 2016-11-02 built on calancha-pc
Repository revision: 126c879df42f741fe486236aea538290a8c2ed64




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24855; Package emacs. (Wed, 02 Nov 2016 08:53:02 GMT) Full text and rfc822 format available.

Message #11 received at 24855 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 24855 <at> debbugs.gnu.org
Subject: Re: bug#24855: 26.0.50;
 Buffer-menu-no-header fails if fake header starts with white space
Date: Wed, 02 Nov 2016 09:52:16 +0100
On Nov 02 2016, Tino Calancha <tino.calancha <at> gmail.com> wrote:

> @@ -312,7 +315,7 @@ tabulated-list-print
>  method which is faster if most entries haven't changed since the
>  last print.  The only difference in outcome is that tags will not
>  be removed from entries that haven't changed (see
> -`tabulated-list-put-tag').  Don't use this immediately after
> +(erase-buffer)`tabulated-list-put-tag').  Don't use this immediately after

Paste accident?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24855; Package emacs. (Wed, 02 Nov 2016 09:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 24855 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Tino Calancha <tino.calancha <at> gmail.com>, 24855 <at> debbugs.gnu.org
Subject: Re: bug#24855: 26.0.50;
 Buffer-menu-no-header fails if fake header starts with white space
Date: Wed, 02 Nov 2016 18:50:20 +0900
Andreas Schwab <schwab <at> suse.de> writes:

> On Nov 02 2016, Tino Calancha <tino.calancha <at> gmail.com> wrote:
>
>> @@ -312,7 +315,7 @@ tabulated-list-print
>>  method which is faster if most entries haven't changed since the
>>  last print.  The only difference in outcome is that tags will not
>>  be removed from entries that haven't changed (see
>> -`tabulated-list-put-tag').  Don't use this immediately after
>> +(erase-buffer)`tabulated-list-put-tag').  Don't use this immediately after
>
> Paste accident?
Yes, thank you!  That happens when i have long nails.  Time to cut...
Here is the corrected patch:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From da5331dbb415f0779e36b15cbe1c943ee00f8081 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 2 Nov 2016 18:43:44 +0900
Subject: [PATCH] Buffer-menu-no-header: Detect a fake header

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-no-header-p):
New predicate.
* lisp/buff-menu.el (Buffer-menu-no-header): Use it (Bug#24855).
---
 lisp/buff-menu.el                 | 2 +-
 lisp/emacs-lisp/tabulated-list.el | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 4742628..22f7abe 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -328,7 +328,7 @@ Buffer-menu-buffer
 (defun Buffer-menu-no-header ()
   (beginning-of-line)
   (if (or Buffer-menu-use-header-line
-	  (not (eq (char-after) ?C)))
+	  (tabulated-list-no-header-p (point)))
       t
     (ding)
     (forward-line 1)
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 00b029d..590bcbc 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -257,6 +257,9 @@ tabulated-list-print-fake-header
                     (make-overlay (point-min) (point))))
       (overlay-put tabulated-list--header-overlay 'face 'underline))))
 
+(defsubst tabulated-list-no-header-p (&optional pos)
+  (null (overlays-at (or pos (point-min)))))
+
 (defun tabulated-list-revert (&rest ignored)
   "The `revert-buffer-function' for `tabulated-list-mode'.
 It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
-- 
2.10.1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.5 (x86_64-pc-linux-gnu, GTK+ Version 3.22.2)
 of 2016-11-02 built on calancha-pc
Repository revision: 126c879df42f741fe486236aea538290a8c2ed64




Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Tue, 22 Nov 2016 06:58:01 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Tue, 22 Nov 2016 06:58:02 GMT) Full text and rfc822 format available.

Message #19 received at 24855-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24855-done <at> debbugs.gnu.org
Subject: Re: bug#24855: 26.0.50;
 Buffer-menu-no-header fails if fake header starts with white space
Date: Tue, 22 Nov 2016 15:57:07 +0900
Tino Calancha <tino.calancha <at> gmail.com> writes:

> emacs -r -Q -eval "(setq Buffer-menu-use-header-line nil)"
> C-x C-b C-x o
> M-: (Buffer-menu-no-header) RET
> => t
Pushed fix to master branch as commit: 4940e0f




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Dec 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.