From: Tino Calancha <tino.calancha@gmail.com>
To: Andreas Schwab <schwab@suse.de>
Cc: 24855@debbugs.gnu.org, Tino Calancha <tino.calancha@gmail.com>
Subject: 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 [thread overview]
Message-ID: <87zili6wir.fsf@gmail.com> (raw)
In-Reply-To: <mvmmvhifem7.fsf@hawking.suse.de> (Andreas Schwab's message of "Wed, 02 Nov 2016 09:52:16 +0100")
Andreas Schwab <schwab@suse.de> writes:
> On Nov 02 2016, Tino Calancha <tino.calancha@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@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).
---
| 2 +-
lisp/emacs-lisp/tabulated-list.el | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
--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
next prev parent reply other threads:[~2016-11-02 9:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-02 5:21 bug#24855: 26.0.50; Buffer-menu-no-header fails if fake header starts with white space Tino Calancha
2016-11-02 7:47 ` Tino Calancha
2016-11-02 8:52 ` Andreas Schwab
2016-11-02 9:50 ` Tino Calancha [this message]
2016-11-22 6:57 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zili6wir.fsf@gmail.com \
--to=tino.calancha@gmail.com \
--cc=24855@debbugs.gnu.org \
--cc=schwab@suse.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).