GNU bug report logs - #39149
27.0.50; describe-buffer-bindings is calling :filter function in wrong buffer

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: yyoncho <yyoncho@HIDDEN>; dated Thu, 16 Jan 2020 07:00:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 15 Nov 2020 16:28:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 15 11:28:59 2020
Received: from localhost ([127.0.0.1]:54019 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keKtf-00077w-AO
	for submit <at> debbugs.gnu.org; Sun, 15 Nov 2020 11:28:59 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46694)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keKtb-00077g-VG
 for 39149 <at> debbugs.gnu.org; Sun, 15 Nov 2020 11:28:58 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44245)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keKtV-0006W3-Vd; Sun, 15 Nov 2020 11:28:50 -0500
Received: from [176.228.60.248] (port=2518 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1keKtU-0005OB-BG; Sun, 15 Nov 2020 11:28:49 -0500
Date: Sun, 15 Nov 2020 18:28:38 +0200
Message-Id: <83ima6twi1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkmk11-Nez+u5zCS9g5zzsgPqSG2eaU-6jEw7LLm=RHXmeQ@HIDDEN>
 (message from Stefan Kangas on Sun, 15 Nov 2020 08:08:18 -0800)
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmrKwmm90gWU+bC5=KbjajiCYGbXrtBV3cgfK4N0-y=7Q@HIDDEN>
 <83k0umtzv6.fsf@HIDDEN>
 <CADwFkmk11-Nez+u5zCS9g5zzsgPqSG2eaU-6jEw7LLm=RHXmeQ@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 39149
Cc: larsi@HIDDEN, 39149 <at> debbugs.gnu.org, yyoncho@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Kangas <stefankangas@HIDDEN>
> Date: Sun, 15 Nov 2020 08:08:18 -0800
> Cc: larsi@HIDDEN, yyoncho@HIDDEN, 39149 <at> debbugs.gnu.org
> 
> > If adding an argument is deemed not a good idea, how about binding a
> > special variable to convey that information to
> > describe-buffer-bindings?
> 
> Yes, that could be a third option c).  Personally, I like option b)
> better.

If we need to insert stuff into a buffer, why make it a string and
then insert? why not insert directly?  The latter means less consing,
so less GC.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 15 Nov 2020 16:08:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 15 11:08:27 2020
Received: from localhost ([127.0.0.1]:54010 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keKZn-0006f6-Hd
	for submit <at> debbugs.gnu.org; Sun, 15 Nov 2020 11:08:27 -0500
Received: from mail-ed1-f42.google.com ([209.85.208.42]:38348)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1keKZk-0006er-FJ
 for 39149 <at> debbugs.gnu.org; Sun, 15 Nov 2020 11:08:25 -0500
Received: by mail-ed1-f42.google.com with SMTP id y4so10362253edy.5
 for <39149 <at> debbugs.gnu.org>; Sun, 15 Nov 2020 08:08:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:in-reply-to:references:mime-version:date:message-id:subject:to
 :cc; bh=kXdJ62GmWvNW0/csyfG+3AFgo/X7Jl9VoY/vBgiOOyQ=;
 b=PkD30xu7kOC/CqIO0lhsCBq46J3i2u5h/zBJQvgGl2EtAWMhBNnMgfpli+cnkXNnow
 utPU4+c+sYIec6YMZ1hBsA31Izw1jg0ThkzqjQdU8lNWxAetUSkkNp403yVB1IOoRlu7
 kX4UziARrR4nsjJyO+MRbw8or1fR1wItOkhAFgfafNx+8LGL7nh9v+PmvLPk3MmHkPDD
 dlRWl+WbhgrUE1q6RPMVIOtaM0OMVoxhiVD0Bgp0p65MQs1a01NqeJH6wV5nGSF1qRsy
 AWQfdPllpZYglu9jRe5vD1BkD+SH/zGH7m2qq7HEd3Yt395AOP999tfZxT775un4KHy5
 /bMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:mime-version:date
 :message-id:subject:to:cc;
 bh=kXdJ62GmWvNW0/csyfG+3AFgo/X7Jl9VoY/vBgiOOyQ=;
 b=p3PVGViEwUwfqNsPNjwlFTq1sQLJqoLPAWV++4F9WylaBbGo/z1imvLlK217rdTMq3
 DXlvDNEYwKDFt/mqZ+lQ+81sH/8oHA4cbKgtqnL0mv5Y9C1XfdDKHLcR1Hrs/06+ParD
 V9S4y65gAXb4viusG35dJBG2evcn+i/H44rfIR3MCLdc6QXwXVuzS6oMzvzxA3eM3j/e
 r2T12+qvD0Ex65YK2YLculXacIgrBa7Om5D44ecQ0mo9TbXKn4Ev9MUJtEpgjsosFdM8
 xGR5/jyO2uOWKd8Q7uYgB0x3sEnVkmT/RFbZAEjww41imz4MRAXxf3izfjs3d9vAwegJ
 SgWQ==
X-Gm-Message-State: AOAM532yDePipkhGtqsWI+l3JA1km6pjLPoa/sW6SZgZDjAXpQNF8wAp
 dmgbPRNckpbWTYH8mq3Mb+MhZnArieq25Va2j/k=
X-Google-Smtp-Source: ABdhPJy1WKW9FDdtVFZVzR6vU13DqVDguFzA4IBRu7AbZpsqW61khaaHlGliJjylez0qjvIz6m8vLVLfoapOikU6g1E=
X-Received: by 2002:a50:e443:: with SMTP id e3mr12316040edm.160.1605456498677; 
 Sun, 15 Nov 2020 08:08:18 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 15 Nov 2020 08:08:18 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <83k0umtzv6.fsf@HIDDEN>
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmrKwmm90gWU+bC5=KbjajiCYGbXrtBV3cgfK4N0-y=7Q@HIDDEN>
 <83k0umtzv6.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sun, 15 Nov 2020 08:08:18 -0800
Message-ID: <CADwFkmk11-Nez+u5zCS9g5zzsgPqSG2eaU-6jEw7LLm=RHXmeQ@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: larsi@HIDDEN, 39149 <at> debbugs.gnu.org, yyoncho@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Stefan Kangas <stefankangas@HIDDEN>
>> Date: Sat, 14 Nov 2020 16:24:07 -0800
>> Cc: 39149 <at> debbugs.gnu.org
>>
>> a) Add a new argument to describe-map with the original buffer.  Ensure
>>    that the :filter function is run there.
>>
>> b) Change describe-map to return its output as a string.
>
> Unless I'm missing something, b) would be a backward-incompatible
> change, so I don't think we should consider it.

No: `describe-map' was added on master a month ago as a Lisp translation
of the old C function "describe_map".  It has never been exposed to Lisp
directly, but was used internally on the C level by
`substitute-command-keys' and `describe-buffer-bindings'.

What is true is that:

- `substitute-command-keys' has always returned a string.
- `describe-buffer-bindings' has always inserted into the current
  buffer.

Whether we go with option a) or b) shouldn't need to change that.

So we should think carefully about what their interface should be rather
than nail it down to match the old C code.

