From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Tino Calancha <tino.calancha@gmail.com>
Newsgroups: gmane.emacs.bugs
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
Message-ID: <87zili6wir.fsf@gmail.com>
References: <alpine.DEB.2.20.1611021421040.3905@calancha-pc>
	<87lgx2b9we.fsf@gmail.com> <mvmmvhifem7.fsf@hawking.suse.de>
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: blaine.gmane.org 1478080306 11246 195.159.176.226 (2 Nov 2016 09:51:46 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 2 Nov 2016 09:51:46 +0000 (UTC)
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
Cc: 24855@debbugs.gnu.org, Tino Calancha <tino.calancha@gmail.com>
To: Andreas Schwab <schwab@suse.de>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 02 10:51:42 2016
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1c1sCQ-0007fC-48
	for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 10:51:14 +0100
Original-Received: from localhost ([::1]:53667 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1c1sCR-0006Tn-Oo
	for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 05:51:15 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54200)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1c1sCK-0006Th-8H
	for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2016 05:51:09 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1c1sCF-00049I-Bh
	for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2016 05:51:08 -0400
Original-Received: from debbugs.gnu.org ([208.118.235.43]:52612)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
	id 1c1sCF-000499-7x
	for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2016 05:51:03 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1c1sCF-0004hY-17
	for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2016 05:51:03 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Tino Calancha <tino.calancha@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 02 Nov 2016 09:51:02 +0000
Resent-Message-ID: <handler.24855.B24855.147808023318019@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 24855
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
Original-Received: via spool by 24855-submit@debbugs.gnu.org id=B24855.147808023318019
	(code B ref 24855); Wed, 02 Nov 2016 09:51:02 +0000
Original-Received: (at 24855) by debbugs.gnu.org; 2 Nov 2016 09:50:33 +0000
Original-Received: from localhost ([127.0.0.1]:39776 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1c1sBk-0004gY-SK
	for submit@debbugs.gnu.org; Wed, 02 Nov 2016 05:50:33 -0400
Original-Received: from mail-pf0-f195.google.com ([209.85.192.195]:32911)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <tino.calancha@gmail.com>) id 1c1sBj-0004gJ-6C
	for 24855@debbugs.gnu.org; Wed, 02 Nov 2016 05:50:31 -0400
Original-Received: by mail-pf0-f195.google.com with SMTP id a136so1340751pfa.0
	for <24855@debbugs.gnu.org>; Wed, 02 Nov 2016 02:50:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version;
	bh=WIK7FCIjU+ZPvuK8O4iO4Xaf8KGHfPB10mJwAhyt+ik=;
	b=zjozjZQ0TR7QFvScZSxfojAxnFhQ2L7DdjsgH/5IhXX0G20GTa2mj145JmqolI2ITz
	AdVGZoFoB/DYxqWrc3uFYseworP/9a/A2DD4ER34yrlphVdjXqh117MHkJMBvSP4Pc+j
	RryFrLEOe8s/kilsWTupBrve/fCbqTJNgN/0YDiOSrVziEhFrz4ciVTXzO53gLSjtIVF
	cNvyuxwrUTtjQ2hlQyXDxiyvzomngTeBInv6OEcxrHkyWUwk1dI2OcfT2Fvx+soo0rBG
	veMudsnvIGpm4kuuAsNX5OtZXGxCstHhpjbr/JnozOxEwvSixERCJQmy4cuBrMVHNrT6
	7tQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
	:message-id:user-agent:mime-version;
	bh=WIK7FCIjU+ZPvuK8O4iO4Xaf8KGHfPB10mJwAhyt+ik=;
	b=Z8sXXBQp0AN7jqo+iFoYtHEFAiSP93MtnxOq72yoTSqNz5pQDCoQlt9MpnB2uKB6DU
	/djSUcyeXuNeOyybFe7B8m5mcGFpgHBtfLv5BIrJRq786TemLMkHcIpWeP+uN5T4z1TZ
	n/O0HVjATdaYa9i8Dx/ZGAV4iAyMoXh4b9zr2tAxTo3GLBvSuP3kHcH1/CHhp8knxrEx
	LQsmPW+jAeIgAA4dvDd/T7a4DvPIQB6JFHxgz7d5TPvYjtNqopWNwQGdt2UB4whwd37G
	IviQtHVM+Rj90Pa5rK6W6+HDimhwxiBsRBNnFTar/XMAYtOK99CAKDqVCgpb2z5B7/Aw
	Wr2w==
X-Gm-Message-State: ABUngvcQampbdv1dRTvsk/ksk535FFzX1Zt5lNqNfY0SDoeOQ2xwM6V7qCQlLwZqc1XS4g==
X-Received: by 10.98.66.149 with SMTP id h21mr5299479pfd.32.1478080225182;
	Wed, 02 Nov 2016 02:50:25 -0700 (PDT)
Original-Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57])
	by smtp.gmail.com with ESMTPSA id
	w24sm3239758pfa.12.2016.11.02.02.50.23
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Wed, 02 Nov 2016 02:50:24 -0700 (PDT)
In-Reply-To: <mvmmvhifem7.fsf@hawking.suse.de> (Andreas Schwab's message of
	"Wed, 02 Nov 2016 09:52:16 +0100")
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs/>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
	<bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.bugs:125265
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/125265>

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).
---
 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