BTW, while we're on it, I'm not at all sure it would make sense to use
these functions outside of help.el.  I think we might want to consider
renaming `describe-map' to `help--describe-map', and similarly for
`describe-map-tree'.

> If adding an argument is deemed not a good idea, how about binding a
> special variable to convey that information to
> describe-buffer-bindings?

Yes, that could be a third option c).  Personally, I like option b)
better.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 15 Nov 2020 15:16:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 15 10:16:14 2020
Received: from localhost ([127.0.0.1]:53963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keJlF-0005PH-TY
	for submit <at> debbugs.gnu.org; Sun, 15 Nov 2020 10:16:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34924)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keJlE-0005P5-Dd
 for 39149 <at> debbugs.gnu.org; Sun, 15 Nov 2020 10:16:12 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43492)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keJl9-0006tl-03; Sun, 15 Nov 2020 10:16:07 -0500
Received: from [176.228.60.248] (port=1864 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1keJl8-0007Cl-C0; Sun, 15 Nov 2020 10:16:06 -0500
Date: Sun, 15 Nov 2020 17:15:57 +0200
Message-Id: <83k0umtzv6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkmmrKwmm90gWU+bC5=KbjajiCYGbXrtBV3cgfK4N0-y=7Q@HIDDEN>
 (message from Stefan Kangas on Sat, 14 Nov 2020 16:24:07 -0800)
Subject: Re: bug#39149: 27.0.50;
 describe-buffer-bindings is calling :filter function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmrKwmm90gWU+bC5=KbjajiCYGbXrtBV3cgfK4N0-y=7Q@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 39149
Cc: larsi@HIDDEN, 39149 <at> debbugs.gnu.org, yyoncho@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Kangas <stefankangas@HIDDEN>
> Date: Sat, 14 Nov 2020 16:24:07 -0800
> Cc: 39149 <at> debbugs.gnu.org
> 
> a) Add a new argument to describe-map with the original buffer.  Ensure
>    that the :filter function is run there.
> 
> b) Change describe-map to return its output as a string.

Unless I'm missing something, b) would be a backward-incompatible
change, so I don't think we should consider it.

If adding an argument is deemed not a good idea, how about binding a
special variable to convey that information to
describe-buffer-bindings?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 15 Nov 2020 00:24:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 14 19:24:15 2020
Received: from localhost ([127.0.0.1]:52277 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ke5q3-0002LC-LF
	for submit <at> debbugs.gnu.org; Sat, 14 Nov 2020 19:24:15 -0500
Received: from mail-ej1-f47.google.com ([209.85.218.47]:43010)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1ke5q1-0002Ky-QG
 for 39149 <at> debbugs.gnu.org; Sat, 14 Nov 2020 19:24:14 -0500
Received: by mail-ej1-f47.google.com with SMTP id me8so19261801ejb.10
 for <39149 <at> debbugs.gnu.org>; Sat, 14 Nov 2020 16:24:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:in-reply-to:references:mime-version:date:message-id:subject:to
 :cc; bh=FjhL5W8baXKbyjHGRCyfE/ON/PnwzJGoJ3jHsEDCiro=;
 b=qMd1wNERPyvcHv918HLqdwdl7fkRZSD/hAdx2Zw60RNwOWFfEJEJ1PXIkrAETdUTEn
 UzsfQTFhRapAx0bs4vCvO5ZIHA18VZEcmsCM7u6fHGUbm1n1EGVa7HBogOenpPwG8vrJ
 jOK0p2khBGFEwj+sIe5FS3tH4Jt77NnpjGOIiRxdQ4ih4V3pkGDAcAUsDxjmlc7XtLZf
 N+g42jj2fqCuhvgX4HpfAx5hN1qnmtrKB6mwGXkOJD68lYbu1Lfzk/aXn3kZHBmgsEtX
 74XjqpztVOFgzsJtuLkudY2ci0ZjnxHki7dlmKVHVinfEBOREE7EP6OxYGhsWy1ivRRh
 Yn7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:mime-version:date
 :message-id:subject:to:cc;
 bh=FjhL5W8baXKbyjHGRCyfE/ON/PnwzJGoJ3jHsEDCiro=;
 b=nfWnFj+Li/S6CGDNn2W/E/YrxFxqBdH/d2GSnQsZE3heWcyeEX9A0E+GDz426ctZw8
 7pTwT2IQoNVJ80bJBx8VhkyQjrNUXOG+kX1n3p0EznQtfePvbY6cPDcapnTzT2KLDT+u
 nIxzdpXYwO86uF0wxi8G4h1ImUn59XaCmO3fp4ZjC3t5pPqwJiKLy1otAMPPSajOHbPE
 mpuL76zEP6SDHmlST1akPzYuKkO0IAHfq/nxUCa+qjgyat0rysOnZk1Uz8ZhlyWBNHKQ
 Yq09621cXCb26SkW+Qqd+Zcf8TYjeY/eqAeZEycT7MsI6yKqQ0w0yegYsM9TNYNlCrPl
 0IqA==
X-Gm-Message-State: AOAM531YPgwOanzy/+5qmt5IvraA3tZCwby5tTZYCHtfrBC7fiZWpRnb
 vMGb1JsvnTf7ySMC2CfW9idr0Q4D1vBsKrfAfHg=
X-Google-Smtp-Source: ABdhPJynDipTzRAWxE386i25N7IVrsdFJvKV/sJ0wxAQ129DHsAptSQ2DlneAaLJ3lABZtl/nN76bexLL+oY32jw1vs=
X-Received: by 2002:a17:906:ce24:: with SMTP id
 sd4mr8323990ejb.432.1605399847776; 
 Sat, 14 Nov 2020 16:24:07 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 14 Nov 2020 16:24:07 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87361vhjxu.fsf@HIDDEN>
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sat, 14 Nov 2020 16:24:07 -0800
Message-ID: <CADwFkmmrKwmm90gWU+bC5=KbjajiCYGbXrtBV3cgfK4N0-y=7Q@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Lars Ingebrigtsen <larsi@HIDDEN>, yyoncho <yyoncho@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> yyoncho <yyoncho@HIDDEN> writes:
>
>> To reproduce (eval in scratch buffer)
>> (define-key global-map (kbd "C-c C-l r")
>>   `(menu-item "2" switch-to-buffer
>>               :filter ,(lambda (cmd)
>>                          (print (format "Called in %s" (current-buffer)))
>>                          cmd)))
>> (with-temp-buffer
>>   (with-output-to-string
>>     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
>>
>> This outputs:
>>
>> \"Called in  *temp*\"
>
> I tried this recipe, but I'm not getting the :filter function called at
> all.  Do you have a recipe, starting from "emacs -Q", that reproduces
> this bug?

I have pushed a fix to master (f08e6538dc) ensuring that we correctly
run the :filter function.

The bug can now be reproduced (on master and 26.3) using:

(progn
  (require 'ert)
  (let (was-in-buffer)
    (unwind-protect
        (progn
          (define-key global-map (kbd "C-c C-l r")
            `(menu-item "2" identity
                        :filter ,(lambda (cmd)
                                   (setq was-in-buffer
                                         (current-buffer))
                                   cmd)))
          (with-temp-buffer
            (let ((buf (get-buffer "*scratch*")))
              (describe-buffer-bindings buf nil t)
              (should was-in-buffer)
              (should (eq was-in-buffer buf)))))
      (define-key global-map (kbd "C-c C-l r") nil)
      (define-key global-map (kbd "C-c C-l") nil))))

As Andreas Schwab has pointed out, the problem is that describe-map (and
describe_map before it) has no idea about the buffer argument to
describe-bindings.  So if the above is to be made to work, we have to
make sure that it does.

I see two ways of doing that:

a) Add a new argument to describe-map with the original buffer.  Ensure
   that the :filter function is run there.

b) Change describe-map to return its output as a string.

The problem with a) is that describe-map already has a pretty long
argument list.  It also seems to me that the resulting code would not be
very easy to follow.

My preference would therefore be looking into option b) first.
If we can make it work, we could then just change the buffer in
describe-buffer-bindings before calling describe-map.

(It is true that the old C function "describe_map" has always inserted
its output in the current buffer.  It also true that it has always been
an internal function, and never exposed to Lisp directly.  So we should
be free to change its behavior, and we should probably better do it
before Emacs 28.1.)

Thoughts?

---

Also, a tangent:

IMHO, using `menu-item' in this way works as it stands, but it is a bit
strange conceptually.  We are binding a key to a `menu-item' that is
never intended to be used for a menu.  Yet IIUC this is the recommended
way of using :filter.

It would perhaps be better to have a specific format that allows for
these extended features, without needing to provide a `menu-item'.

(See `(elisp) Format of Keymaps' for more.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 1 Nov 2020 17:01:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 12:01:58 2020
Received: from localhost ([127.0.0.1]:38349 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZGju-000281-Kf
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 12:01:58 -0500
Received: from mail-wr1-f45.google.com ([209.85.221.45]:46655)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1kZGjs-00027n-TL
 for 39149 <at> debbugs.gnu.org; Sun, 01 Nov 2020 12:01:57 -0500
Received: by mail-wr1-f45.google.com with SMTP id k10so10522305wrw.13
 for <39149 <at> debbugs.gnu.org>; Sun, 01 Nov 2020 09:01:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=tcd-ie.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=zVLjjqeKEXl6LMiP/y9E+32290/UWer5DJ3OR++nEog=;
 b=D/PPfX5hVgYNrSt5viCPToQf9tXCIBFpa1X/T5UfjOBz3YtN59SaEbhnURyF0gB+u4
 T1GfvKy/rRRoX2vmMxXCPCa1oQXq/AIZ0Q9fUApTXENhIGE6r0yw/uhW0sT5Wrj1VrDP
 m7vVY4UEXjmpLA6+b04sX0lv7Er0wTfV9IBBen6YdLKP6gS25BWznFWDtHEmmWrfgyE8
 vVf+ePAPtii/6vbzPTVC3Mxh/gD8d/IIZ1mm2jEaxBVJrdcmovSegmDb3WYIt7X3L8Qd
 bWRtoTIwpEwjk6fcHaMRvxummEAJKl6pwz6BUrIiSjvCPqk6ON1hruDNtaW3IQllKoXs
 BqOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=zVLjjqeKEXl6LMiP/y9E+32290/UWer5DJ3OR++nEog=;
 b=EV+v3bSinb9QZFb24uiWeTCrRGvvHREJUnNeb3kvZfGn0p3/gDhLBpcm8Otj8VPjn2
 CMy0EToLNJk7J9Tukw6ZJyWC0aGnJO3/qg7Cn+SW2cO+0WfZD8NEBkhdBLdGu+XoBIce
 ezX9VRnUv2nsdoxUZZ/hQFuoZeHYiA/jdy9Hbz8sW+Mc1dx6dSMDkOFfZDiznNAO2ikS
 x9G3eGXx0xyN/QMkKs3VEungXHruclJAP7cdtPeHKjsULtpNFEMSPg5RAwXIFjBgqI52
 YVat1OQUC97D/lIH1RaffOJzAQ0MjmfhQFWoF6BKhpldV/RLdV+WxOcTPpZ61gjP/0Pb
 P22w==
X-Gm-Message-State: AOAM531FQxyjxZ/XB9f2QoF3LTu8pPNa85RrpGNPJJDi1cZcBad3MINd
 8+og/w2wjwVOqPAs8DMvDIcnUw==
X-Google-Smtp-Source: ABdhPJw12Q6zxY8IMDWMoJvpoBDfy3U862ZubiFFc+OIQD1z6NRi4vAx5jZb3tUJGtiU6vYzjBX48g==
X-Received: by 2002:a5d:66c9:: with SMTP id k9mr16784019wrw.158.1604250110972; 
 Sun, 01 Nov 2020 09:01:50 -0800 (PST)
Received: from localhost ([51.37.36.100])
 by smtp.gmail.com with ESMTPSA id b2sm8491158wmd.40.2020.11.01.09.01.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 01 Nov 2020 09:01:50 -0800 (PST)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
 <871rhflhfv.fsf@HIDDEN>
 <CADwFkm=LE7QtAp-7d_Yqc0PZwSVsfazhwBAfEQwBCRPawDeNhA@HIDDEN>
Date: Sun, 01 Nov 2020 17:01:49 +0000
In-Reply-To: <CADwFkm=LE7QtAp-7d_Yqc0PZwSVsfazhwBAfEQwBCRPawDeNhA@HIDDEN>
 (Stefan Kangas's message of "Sun, 1 Nov 2020 06:56:17 -0800")
Message-ID: <87wnz5c8oy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Kangas <stefankangas@HIDDEN> writes:

> "Basil L. Contovounesios" <contovob@HIDDEN> writes:
>
>> FWIW, emacs-27 and master behave differently in this respect;
>> see e.g. https://github.com/abo-abo/swiper/issues/2709.
>>
>> The headings used to be inserted in the current buffer along with the
>> bindings, but the headings alone are now printed to standard-output
>> instead.
>>
>> Is that a problem?
>
> Yes, it is a bug.  I have pushed a fix to master.  Could you please test
> that it works for you?

Thanks, it does.

> (The fix should mean that you don't have to bind `standard-output' in
> swiper.)

Done.

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 1 Nov 2020 14:56:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 09:56:27 2020
Received: from localhost ([127.0.0.1]:38096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZEmR-0000zF-GU
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 09:56:27 -0500
Received: from mail-ej1-f45.google.com ([209.85.218.45]:46671)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1kZEmO-0000z7-00
 for 39149 <at> debbugs.gnu.org; Sun, 01 Nov 2020 09:56:24 -0500
Received: by mail-ej1-f45.google.com with SMTP id w13so1582714eju.13
 for <39149 <at> debbugs.gnu.org>; Sun, 01 Nov 2020 06:56:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:in-reply-to:references:mime-version:date:message-id:subject:to
 :cc; bh=KHctgnqI491yWxV+4Kz+ZHqT1H9Iq1cE4CfJHRs9ppY=;
 b=LWMxDv7G2wfibTRWre9aaNInXYLnm0KHF10GzmAnxi4T3kXY/6qS+3Fxv5aDCbQPTb
 VjvHCmi9NqMj5eicoxtgKGva/bG9Y9Ig/dLlFBTiLrf1230nrUcjQGi11HibTQgoWlsn
 anDtumRFgqNihdkig5Zk6ZaWsDSp3OuT9NboCxsWdThwihqF24XFY/DyDo9cSiVaQUZ3
 CP945VisSQmbifqIEg7UkdZWfttSREjw2Qwjl8I1JOXTeesPMIcf22XUOHOsH4Ux3aYq
 AfOYaB5xaOV7LzgKqjXtkf4AdHzuUZpCIh7/24eSuCVcIKuVEamo0kikZp8BurT6MFym
 sBEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:mime-version:date
 :message-id:subject:to:cc;
 bh=KHctgnqI491yWxV+4Kz+ZHqT1H9Iq1cE4CfJHRs9ppY=;
 b=VwNcSv86KNhD+YZNVCLSEIY5bHFufHprYi6/qb4USn3zVN9crheLq9kxZqRRT4LMXB
 kiOwAsaq4VXRvXzMTKUlKW/K4i+8yVMiMBISIsvxz8ZkU7aMZbwrrZDHcb9h1b06GZQt
 QY9mRC7aTR0t/NAvSc9R2xlaEQyCI6R2cYC+XIIHU/HTVGPbH2aHlo0jf1dKzbiWI9l9
 WkKyt06YaiQi0UnPJs0BG17Iy7b1/vgXqeA7vwV+QSrqFOhXxPgiduc+rZKg3RLgaz8+
 aeE7OymWt1i7sEA6kd1re9t/2IvX/0BSbQqRYutCO7f7sKj8PqowbVs28pwbBKkGitkw
 hZBA==
X-Gm-Message-State: AOAM531AuK1EpU1650RVwlzwzs6OnG6h9IfOItiV6JhRU8liEDZXS1wE
 9jRrCtstgYPo/QM8F/qs68hbV6vKSn6iPKeERSQ=
X-Google-Smtp-Source: ABdhPJz/4NI18inBvJ9z4T8TB37UNgZfERrLSy+BZKLlBMAtfiLI9Ong9VVV+Y3nwkY2oKfNLwgS54J296Dq4QZgXYs=
X-Received: by 2002:a17:906:8058:: with SMTP id
 x24mr11673551ejw.272.1604242578088; 
 Sun, 01 Nov 2020 06:56:18 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 1 Nov 2020 06:56:17 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <871rhflhfv.fsf@HIDDEN>
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
 <871rhflhfv.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sun, 1 Nov 2020 06:56:17 -0800
Message-ID: <CADwFkm=LE7QtAp-7d_Yqc0PZwSVsfazhwBAfEQwBCRPawDeNhA@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 39149 <at> debbugs.gnu.org,
 yyoncho <yyoncho@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"Basil L. Contovounesios" <contovob@HIDDEN> writes:

> FWIW, emacs-27 and master behave differently in this respect;
> see e.g. https://github.com/abo-abo/swiper/issues/2709.
>
> The headings used to be inserted in the current buffer along with the
> bindings, but the headings alone are now printed to standard-output
> instead.
>
> Is that a problem?

Yes, it is a bug.  I have pushed a fix to master.  Could you please test
that it works for you?

(The fix should mean that you don't have to bind `standard-output' in
swiper.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 1 Nov 2020 04:31:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 01 00:31:21 2020
Received: from localhost ([127.0.0.1]:35395 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZ51V-0003L5-Js
	for submit <at> debbugs.gnu.org; Sun, 01 Nov 2020 00:31:21 -0400
Received: from mail-ed1-f54.google.com ([209.85.208.54]:45218)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1kZ51T-0003Ks-90
 for 39149 <at> debbugs.gnu.org; Sun, 01 Nov 2020 00:31:20 -0400
Received: by mail-ed1-f54.google.com with SMTP id dg9so10705339edb.12
 for <39149 <at> debbugs.gnu.org>; Sat, 31 Oct 2020 21:31:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:in-reply-to:references:mime-version:date:message-id:subject:to
 :cc; bh=hu8kiB5dBgQQRO8KTcTAlwak2krmjF3VqaAXbtEiPxo=;
 b=rkZX2eSl7U1k8UJxRdVHIU9Wsl0dLJUe8LAHdIvmfzuICj2z3InBkzG3UWbLduxGR4
 qED6weDPOWC/AMlr66oNcZSTybK9pmP1DJHg/uoCPS06IXo7TxSqg4BSIehFnWI+qrzz
 /iaQimFXErr+94gNg3FgwE0gsoqxGK2LkJibwLcetSzwnHI7BnQV06K81vZ2K0mf34Xk
 YSckszin90lte0a/ZR+AoEGay7wDJ0qjVrdkYFj0jsMMkrrgzhbIABmBufLKWAG15b1V
 2dSo4nmfGufzADL/aIo7D2qzDiAXNs2b9RXQ+ixC+XmeG/6sVWNnPBTxHPxlfSd0JHVl
 HnCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:mime-version:date
 :message-id:subject:to:cc;
 bh=hu8kiB5dBgQQRO8KTcTAlwak2krmjF3VqaAXbtEiPxo=;
 b=Zxzb0XmM2JcEHSoNYjuJGfzh8TDj+kiHQX6m7M2w6E1g09BAKKSJQTMySuHxXYx6g+
 520fZVsna/4u061FIKitNCra5SVibH+OPi0NfPZRkoPCA9z2NdBt3f6RC+Ggfu7tC3zD
 qGyvvj8/yGpvpawEK4QR3OQSw/BYiv4JT4ISxlq2vKKIYviVdhgotR+XxQX24j/Dtj31
 wY+bw7Xa1uvH4bq0kkBrZPsg11MoV9uk5viaMRMRlwvfpw7AujXiGdDshEtYSwi9TOkK
 XNot/e8J7RcJ31okfehdaBB+fmLtpvVrznu/hgDklJYGqwRl4MkZHKtcP9BL6O4E5MjL
 FCIg==
X-Gm-Message-State: AOAM532/NCd9gFT/+fUrP6iC2IUAVGySqNgNjnX8cOBGrxaem/a6+mWa
 yql6rM1wN5CYDSCUCPaJyRY76xcgj/Q6tyo4siU=
X-Google-Smtp-Source: ABdhPJwd9a+iQ8WZZ7NJ1E5cbX0J1wQb2ipPj2rQ231xYT7zMPHe7PT3ZjBENpymoAYdL674ibv7TCyAsGwI/bTizJw=
X-Received: by 2002:a50:9f61:: with SMTP id b88mr220916edf.282.1604205073441; 
 Sat, 31 Oct 2020 21:31:13 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 31 Oct 2020 21:31:12 -0700
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
MIME-Version: 1.0
Date: Sat, 31 Oct 2020 21:31:12 -0700
Message-ID: <CADwFkm=i6cT9FeP8xh09n9PGki-0=xru06=JQELs_A+Mr2BYEQ@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Lars Ingebrigtsen <larsi@HIDDEN>, yyoncho <yyoncho@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Kangas <stefankangas@HIDDEN> writes:

>>> To reproduce (eval in scratch buffer)
>>> (define-key global-map (kbd "C-c C-l r")
>>>   `(menu-item "2" switch-to-buffer
>>>               :filter ,(lambda (cmd)
>>>                          (print (format "Called in %s" (current-buffer)))
>>>                          cmd)))
>>> (with-temp-buffer
>>>   (with-output-to-string
>>>     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
>>>
>>> This outputs:
>>>
>>> \"Called in  *temp*\"
>>
>> I tried this recipe, but I'm not getting the :filter function called at
>> all.  Do you have a recipe, starting from "emacs -Q", that reproduces
>> this bug?
>
> I can reproduce the above on Emacs 26.3, but not on master.

This change in behavior was caused by this commit:

commit 8a1441310aa151e739cfed3bd2eff3358edc8001
Author: Stefan Kangas <stefan@HIDDEN>
Date:   Sun Oct 18 15:32:22 2020 +0200

    Prefer Lisp version of describe-map-tree

So as suspected, there is a difference in behavior between the new Lisp
version of describe-map-tree and the new C version.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 18:03:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 14:03:43 2020
Received: from localhost ([127.0.0.1]:59629 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYYkZ-00033s-5m
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 14:03:43 -0400
Received: from mail-wr1-f48.google.com ([209.85.221.48]:35049)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1kYYkW-00033e-U3
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 14:03:41 -0400
Received: by mail-wr1-f48.google.com with SMTP id n15so7462622wrq.2
 for <39149 <at> debbugs.gnu.org>; Fri, 30 Oct 2020 11:03:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=tcd-ie.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=RYq2FhHbF3dvcRV9V77KnOGMF6BrwX1S+OZFQ15sUlA=;
 b=KsXhsJCN3o1JB7u6iy1le2ng9y7Fwo/jnAy6IOwkhZpNBi/uKAXve4Tx0aA41wAxc8
 sTw+EAb3B6UZe6fIvKDUCWBfoFM9zU3OBbu+SQtFcu7M2vsdZavPvzrt1iOhuliAgC7U
 NDNON+pCVpaZl8ChT9khbCpqVPJJLSftKc1EBbihj/Y8VthIYe2cyD0myqsiHFnECZqB
 0dGogjRWtzSasnqaUu+znVaZdeiyjbm7qYliDaamD/x/K/wIUx1F5QaxqjBQM3akvy7Q
 e5Y3H7OvQyqcJFmGnQuGbGb2t0dvZSJCicrJjnTUL5TuRKPpBMw3lSSlGUOIXy9TusUV
 vHig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=RYq2FhHbF3dvcRV9V77KnOGMF6BrwX1S+OZFQ15sUlA=;
 b=sgppElL/9ls9Tab6/N6bttajOwVhH7talguD/nq9bL6tH44hYPK6rGzTACgq8JI3S5
 NKPwY3nEGvUOeiWsWTzSaNVar8hM6tf8xCyAR9GiZnqUCoWkKzvMrw8QCSOLyPlWKdhX
 KDd70h1iz2eqTjE2yN7q++lo+EdWeJHqAwpd1fbucV67lHhbkJXO6e7Oyv7Unv2pAYqY
 mdB3UFNIoUUZ2sat/37yWg2SIghAYDHfelo+bl1Z/t8NQPJD1PdzWrzdQmYj6bCN0ktZ
 XGKD/MRrlqMcq1uEIIom77bHGSeYIrGy+splnneTyKRGzZSzjSBmMbxtDQhgBoSLETBd
 Rzhw==
X-Gm-Message-State: AOAM5332Fxqck3F5Q3ZLKjcTmExdQzHOczXODUL8uqVYKHPZlMzcjDl6
 IQ7/0Pyf1f+IDYT0HzNJjVxFRA==
X-Google-Smtp-Source: ABdhPJwMcvlCK4RrRQnNrQkFmawnl1OG4Tp1tJlDzUZdjF372wAV7POJwU0Ij6FLcnz53Y3ridYfwQ==
X-Received: by 2002:a5d:40d2:: with SMTP id b18mr4768560wrq.155.1604081015020; 
 Fri, 30 Oct 2020 11:03:35 -0700 (PDT)
Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2])
 by smtp.gmail.com with ESMTPSA id 24sm5272060wmf.44.2020.10.30.11.03.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Oct 2020 11:03:33 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
 <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
Date: Fri, 30 Oct 2020 18:03:32 +0000
In-Reply-To: <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
 (Stefan Kangas's message of "Fri, 30 Oct 2020 16:16:35 +0000")
Message-ID: <871rhflhfv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 39149 <at> debbugs.gnu.org,
 yyoncho <yyoncho@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Kangas <stefankangas@HIDDEN> writes:

> Note that there might have been changes here with the merge of
> scratch/substitute-command-keys.  I tried hard to not introduce any
> regressions or even changes in behavior with that branch, but I might
> have failed to include the above bug...
>
> What is the result output here?  Here, the last form evaluates to this
> on master:
>
> "
> Global Bindings Starting With C-c C-l:
> key             binding
> ---             -------
>
> 
> Function key map translations Starting With C-c C-l:
> key             binding
> ---             -------
>
> "

FWIW, emacs-27 and master behave differently in this respect;
see e.g. https://github.com/abo-abo/swiper/issues/2709.

The headings used to be inserted in the current buffer along with the
bindings, but the headings alone are now printed to standard-output
instead.

Is that a problem?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 16:46:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 12:46:20 2020
Received: from localhost ([127.0.0.1]:59509 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYXXg-00015S-BF
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:46:20 -0400
Received: from mail-out.m-online.net ([212.18.0.10]:38478)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <whitebox@HIDDEN>) id 1kYXXd-00015F-Qr
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:46:19 -0400
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 4CN7Vc4J9Hz1rvyK;
 Fri, 30 Oct 2020 17:46:16 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 4CN7Vc2Pqhz1qv5K;
 Fri, 30 Oct 2020 17:46:16 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id U9cYQRdICZzL; Fri, 30 Oct 2020 17:46:15 +0100 (CET)
X-Auth-Info: BSZwD+iz7hEgq9DRV2MKPb2He9BTlXkKc6mj2j1NqgDpzOTMX8/vfVEphLtGVz+G
Received: from igel.home (ppp-46-244-190-51.dynamic.mnet-online.de
 [46.244.190.51])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPSA;
 Fri, 30 Oct 2020 17:46:15 +0100 (CET)
Received: by igel.home (Postfix, from userid 1000)
 id C6D542C0BBF; Fri, 30 Oct 2020 17:46:14 +0100 (CET)
From: Andreas Schwab <schwab@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <874kmbbv78.fsf@HIDDEN>
 <CADwFkm=C_ZTGopkNkrp17Tv_L=KS6wkypL-7xh5g=iWuVe_D7A@HIDDEN>
X-Yow: Okay, BARBRA STREISAND, I recognize you now!!  Also EFREM ZIMBALIST,
 JUNIOR!!  And BEAUMONT NEWHALL!!  Everybody into th' BATHROOM!
Date: Fri, 30 Oct 2020 17:46:14 +0100
In-Reply-To: <CADwFkm=C_ZTGopkNkrp17Tv_L=KS6wkypL-7xh5g=iWuVe_D7A@HIDDEN>
 (Stefan Kangas's message of "Fri, 30 Oct 2020 16:23:30 +0000")
Message-ID: <87r1pfach5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org, yyoncho <yyoncho@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

On Okt 30 2020, Stefan Kangas wrote:

> BTW, does anyone know why describe-map and describe-map-tree currently
> inserts its result into buffer instead of just returning a string?

That's what they always did.  It's also more efficient.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 16:33:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 12:33:05 2020
Received: from localhost ([127.0.0.1]:59497 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYXKr-0000lV-5d
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:33:05 -0400
Received: from mail-lf1-f42.google.com ([209.85.167.42]:37192)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1kYXKp-0000l1-V5
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:33:04 -0400
Received: by mail-lf1-f42.google.com with SMTP id j30so8649512lfp.4
 for <39149 <at> debbugs.gnu.org>; Fri, 30 Oct 2020 09:33:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=M2hBYKkfTTxNXEtZZymy45MGtHe2/1UYR/T/Bjz0IRw=;
 b=OHwlpHIL8jIFkU+WXxs8ooG+S1N1q2yoq+fChVz5FUOYLsB1+mf2dXzW29TVram/x8
 ceChPfliG9bBu49g6g0BDZAsAJ50j6PEr9NYEDI/TcrldkkQ4v8G5LTPjo9Win7AGBjJ
 Rei5J4jMcBkDDCgmlOC0a4TzjfvB83/g7oAQdyLvKl7ce2Jq7bxpBA9t2osdSnujUkyX
 l+KLZEbGV0kONx38hrWFGcAoawodTQRVJl5RbXK42aEllA95ACSSm/lL5Hgioc584pDA
 m9R5x+P1rslTVjW4CfAb+F3QJJ3Vmxxq3yGsDLfeliIaNHYHZbR/OjI1xah6W61E1rzK
 USWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=M2hBYKkfTTxNXEtZZymy45MGtHe2/1UYR/T/Bjz0IRw=;
 b=trfVGQlSDs0sqY+Pv/G2WeHGKR7IujcpY7irugr//kcs91blr64gDGnY5KVyH90nQ4
 HOspx7z2TspzwCnAPV54uR+6I3qm3zdbFhI9OPsg+Kuig4tHkQKaZQgVOR/AiO768083
 /EQkiTX2MihYzrVtiMaLQ152N+dziYzEm0QxbhJRMvfWVRbbibvQP9EEru90sJp/NOdC
 mJvtm+XdnusVfVUt9EixeGHdS92jEJQif5Nxu0GmWVTovXmnotXCZjmGz2MlSHSRJHyv
 b94Ri2/IufLvNI5Wc6FqEu4kUpqyicnT7zyAoe07nNAonm4MP+Mru5UwtAuQ5THBSGwJ
 ewSQ==
X-Gm-Message-State: AOAM533ngKcnyYTADO+sY0jpw76TeY8AnvPxSs4/w1/3oKEtY+X67K1V
 TtlkyBIrjXXk4O9xM5wVsWmVsOEaNt3Ku8RoDKQ=
X-Google-Smtp-Source: ABdhPJy9XgWGkaC/oBA4gA6HgSvjAMFUdRIZqEPjN+Nrl8sQSTo+JN2F0pTfsulnolNxvrdLjbrBurTAJjDgGJDx1yU=
X-Received: by 2002:a19:4842:: with SMTP id v63mr1260667lfa.278.1604075577977; 
 Fri, 30 Oct 2020 09:32:57 -0700 (PDT)
MIME-Version: 1.0
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <874kmbbv78.fsf@HIDDEN>
 <CADwFkm=C_ZTGopkNkrp17Tv_L=KS6wkypL-7xh5g=iWuVe_D7A@HIDDEN>
In-Reply-To: <CADwFkm=C_ZTGopkNkrp17Tv_L=KS6wkypL-7xh5g=iWuVe_D7A@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Fri, 30 Oct 2020 18:32:46 +0200
Message-ID: <CACCVLQX8mGHdv-rr9G+S9aJpakzyRTJUUC9N39+jRQUO4w2KDA@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000004b1a505b2e5f363"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org, Andreas Schwab <schwab@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000004b1a505b2e5f363
Content-Type: text/plain; charset="UTF-8"

Even better will be if there is some intermediate structured result which
can be used by packages like which-key instead of parsing the string.

On Fri, Oct 30, 2020 at 6:23 PM Stefan Kangas <stefankangas@HIDDEN>
wrote:

> Andreas Schwab <schwab@HIDDEN> writes:
>
> > The problem is that describe-buffer-bindings only changes the buffer to
> > look up the bindings, but everything that generates the description
> > (starting with describe-map-tree) doesn't know about that other buffer.
>
> BTW, does anyone know why describe-map and describe-map-tree currently
> inserts its result into buffer instead of just returning a string?
>

--00000000000004b1a505b2e5f363
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Even better will be if there is some intermediate structur=
ed result which can be used by packages like which-key instead of parsing t=
he string.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gm=
ail_attr">On Fri, Oct 30, 2020 at 6:23 PM Stefan Kangas &lt;<a href=3D"mail=
to:stefankangas@HIDDEN">stefankangas@HIDDEN</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">Andreas Schwab &lt;<a href=
=3D"mailto:schwab@HIDDEN" target=3D"_blank">schwab@HIDDEN</=
a>&gt; writes:<br>
<br>
&gt; The problem is that describe-buffer-bindings only changes the buffer t=
o<br>
&gt; look up the bindings, but everything that generates the description<br=
>
&gt; (starting with describe-map-tree) doesn&#39;t know about that other bu=
ffer.<br>
<br>
BTW, does anyone know why describe-map and describe-map-tree currently<br>
inserts its result into buffer instead of just returning a string?<br>
</blockquote></div>

--00000000000004b1a505b2e5f363--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 16:23:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 12:23:39 2020
Received: from localhost ([127.0.0.1]:59469 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYXBi-0006qB-Ug
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:23:39 -0400
Received: from mail-ej1-f48.google.com ([209.85.218.48]:37866)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1kYXBh-0006px-1c
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:23:37 -0400
Received: by mail-ej1-f48.google.com with SMTP id p9so9423940eji.4
 for <39149 <at> debbugs.gnu.org>; Fri, 30 Oct 2020 09:23:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:in-reply-to:references:mime-version:date:message-id:subject:to
 :cc; bh=5Ti9lk676EtEajdskxb5q25pRV1Orx7EsA0/nAPAd28=;
 b=tAy+/TRAmqnvQsvGOgtAPM6x8pgqNvGbw2hc7690NVJVh4YhLG887LEGer+eN1gnvm
 BBJ22v5V4FmhVMp6H6cCprcuGNcK2Z8aVCwk9aBPHbA1MunJhDo2ftVnknRC/Y9BPAN6
 KcH4YMwjCe4ui7PDloHjkGuBOpwMnXBIjoQTL+dbzJQV43eEUpkp0m4ipkzuHtxhMPoj
 lsxBlePbKEnEsNjDmq7LSRvKeC+aDPdEyNcOBLo3g5WYpYiCqOd1gJ+BBkDGMGIY8vIP
 xz/jma3Jgg3Hm29ZLhmJt4rbcBVAruJj6f3ggRmvbxT2qTR7QpgtYlnPLmctJrD0jiDR
 QABg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:mime-version:date
 :message-id:subject:to:cc;
 bh=5Ti9lk676EtEajdskxb5q25pRV1Orx7EsA0/nAPAd28=;
 b=Qact0Zsi3cbuVP2Sbk4jx6KKbtb4W3cT7yHOBA4tQ0Jan5tYwIXdhYd6eF/H5ziXhP
 Y36MAnSy9IM6VKPmj2n39XHhouTCGoj8bmPt6DZAdkuWVrKMlO5xDtG6q+PfvvQfLuYM
 g0Wt3/rC59i8hmenKxvEZpXAxaCeDa6SNPSNw0lxVuH/Bln4B+ia8aX9JogR5txen4dp
 Ao7YEWOZE6fmnN7oBhmcRixROCVZVa6yubVrAmZWJ7pd5xiqMpwqkTtCoA2tdVvCyPHm
 d1AwD0fg1y5Mkj7zwBmIemkxt43z27OpUUJoIY7zankg7KoNK9bH7N3+UugmMmH17nX6
 hEFA==
X-Gm-Message-State: AOAM53378CLtCjjsXuWBCoo0WuNEgLkyODvMmD9fUCFxVlKKqC4b2dU3
 /f+5ZI8C7f9wSKbYSJcuxpRKue0JE1E9UmyphNxHFb3p
X-Google-Smtp-Source: ABdhPJwLdt7kzLuF16rgzwNO5eUVzZ681lIfnENZrsph1VcjQiNCHWIcbHMwCZRUzz8sYNTzarJuzxaBi220Ir4duYs=
X-Received: by 2002:a17:906:8058:: with SMTP id
 x24mr3373589ejw.272.1604075011340; 
 Fri, 30 Oct 2020 09:23:31 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 30 Oct 2020 16:23:31 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <874kmbbv78.fsf@HIDDEN>
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <874kmbbv78.fsf@HIDDEN>
MIME-Version: 1.0
Date: Fri, 30 Oct 2020 16:23:30 +0000
Message-ID: <CADwFkm=C_ZTGopkNkrp17Tv_L=KS6wkypL-7xh5g=iWuVe_D7A@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Andreas Schwab <schwab@HIDDEN>, yyoncho <yyoncho@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Andreas Schwab <schwab@HIDDEN> writes:

> The problem is that describe-buffer-bindings only changes the buffer to
> look up the bindings, but everything that generates the description
> (starting with describe-map-tree) doesn't know about that other buffer.

BTW, does anyone know why describe-map and describe-map-tree currently
inserts its result into buffer instead of just returning a string?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 16:16:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 12:16:43 2020
Received: from localhost ([127.0.0.1]:59436 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYX50-0006dx-St
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:16:43 -0400
Received: from mail-ed1-f53.google.com ([209.85.208.53]:36905)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1kYX4z-0006dl-Ls
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:16:42 -0400
Received: by mail-ed1-f53.google.com with SMTP id o18so7256135edq.4
 for <39149 <at> debbugs.gnu.org>; Fri, 30 Oct 2020 09:16:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:in-reply-to:references:mime-version:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=OQr9vDoad7z4V36vDgk1bM6UvYn+SicRsNdKaCp7yrI=;
 b=kPCDkb5xtuGQfhxTPQRlBO5sP/zYdhbAetVwgvOH1Dgv4sMNQTZNdTkXR55yAH/mP4
 evnIFTLKD/Y3vJTzBORNK8w3+a5294A2LSTiOyqGuQGSl8nnDX4u5v6Zt6KJeQ67QtpW
 oqu1CV93cCOEDoGYEzmqh08dmjj85ryCwbvurWVgNQuyXKElX5hyV52KmRY/AOyjrMEY
 Fy83YR4Wi1xjxJ1n/SsyyiX3zAfMk0cXTDB+5Fh41Kucv6IxTJLyts/QrhFsDQmCErWA
 vxpBPTylHqz0XtpKl0Xq7UcQ5MwYD2aLyQHKQqSDTKCNm8lVFVP73FW3zoVfkqU/9qUE
 D+pw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:mime-version:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=OQr9vDoad7z4V36vDgk1bM6UvYn+SicRsNdKaCp7yrI=;
 b=fpK45qN65BHYWWr9rePlz7tO+GmV4t3kz9m4MRxPsftS/yrz/U9yDEXC0BjPEWR7gP
 7gTZQFyKbp/Y0KmvPTG4IlydiPB5QMKu6gitquNMMIUiIQajmIzuDtNXIEX9mWJYSq1v
 fZwmC3hgz27VQJ7qEToTjrTx6x8srH4NWabcKZqxgnpM0AASByUVmG1zEaGN94f2GRm7
 wPdU9tWGTqfILix9M3P3M2Kcxq/UWj4XZiGQufQ1SLL+wPNkmo3ZMgpkRSyRWbuLwY51
 KFYrtqlBQQ22WiHq+oXDxeyD55oVWQGHOgk5BWfKAbuHnFRK1URudveyIPYrLlN4cXG+
 jDJw==
X-Gm-Message-State: AOAM530kJ5NhOc0Ki4c1sukRlrFcXp41829xlHM6M5t5UhpnLqoSDPsZ
 I7QobGB2+hIgoYYl0C8W17hsqC1p1xaurx+qApU=
X-Google-Smtp-Source: ABdhPJwFEBTxt31+THZfbn5b37dpH2+9mr3i94HlTsh0vtuuTV5LIsPuoRk9WAVlnciVzJSlcpHurj7wanH0gxoVloM=
X-Received: by 2002:aa7:d28c:: with SMTP id w12mr3365427edq.282.1604074595935; 
 Fri, 30 Oct 2020 09:16:35 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 30 Oct 2020 16:16:35 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87361vhjxu.fsf@HIDDEN>
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
MIME-Version: 1.0
Date: Fri, 30 Oct 2020 16:16:35 +0000
Message-ID: <CADwFkmmNmkpetini5NoLz3Bzv-KfMKdJ-BSDEvBVUjfHkV3Jqw@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Lars Ingebrigtsen <larsi@HIDDEN>, yyoncho <yyoncho@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> yyoncho <yyoncho@HIDDEN> writes:
>
>> To reproduce (eval in scratch buffer)
>> (define-key global-map (kbd "C-c C-l r")
>>   `(menu-item "2" switch-to-buffer
>>               :filter ,(lambda (cmd)
>>                          (print (format "Called in %s" (current-buffer))=
)
>>                          cmd)))
>> (with-temp-buffer
>>   (with-output-to-string
>>     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
>>
>> This outputs:
>>
>> \"Called in  *temp*\"
>
> I tried this recipe, but I'm not getting the :filter function called at
> all.  Do you have a recipe, starting from "emacs -Q", that reproduces
> this bug?
>
> And your report didn't include the data about the version generated by
> report-emacs-bug, so it's hard to guess whether bug is only on some
> specific system.

I can reproduce the above on Emacs 26.3, but not on master.

Note that there might have been changes here with the merge of
scratch/substitute-command-keys.  I tried hard to not introduce any
regressions or even changes in behavior with that branch, but I might
have failed to include the above bug...

What is the result output here?  Here, the last form evaluates to this
on master:

"=0C
Global Bindings Starting With C-c C-l:
key             binding
---             -------

=0C
Function key map translations Starting With C-c C-l:
key             binding
---             -------

"

Is this correct?  Should it do anything else in addition that it
currently does not?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 16:08:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 12:08:29 2020
Received: from localhost ([127.0.0.1]:59401 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYWx3-0006PM-BQ
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:08:29 -0400
Received: from mail-lj1-f171.google.com ([209.85.208.171]:34743)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1kYWx2-0006P8-6K
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 12:08:28 -0400
Received: by mail-lj1-f171.google.com with SMTP id y16so7510321ljk.1
 for <39149 <at> debbugs.gnu.org>; Fri, 30 Oct 2020 09:08:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=0IdOs1+O+UjV8iqV412P8ozruuAktwXgozXpuTHwdX8=;
 b=G/kiAEoaozwkNHdp0Rsac1Kh823citLisMrt3y/wpPIYgj9/go0qmw80ZHMfYPKKZD
 Bw+pOqmnwP81XPumrWJbo9UvcYT2zGJD55r3bCDIEHVoi10gZY8QbMwBGKmF3KwqQGon
 urblRd0Zbm03+5EAqttAELOuwrOi58W3VvpcLgIMwaKAV6DiI94idA81AXJISy7CVIiF
 e/h0XuLtf+5UN+LJUrFXhvws6oTtI6It76PUPZo6b92Tov6+XXZee+H/6mTlmZFJYoP0
 fctmnleovTjYXM4l76ESsrtHEdApLW7uJ3Lsuuk7DYN0uLzHqb/0iIDqJAtmKxh4V9Xy
 nzyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=0IdOs1+O+UjV8iqV412P8ozruuAktwXgozXpuTHwdX8=;
 b=H/EDGct8VZ5WdCf7JC+DhEebONA4zZbOG0KDYYckWcmUaybK+Lraqae93223/n45ql
 /omtMyCCc2u/0JUN1945jjF/L10Sd/iRpJEmyy7UtziY+GALVL8PpleR+W6HBw/m9mF8
 Cb7JctDql9P4ufHxGYuyXMAnWb0xYndrtdEDf7mSsXWFStDmnNjhqGofTqw/4BhgcCUO
 2H1HdoELcE6Eqo+yXKdY8xn4oWvLGU6MKAgqzPLEGdMJkWLOVH+reDM/Quj9HEID/tbl
 yo9nH5LG3bbQUCKPaUxMILemEaZpIk4EdRfXJ5QJBwijlzSJTLqNFMmAm7KfScQg15A9
 ui9w==
X-Gm-Message-State: AOAM533XvreW+83KWC4Ck2Pp5lgzW1TcSG1hMegc0NSysywUCxQdSTMv
 WObn2ABkBnTVULxfvjZ2+MqV5HnLjHfSkJcvBxc=
X-Google-Smtp-Source: ABdhPJyM7V22Md8L6jLwawTXi8AmcLvR61jWLh4bTa/zNtjzg3TlLveoAzl61vzpwyeCpOfxuLYHOrka/FXobT9QumI=
X-Received: by 2002:a2e:b4fa:: with SMTP id s26mr1440467ljm.133.1604074102127; 
 Fri, 30 Oct 2020 09:08:22 -0700 (PDT)
MIME-Version: 1.0
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 <87361vhjxu.fsf@HIDDEN>
In-Reply-To: <87361vhjxu.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Fri, 30 Oct 2020 18:08:10 +0200
Message-ID: <CACCVLQUWy5r7quZyNpxi+0f4ckbLvQL3kpJhW3LmcsdPa2pXQw@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
To: Lars Ingebrigtsen <larsi@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000000d020005b2e59b36"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000000d020005b2e59b36
Content-Type: text/plain; charset="UTF-8"

I tested with emacs27.1

emacs27.1 -q

Then pasted the code in scratch buffer, evaluated, and reproduced the
described behaviour.


Thanks,
Ivan


On Fri, Oct 30, 2020 at 4:23 PM Lars Ingebrigtsen <larsi@HIDDEN> wrote:

> yyoncho <yyoncho@HIDDEN> writes:
>
> > To reproduce (eval in scratch buffer)
> > (define-key global-map (kbd "C-c C-l r")
> >   `(menu-item "2" switch-to-buffer
> >               :filter ,(lambda (cmd)
> >                          (print (format "Called in %s" (current-buffer)))
> >                          cmd)))
> > (with-temp-buffer
> >   (with-output-to-string
> >     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
> >
> > This outputs:
> >
> > \"Called in  *temp*\"
>
> I tried this recipe, but I'm not getting the :filter function called at
> all.  Do you have a recipe, starting from "emacs -Q", that reproduces
> this bug?
>
> And your report didn't include the data about the version generated by
> report-emacs-bug, so it's hard to guess whether bug is only on some
> specific system.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

--0000000000000d020005b2e59b36
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I tested with emacs27.1<div><br></div><div>emacs27.1 -q=C2=
=A0</div><div><br></div><div>Then pasted the code in scratch buffer, evalua=
ted, and reproduced the described behaviour.</div><div><br></div><div><br><=
/div><div>Thanks,</div><div>Ivan</div><div><br></div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Oct 30, 2020=
 at 4:23 PM Lars Ingebrigtsen &lt;<a href=3D"mailto:larsi@HIDDEN" target=
=3D"_blank">larsi@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex">yyoncho &lt;<a href=3D"mailto:yyoncho@HIDDEN" =
target=3D"_blank">yyoncho@HIDDEN</a>&gt; writes:<br>
<br>
&gt; To reproduce (eval in scratch buffer)<br>
&gt; (define-key global-map (kbd &quot;C-c C-l r&quot;) <br>
&gt;=C2=A0 =C2=A0`(menu-item &quot;2&quot; switch-to-buffer<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:filter ,(lambda=
 (cmd)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 (print (format &quot;Called in %s&quot; (current-buffe=
r)))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 cmd)))<br>
&gt; (with-temp-buffer<br>
&gt;=C2=A0 =C2=A0(with-output-to-string<br>
&gt;=C2=A0 =C2=A0 =C2=A0(describe-buffer-bindings (get-buffer &quot;*scratc=
h*&quot;) [3 12] t)))<br>
&gt;<br>
&gt; This outputs:<br>
&gt;<br>
&gt; \&quot;Called in=C2=A0 *temp*\&quot;<br>
<br>
I tried this recipe, but I&#39;m not getting the :filter function called at=
<br>
all.=C2=A0 Do you have a recipe, starting from &quot;emacs -Q&quot;, that r=
eproduces<br>
this bug?<br>
<br>
And your report didn&#39;t include the data about the version generated by<=
br>
report-emacs-bug, so it&#39;s hard to guess whether bug is only on some<br>
specific system.<br>
<br>
-- <br>
(domestic pets only, the antidote for overdose, milk.)<br>
=C2=A0 =C2=A0bloggy blog: <a href=3D"http://lars.ingebrigtsen.no" rel=3D"no=
referrer" target=3D"_blank">http://lars.ingebrigtsen.no</a><br>
</blockquote></div>

--0000000000000d020005b2e59b36--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 15:16:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 11:16:33 2020
Received: from localhost ([127.0.0.1]:59270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYW8n-00027Q-Jx
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 11:16:33 -0400
Received: from mail-out.m-online.net ([212.18.0.10]:45017)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <whitebox@HIDDEN>) id 1kYW8l-00024j-CQ
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 11:16:32 -0400
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 4CN5W20kjdz1rvxn;
 Fri, 30 Oct 2020 16:16:30 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 4CN5W175TKz1qv52;
 Fri, 30 Oct 2020 16:16:29 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id BU6A41Mi8DVv; Fri, 30 Oct 2020 16:16:29 +0100 (CET)
X-Auth-Info: nuEXJkOdRCuFM0GX8IUBfflR6u4IG3xo6rxOViLfORRa5batC1w0LeKlq7zPQLck
Received: from igel.home (ppp-46-244-190-51.dynamic.mnet-online.de
 [46.244.190.51])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPSA;
 Fri, 30 Oct 2020 16:16:28 +0100 (CET)
Received: by igel.home (Postfix, from userid 1000)
 id BB85D2C0B97; Fri, 30 Oct 2020 16:16:27 +0100 (CET)
From: Andreas Schwab <schwab@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
X-Yow: Maybe we could paint GOLDIE HAWN a rich PRUSSIAN BLUE--
Date: Fri, 30 Oct 2020 16:16:27 +0100
In-Reply-To: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 (yyoncho@HIDDEN's message of "Thu, 16 Jan 2020 08:59:12 +0200")
Message-ID: <874kmbbv78.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

On Jan 16 2020, yyoncho wrote:

> To reproduce (eval in scratch buffer)
>
> (define-key global-map (kbd "C-c C-l r")
>   `(menu-item "2" switch-to-buffer
>               :filter ,(lambda (cmd)
>                          (print (format "Called in %s" (current-buffer)))
>                          cmd)))
> (with-temp-buffer
>   (with-output-to-string
>     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
>
> This outputs:
>
> \"Called in  *temp*\"
>
> Expected: the filter function must be called in *scratch* since this is
> the buffer you want to check the bindings.

The problem is that describe-buffer-bindings only changes the buffer to
look up the bindings, but everything that generates the description
(starting with describe-map-tree) doesn't know about that other buffer.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 39149 <at> debbugs.gnu.org:


Received: (at 39149) by debbugs.gnu.org; 30 Oct 2020 14:23:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 30 10:23:22 2020
Received: from localhost ([127.0.0.1]:59146 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYVJK-0001S0-Dd
	for submit <at> debbugs.gnu.org; Fri, 30 Oct 2020 10:23:22 -0400
Received: from quimby.gnus.org ([95.216.78.240]:38358)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kYVJI-0001Rk-OE
 for 39149 <at> debbugs.gnu.org; Fri, 30 Oct 2020 10:23:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=NMFsD0VJP18irueR97DNojDEg8JpeGM2nIw81Ci+IVQ=; b=pXiqPMdG+uPXu5+R+KQ/Gp7WHx
 Drlg6jvg3kgSrePbkTkTbntQYT+eoyfgmG/SDQovOAvVPcVblU/IYsvGn09Haf4iMVNHGsxUo2u74
 1HHTfvkkfbC7UzCs4OU5wkSnQMbOnKGzFbmcGWiOBEQNaUY2aQ99j0RzmgCSWhT/EGcM=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kYVJ8-00010h-PB; Fri, 30 Oct 2020 15:23:14 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
Subject: Re: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter
 function in wrong buffer
References: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
X-Now-Playing: African Head Charge's _Drastic Season_: "Snake In The Hole"
Date: Fri, 30 Oct 2020 15:23:09 +0100
In-Reply-To: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
 (yyoncho@HIDDEN's message of "Thu, 16 Jan 2020 08:59:12 +0200")
Message-ID: <87361vhjxu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: yyoncho <yyoncho@HIDDEN> writes: > To reproduce (eval in
 scratch buffer) > (define-key global-map (kbd "C-c C-l r") > `(menu-item
 "2" switch-to-buffer > :filter ,(lambda (cmd) > (print (format "Called in
 %s" (current-buffer))) > cmd) [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39149
Cc: 39149 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

yyoncho <yyoncho@HIDDEN> writes:

> To reproduce (eval in scratch buffer)
> (define-key global-map (kbd "C-c C-l r") 
>   `(menu-item "2" switch-to-buffer
>               :filter ,(lambda (cmd)
>                          (print (format "Called in %s" (current-buffer)))
>                          cmd)))
> (with-temp-buffer
>   (with-output-to-string
>     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
>
> This outputs:
>
> \"Called in  *temp*\"

I tried this recipe, but I'm not getting the :filter function called at
all.  Do you have a recipe, starting from "emacs -Q", that reproduces
this bug?

And your report didn't include the data about the version generated by
report-emacs-bug, so it's hard to guess whether bug is only on some
specific system.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Jan 2020 06:59:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 16 01:59:37 2020
Received: from localhost ([127.0.0.1]:36648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1irz7u-00025E-My
	for submit <at> debbugs.gnu.org; Thu, 16 Jan 2020 01:59:37 -0500
Received: from lists.gnu.org ([209.51.188.17]:47212)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1irz7p-000250-7o
 for submit <at> debbugs.gnu.org; Thu, 16 Jan 2020 01:59:33 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:46272)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <yyoncho@HIDDEN>) id 1irz7o-0002uJ-6C
 for bug-gnu-emacs@HIDDEN; Thu, 16 Jan 2020 01:59:29 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 HTML_MESSAGE autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <yyoncho@HIDDEN>) id 1irz7n-0003IZ-9e
 for bug-gnu-emacs@HIDDEN; Thu, 16 Jan 2020 01:59:28 -0500
Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:43786)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <yyoncho@HIDDEN>) id 1irz7l-0003HC-O2
 for bug-gnu-emacs@HIDDEN; Thu, 16 Jan 2020 01:59:27 -0500
Received: by mail-lf1-x135.google.com with SMTP id 9so14719590lfq.10
 for <bug-gnu-emacs@HIDDEN>; Wed, 15 Jan 2020 22:59:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=E6UsOtHVzCTta1EFrHTq9OFqwDW3bIllS0OnIsRin+4=;
 b=fkViV6fEHWTMRpobAYBRjuYNlaE1W0rsmIIEhC/ZpdpqO7ezawVQ50t2WfwyEkz6HV
 gC2u75wdw4ngNXGmdIxuFRXzfW1qG04m8gK9Pe32e03cBjLfeV9sXuLcFqWfI8TqJO5u
 uz+6FYIBUoSSudKPM4p0MZ5EzThGej9mlrbzi6gsm+jnpB7c8swgfcK9TOwWggytTPZY
 0/flGk9h5IoR5q2unf6P/RUV/z9uM+J4BMXsTiWcRlalbivxeoi3OYdln8lgMw+MJCbB
 m49mn2D3rzQEiPEf8qWQcL3XiUFy9DP6bcOw4EUG3+1fQQwchbld5Ymb14txGndlwNuB
 vLig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=E6UsOtHVzCTta1EFrHTq9OFqwDW3bIllS0OnIsRin+4=;
 b=fdIOG6JRie9W/qGZlHBpi9b64k8rHtLIIT80xITXSJkZvxB8/162NZYe2XX0BIf/83
 pVlPcIvFScE6ZOqxFOcWPQr3EhN9ix9UAW4MlXFCwFiF7tpU5SvGs1y5DU7X499CcKoh
 eun8WDlnRzKWN9XHs0/BTrT4e7VihdlvTPPGixKs9MVpKH7cJl1yOQ9D5ga23kClUtXx
 v1qKmXw25Pu8HUigmlcuirTBopsCZspNJLUz+MdYFNTjQ+EzO5N09hkBPADMVP4G3OA+
 is9p1mJS7qc8D2QVJkeDY8Whc7bkYdYWFeDNb4wYRsZCz2ysvbX+Q48h6Z8bUUzOjnZj
 qxbA==
X-Gm-Message-State: APjAAAV9B25I2NcfMgtxa4pPFV3Hi150xYFG4qGwQz1RF4kLhgvwPryh
 hzS2jUciAgQrMCrJr/0O4wpIQRf1DTCbF+uPN5S3yypA
X-Google-Smtp-Source: APXvYqxPuhCz38ZS2UGjXQTFGabcmKc5za3m6qNT+SnPTos253tNnqKCKqt3VaDMC8K0UYdDBELqbrACTikoOd1lnUY=
X-Received: by 2002:a19:c1c1:: with SMTP id r184mr1648181lff.128.1579157964133; 
 Wed, 15 Jan 2020 22:59:24 -0800 (PST)
MIME-Version: 1.0
From: yyoncho <yyoncho@HIDDEN>
Date: Thu, 16 Jan 2020 08:59:12 +0200
Message-ID: <CACCVLQV31T4fTHn+fRbXXf2yidexZcL+rQiDYF_f3q62JymZ1g@HIDDEN>
Subject: 27.0.50; describe-buffer-bindings is calling :filter function in
 wrong buffer
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000007f19f4059c3c5dbf"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::135
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--0000000000007f19f4059c3c5dbf
Content-Type: text/plain; charset="UTF-8"

To reproduce (eval in scratch buffer)

(define-key global-map (kbd "C-c C-l r")
  `(menu-item "2" switch-to-buffer
              :filter ,(lambda (cmd)
                         (print (format "Called in %s" (current-buffer)))
                         cmd)))
(with-temp-buffer
  (with-output-to-string
    (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))

This outputs:

\"Called in  *temp*\"

Expected: the filter function must be called in *scratch* since this is
the buffer you want to check the bindings.

--0000000000007f19f4059c3c5dbf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><pre style=3D"box-sizing:border-box;font-family:SFMono-Reg=
ular,Consolas,&quot;Liberation Mono&quot;,Menlo,monospace;font-size:11.9px;=
margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.=
45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46)"=
><pre style=3D"box-sizing:border-box;font-family:SFMono-Regular,Consolas,&q=
uot;Liberation Mono&quot;,Menlo,monospace;font-size:11.9px;margin-top:0px;m=
argin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius=
:3px">To reproduce (eval in scratch buffer)</pre><pre style=3D"box-sizing:b=
order-box;font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,M=
enlo,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:1=
6px;overflow:auto;line-height:1.45;border-radius:3px">(define-key global-ma=
p (kbd &quot;C-c C-l r&quot;) <br>=C2=A0 `(menu-item &quot;2&quot; switch-t=
o-buffer<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :filter ,(lamb=
da (cmd)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(print (format &quot;Called in %s&quot; (current=
-buffer)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cmd)))<br>(with-temp-buffer<br>=C2=A0 (with-=
output-to-string<br>=C2=A0 =C2=A0 (describe-buffer-bindings (get-buffer &qu=
ot;*scratch*&quot;) [3 12] t)))<br><br>This outputs:<br><br>\&quot;Called i=
n =C2=A0*temp*\&quot;<br><br>Expected: the filter function must be called i=
n *scratch* since this is<br>the buffer you want to check the bindings.<br>=
</pre></pre></div>

--0000000000007f19f4059c3c5dbf--




Acknowledgement sent to yyoncho <yyoncho@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#39149; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 14 Dec 2020 17:30:01 UTC

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