From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 13 21:00:16 2016 Received: (at submit) by debbugs.gnu.org; 14 Aug 2016 01:00:16 +0000 Received: from localhost ([127.0.0.1]:56644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYjmh-0005Zh-OJ for submit@debbugs.gnu.org; Sat, 13 Aug 2016 21:00:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYjme-0005ZS-MS for submit@debbugs.gnu.org; Sat, 13 Aug 2016 21:00:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYjmX-0001h1-Qx for submit@debbugs.gnu.org; Sat, 13 Aug 2016 21:00:07 -0400 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,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYjmX-0001ff-O7 for submit@debbugs.gnu.org; Sat, 13 Aug 2016 21:00:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYjmU-0002zD-Te for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 21:00:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYjmS-0001f8-BG for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 21:00:01 -0400 Received: from mail-it0-x22e.google.com ([2607:f8b0:4001:c0b::22e]:38487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYjmS-0001eh-4D for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 21:00:00 -0400 Received: by mail-it0-x22e.google.com with SMTP id c13so3587963ith.1 for ; Sat, 13 Aug 2016 17:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=ZDCXahTEytjvl7ZNAKuAQBL0vEDVqTXFyvgpPLKRVvk=; b=lVy7k6n91q5VyiiwwqCDDLiBB4Q1a5LDwtChPQ6eocEEud/GUctkpU5swbP+nv8MLs CJGZNDdJqVSc/hhEHIa2X4PNf6JPU9dZ2pO24i0jwcJJO5ruPzcHRwSp2SUXfvcF80k6 ADp3cu4OiIBEfR54DMdNrCj/k7eHwuepnQ8PtekxteiXVgB6bdmuGMMlMQ0Bi2X2GuG1 S1yoKpSbNyyaMEYKErJgh9FgEzp9fLfI6SZ5k5Rs/C1lZQufKSO3T733a7JQGApUYQhU tMXjXATvy/kXd2WpRxt6d3BMnDCixhUxfcLgvjUugVAjxmC5SiWULX+fBmcarYeGFVrN 6KJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZDCXahTEytjvl7ZNAKuAQBL0vEDVqTXFyvgpPLKRVvk=; b=EInTxjUBNcy1lcVFUo4MYsb6CYnmrWr+yM2mBbyhjnkSIK0QtKyYz9nUvTkE07Ijhh Gmz3Si8vl1LCTloVMW58xrVBu0/Zfsl69Dk7ucW272Qz3YFg9RR9t+E16ucU8Lgaaehd X54bdWYIE9VNZ5W6fyGIE3uj9hKvVkSTPA+IprQd8o+yxr5Tp+xY/fB0f4HQnUs9FilQ TKfuvjPcZDEA0zBsiosI9TwouE5dQNua+/8KbEST6FFu8qnV+VxNENEJ0D+PfxynAmP8 zlbCRKu1FPrno7912Cat/aChtLsNZzHP/zFP+JGp7v7eH16D9bVHYrvBDtweebUrk17x U1RQ== X-Gm-Message-State: AEkoousjnosSV493ys0kS+H0F6VAmyVIh5En7A31At42YuDB6JY2r8ybja8LllOFrigESpIBZo3ZqhbLfBAseg== X-Received: by 10.36.17.20 with SMTP id 20mr6885807itf.94.1471136397817; Sat, 13 Aug 2016 17:59:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.189.132 with HTTP; Sat, 13 Aug 2016 17:59:37 -0700 (PDT) From: Zachary Kanfer Date: Sat, 13 Aug 2016 20:59:37 -0400 Message-ID: Subject: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a11445822687ccd0539fda271 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a11445822687ccd0539fda271 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is a bug that happens when trying to navigate between two *Help* buffers. =3D=3DReproduction instructions=3D=3D emacs -Q Evaluate this code: (global-set-key (kbd "C-c l") (lambda () (interactive) (insert "This messes up the help buffer somehow."))) Then open up a help buffer for that function: C-h k C-c l And a help buffer for something else: C-h k a Then, in the help buffer, go to the bottom, and try to select the "[back]" link. I get an error: "user-error: You didn=E2=80=99t specify a fu= nction symbol". If I try again, I get a different error: "apply: Symbol=E2=80=99s function definition is void: nil". These errors happen whether I've select the link with pressing Enter on the keyboard or by clicking the mouse. =3D=3DEnd of instructions=3D=3D In GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2016-07-10 built on zck-laptop Repository revision: 466ee1b3ea76425d201b5d59950e88251870c836 Windowing system distributor 'The X.Org Foundation', version 11.0.11803000 System Description: Ubuntu 16.04.1 LTS Recent messages: Mark set (lambda nil (interactive) (insert "This messes up the help buffer somehow.")) Type C-x 1 to delete the help window. Mark set user-error: You didn=E2=80=99t specify a function symbol apply: Symbol=E2=80=99s function definition is void: nil scroll-up-command: End of buffer [2 times] apply: Symbol=E2=80=99s function definition is void: nil [3 times] p is undefined Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-fns radix-tree help-mode easymenu edmacro kmacro cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 98309 6988) (symbols 48 20970 0) (miscs 40 262 168) (strings 32 18601 4494) (string-bytes 1 595182) (vectors 16 13861) (vector-slots 8 449156 6768) (floats 8 188 43) (intervals 56 248 0) (buffers 976 12) (heap 1024 25332 985)) --001a11445822687ccd0539fda271 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This is a bug that happens when trying to navigate be= tween two *Help* buffers.

=3D=3DReproduction instructions=3D= =3D

emacs -Q

Evaluate this code:

(global-set= -key (kbd "C-c l") (lambda () (interactive) (insert "Thismesses up the help buffer somehow.")))

Then open up a help buf= fer for that function:

C-h k C-c l

And a help buffer for some= thing else:

C-h k a

Then, in the help buffer, go to the botto= m, and try to select the
"[back]" link. I get an error: "= user-error: You didn=E2=80=99t specify a function
symbol". If I try= again, I get a different error: "apply: Symbol=E2=80=99s
function = definition is void: nil". These errors happen whether I've
sele= ct the link with pressing Enter on the keyboard or by clicking the
mouse= .

=3D=3DEnd of instructions=3D=3D

In GN= U Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
=C2=A0= of 2016-07-10 built on zck-laptop
Repository revision: 466ee1b3ea76425d2= 01b5d59950e88251870c836
Windowing system distributor 'The X.Org Foun= dation', version 11.0.11803000
System Description:=C2=A0=C2=A0=C2=A0= Ubuntu 16.04.1 LTS

Recent messages:
Mark set
(lambda nil (int= eractive) (insert "This messes up the help buffer somehow."))
= Type C-x 1 to delete the help window.

Mark set
user-error: You di= dn=E2=80=99t specify a function symbol
apply: Symbol=E2=80=99s function = definition is void: nil
scroll-up-command: End of buffer [2 times]
ap= ply: Symbol=E2=80=99s function definition is void: nil [3 times]
p is un= defined

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGI= CK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 F= REETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Imp= ortant settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 value of $= XMODIFIERS: @im=3Dibus
=C2=A0 locale-coding-system: utf-8-unix

Ma= jor mode: Lisp Interaction

Minor modes in effect:
=C2=A0 tooltip-= mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electric-indent-mode: t=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-m= ode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: = t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto= -composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compr= ession-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode:= t

Load-path shadows:
None found.

Features:
(shadow sor= t mail-extr emacsbug message puny seq byte-opt gv bytecomp
byte-compile = cconv dired dired-loaddefs format-spec rfc822 mml mml-sec
password-cache= epa derived epg epg-config gnus-util rmail rmail-loaddefs
mm-decode mm-= bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader send= mail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils cl-extra h= elp-fns radix-tree help-mode easymenu edmacro
kmacro cl-loaddefs pcase c= l-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-= hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool= -bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp= -mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer selec= t scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty= -colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese t= ibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek r= omanian slovak czech european
ethiopic indian cyrillic chinese charscrip= t case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffe= r cl-preloaded nadvice
loaddefs button faces cus-face macroexp files tex= t-properties overlay
sha1 md5 base64 format env code-pages mule custom w= idget
hashtable-print-readable backquote dbusbind inotify dynamic-settin= g
system-font-setting font-render-setting move-toolbar gtk x-toolkit xmulti-tty make-network-process emacs)

Memory information:
((con= ses 16 98309 6988)
=C2=A0(symbols 48 20970 0)
=C2=A0(miscs 40 262 168= )
=C2=A0(strings 32 18601 4494)
=C2=A0(string-bytes 1 595182)
=C2= =A0(vectors 16 13861)
=C2=A0(vector-slots 8 449156 6768)
=C2=A0(float= s 8 188 43)
=C2=A0(intervals 56 248 0)
=C2=A0(buffers 976 12)
=C2= =A0(heap 1024 25332 985))

--001a11445822687ccd0539fda271-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 28 16:08:17 2016 Received: (at 24221) by debbugs.gnu.org; 28 Aug 2016 20:08:17 +0000 Received: from localhost ([127.0.0.1]:43081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1be6NM-0004Ue-Ud for submit@debbugs.gnu.org; Sun, 28 Aug 2016 16:08:17 -0400 Received: from tarrant.klingenberg.no ([80.91.231.253]:37689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1be6NL-0004UV-AB for 24221@debbugs.gnu.org; Sun, 28 Aug 2016 16:08:15 -0400 Received: from cm-84.211.197.29.getinternet.no ([84.211.197.29] helo=modesty.getinternet.no) by tarrant.klingenberg.no with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1be6N9-0002AE-7y; Sun, 28 Aug 2016 22:08:09 +0200 Received: by modesty.getinternet.no (Postfix, from userid 502) id C1A2514D24C2; Sun, 28 Aug 2016 22:07:57 +0200 (CEST) From: peder@klingenberg.no (Peder O. Klingenberg) To: Zachary Kanfer Subject: Re: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors References: Date: Sun, 28 Aug 2016 22:07:57 +0200 In-Reply-To: (Zachary Kanfer's message of "Sat, 13 Aug 2016 20:59:37 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.9 (--) X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 24221 Cc: 24221@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Zachary Kanfer writes: > emacs -Q > > Evaluate this code: > > (global-set-key (kbd "C-c l") (lambda () (interactive) (insert "This > messes up the help buffer somehow."))) > > Then open up a help buffer for that function: > > C-h k C-c l > > And a help buffer for something else: > > C-h k a > > Then, in the help buffer, go to the bottom, and try to select the > "[back]" link. I get an error: "user-error: You didn=E2=80=99t specify a = function > symbol". If I try again, I get a different error: "apply: Symbol=E2=80=99s > function definition is void: nil". These errors happen whether I've > select the link with pressing Enter on the keyboard or by clicking the > mouse. I can confirm this. Here's what I think is happening: `describe-key' (C-h k) finds your lambda expression when it calls `key-binding'. It then pushes this lambda on the help-xref-stack as an argument to `describe-function'. But `describe-function' doesn't know what to do with a lamda expression, and gives you that "You didn't specify a function symbol" message when the xref stack is popped and `describe-function' is called. I don't know what the best fix would be - fix the xref setup in `describe-key' or teach `describe-function' to do something useful with a lambda expression. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 28 17:56:25 2016 Received: (at 24221) by debbugs.gnu.org; 28 Aug 2016 21:56:25 +0000 Received: from localhost ([127.0.0.1]:43121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1be840-00071H-Qd for submit@debbugs.gnu.org; Sun, 28 Aug 2016 17:56:25 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:40211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1be83z-000715-Ag for 24221@debbugs.gnu.org; Sun, 28 Aug 2016 17:56:23 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u7SLuGQ7022062 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 28 Aug 2016 21:56:16 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u7SLuFaT006152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 28 Aug 2016 21:56:16 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u7SLuCaf003177; Sun, 28 Aug 2016 21:56:12 GMT MIME-Version: 1.0 Message-ID: <95980cc0-0429-449a-8e98-e629b2e885b8@default> Date: Sun, 28 Aug 2016 14:56:11 -0700 (PDT) From: Drew Adams To: peder@klingenberg.no, Zachary Kanfer Subject: RE: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: 24221 Cc: 24221@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) > > C-h k C-c l > > And a help buffer for something else: > > C-h k a > > > > Then, in the help buffer, go to the bottom, and try to select the > > "[back]" link. I get an error: "user-error: You didn=E2=80=99t specify = a > > function symbol". This is apparently a regression from Emacs 24.5. I see the same regression in this older pre-Emacs 25 build: In GNU Emacs 25.0.50.1 (i686-pc-mingw32) of 2015-05-29 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/mingw32 --host=3Di686-pc-mingw32 --enable-checking=3Dyes,glyphs' So it seems to have been introduced on or before 2015-05-29. And I do not see the regression in this older pre-25 build: In GNU Emacs 25.0.50.1 (i686-pc-mingw32) of 2015-04-05 on LEG570 Repository revision: 16eec6fc55dcc05d1d819f18998e84a9580b2521 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --host=3Di686-pc-mingw32 --enable-checking=3Dyes,glyphs' So it seems to have been introduced after 2015-04-05, i.e., between 2015-04-05 and 2015-05-29. > I don't know what the best fix would be - fix the xref setup in > `describe-key' or teach `describe-function' to do something useful with > a lambda expression. Remove the regression. Maybe restore some of the code from before it was introduced. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 16 13:43:58 2016 Received: (at 24221) by debbugs.gnu.org; 16 Sep 2016 17:43:58 +0000 Received: from localhost ([127.0.0.1]:33541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkxB7-0003od-U6 for submit@debbugs.gnu.org; Fri, 16 Sep 2016 13:43:58 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:44878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkxB6-0003oN-0h for 24221@debbugs.gnu.org; Fri, 16 Sep 2016 13:43:56 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8GHhmDB017297 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2016 17:43:49 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u8GHhmhL021915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2016 17:43:48 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u8GHhl23020638; Fri, 16 Sep 2016 17:43:47 GMT MIME-Version: 1.0 Message-ID: Date: Fri, 16 Sep 2016 10:43:46 -0700 (PDT) From: Drew Adams To: peder@klingenberg.no, Zachary Kanfer Subject: RE: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors References: <95980cc0-0429-449a-8e98-e629b2e885b8@default> In-Reply-To: <95980cc0-0429-449a-8e98-e629b2e885b8@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 24221 Cc: 24221@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.6 (----) This is the problem behind this regression: 1. `describe-key' calls `describe-function', passing it the command definition. 2. Someone changed `describe-function' so that it now barfs if its arg is not a function symbol. The doc string of `describe-function' says (and has long said) that the arg is a symbol. However, that should be the case only for interactive use (the `completing-read' call requires a match against a function symbol). What should be done: 1. Remove the error for a non-symbol, except perhaps for the interactive case. 2. Fix the doc, to say that it need not be a symbol when called from Lisp. Before the regression was introduced, both `describe-function' and using `[back]' to get to it worked for a lambda form. And a doc string in the lambda form was shown correctly as the doc, in *Help* - just as if the function had a name. And a byte-compiled lambda form also worked perfectly well prior to the introduction of the regression: (global-set-key (kbd "C-c l") (byte-compile (lambda () "DOC" (interactive) (message "FOO")))) This regression removed a bunch of useful behavior. `describe-function' should describe a function - any function. The argument should be limited to a function symbol only when called interactively. (An argument could even be made that it should not even be so limited for interactive use, that is, that `completing-read' should be lax, letting you type a lambda form if you want. I'm not making that argument here, however.) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 17 14:28:59 2016 Received: (at 24221) by debbugs.gnu.org; 17 Sep 2016 18:28:59 +0000 Received: from localhost ([127.0.0.1]:34082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blKME-0000s2-RB for submit@debbugs.gnu.org; Sat, 17 Sep 2016 14:28:59 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:51662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blKMD-0000rq-SG for 24221@debbugs.gnu.org; Sat, 17 Sep 2016 14:28:58 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8HISoCK028338 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 17 Sep 2016 18:28:51 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u8HISoPC012602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 17 Sep 2016 18:28:50 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u8HISmgx009432; Sat, 17 Sep 2016 18:28:49 GMT MIME-Version: 1.0 Message-ID: <1a54fc94-0550-420a-8160-51c2e81e5355@default> Date: Sat, 17 Sep 2016 11:28:47 -0700 (PDT) From: Drew Adams To: peder@klingenberg.no, Zachary Kanfer Subject: RE: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors References: <95980cc0-0429-449a-8e98-e629b2e885b8@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 24221 Cc: 24221@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.6 (----) I suggest using code such as that below - allow FUNCTION to be `functionp', not only a symbol that is `fboundp' (and test for the former first). Also, the function that raises an error should be `user-error' only when called interactively. Otherwise, it should be `error'. [I would even argue that for interactive use it should be `message', not `user-error', as that allows `describe-function' to be used, e.g., in the minibuffer to get help on different function-name candidates.] (let* ((interactivep (called-interactively-p 'interactive)) (err-fn (if interactivep #user-error #'error))) (if (and interactivep (not function)) (funcall err-fn "You did not specify a function symbol") (if (not (or (functionp function) ; Allow anonymous functions. (and function ; Allow macros and special forms. (fboundp (intern-soft function)))))) (funcall err-fn "Not a defined function: `%S'" function) (help-setup-xref ...) ...) From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 03 19:33:29 2016 Received: (at 24221) by debbugs.gnu.org; 3 Oct 2016 23:33:29 +0000 Received: from localhost ([127.0.0.1]:43469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brCjg-0001Xk-Qg for submit@debbugs.gnu.org; Mon, 03 Oct 2016 19:33:29 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:35740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brCjf-0001XO-4V; Mon, 03 Oct 2016 19:33:27 -0400 Received: by mail-it0-f43.google.com with SMTP id r192so130130336ita.0; Mon, 03 Oct 2016 16:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Si8LGvDxNvN81rCHix9astDdfj+XUiV7UCJzHupysdY=; b=e80yZIjtJO0A41vH34e9cE6Q0oDHGTBuWc8xHeKIB8xly1S9qLdmjHiiwWYfNCd2pj 4O/nF1OJgZGyyCCWRKoGZATv5eVLaqD9WWW/iPVmSYC+E3ufrt263kEgDSIoN5ua1T9O zQ5CfjOTrwb4A1LMio3Ks7ffnwp6jPaegMzgv08RIwvNbZizhzC3CPJJCewYfPSlX/in bmiXKYZFk4yejWXsK3RcSBAhSNPWd9fIFI+QA/FBY0egDotukdK/YXYQ6szLUcEMNog3 hOOPjY7VAp0fMXmp2bKcKStuo/KDcdTcaEuU6qkx/wXcfvNKtUqGlbRY3yrD+EZ/O2UR Hxqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Si8LGvDxNvN81rCHix9astDdfj+XUiV7UCJzHupysdY=; b=OgyLLtDrTv14sFmfYgqjiVLz4DkPjtoKx0mctUEMfmHrL6Vxc80AI6mUVmRPYZLuMl hHaTgHjqBlnX0G9jv6qw2hCuAXLHRYhzaDuA2+TNCPE01uYeotgxtGjhRKIt7/3+t/2a 90wXwO0D+K7iwhSK9uxkwhsS1vOUcIOmhXsz/SuDVI8ONxlK8JkJ6HUPLX5SscZtgprD 5fJhXTVH+mOobJM2BgD1e4U97G1EscAv/OVsjBlbtmGkiWtWwfEcDflEp5oOEVQoZnLC 1/l3rAWHxDx5tz6lF6vWVK6e1/DV2PZDtjClBngcJEsD4+E5tCA+eaf4G0cj9hgtuepW pWnA== X-Gm-Message-State: AA6/9RnUEPbnER4bp322cywFJ1CE+9CTO+4qeb3oYGVzaqzYBPe3QOCDdr8KNi7zJnBb3A== X-Received: by 10.36.210.70 with SMTP id z67mr19347241itf.67.1475537601328; Mon, 03 Oct 2016 16:33:21 -0700 (PDT) Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id t14sm491363itb.22.2016.10.03.16.33.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Oct 2016 16:33:20 -0700 (PDT) From: npostavs@users.sourceforge.net To: Drew Adams Subject: Re: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors References: <95980cc0-0429-449a-8e98-e629b2e885b8@default> Date: Mon, 03 Oct 2016 19:33:50 -0400 In-Reply-To: (Drew Adams's message of "Fri, 16 Sep 2016 10:43:46 -0700 (PDT)") Message-ID: <87ponhxb1d.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 24221 Cc: 24221@debbugs.gnu.org, peder@klingenberg.no, Zachary Kanfer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) --=-=-= Content-Type: text/plain tags 24221 patch quit Drew Adams writes: > > 2. Someone changed `describe-function' so that it now barfs > if its arg is not a function symbol. Yes, seems to have been 82d0f42a "* lisp/help-fns.el (describe-function): More type checking[...]". I think it was an accident: the non-interactive case wasn't considered, probably because the docstring doesn't mention it. Here's a patch that moves the checks into the interactive form and updates the docstring: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=v1-0001-Let-describe-function-work-for-lambda-again.patch Content-Description: patch >From 7dffe1868222f33c8845cac7b5e46836149c72f8 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 3 Oct 2016 18:49:56 -0400 Subject: [PATCH v1] Let describe-function work for lambda again Since commit "* lisp/help-fns.el (describe-function): More type checking[...]", `describe-function' throws a user-error when given a non-symbol. This prevents the [back] button in a *Help* buffer from working when the page it goes back to describes an anonymous function (e.g., the result of `describe-key' on a key which is bound to a lambda form). * lisp/help-fns.el (describe-function): Move the checks on FUNCTION being an fbound symbol into the `interactive' form. This allows non-interactive calls to pass an anonymous function (Bug #24221). Note that passing a non-bound symbol non-interactively will still trigger a `void-function' error from `describe-function-1'. --- lisp/help-fns.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 26d8839..7dfa670 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -50,23 +50,24 @@ describe-function-orig-buffer ;;;###autoload (defun describe-function (function) - "Display the full documentation of FUNCTION (a symbol)." + "Display the full documentation of FUNCTION (a symbol). +When called from lisp, FUNCTION may also be a function object." (interactive - (let ((fn (function-called-at-point)) - (enable-recursive-minibuffers t) - val) - (setq val (completing-read (if fn - (format "Describe function (default %s): " fn) - "Describe function: ") - obarray 'fboundp t nil nil - (and fn (symbol-name fn)))) - (list (if (equal val "") - fn (intern val))))) - (or (and function (symbolp function)) - (user-error "You didn't specify a function symbol")) - (or (fboundp function) - (user-error "Symbol's function definition is void: %s" function)) - + (let* ((fn (function-called-at-point)) + (enable-recursive-minibuffers t) + (val (completing-read + (if fn + (format "Describe function (default %s): " fn) + "Describe function: ") + obarray 'fboundp t nil nil + (and fn (symbol-name fn))))) + (unless (equal val "") + (setq fn (intern val))) + (unless (and fn (symbolp fn)) + (user-error "You didn't specify a function symbol")) + (unless (fboundp fn) + (user-error "Symbol's function definition is void: %s" fn)) + (list fn))) ;; We save describe-function-orig-buffer on the help xref stack, so ;; it is restored by the back/forward buttons. 'help-buffer' ;; expects (current-buffer) to be a help buffer when processing -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 21 22:47:35 2016 Received: (at 24221) by debbugs.gnu.org; 22 Oct 2016 02:47:35 +0000 Received: from localhost ([127.0.0.1]:45791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxmLP-0007UH-JY for submit@debbugs.gnu.org; Fri, 21 Oct 2016 22:47:35 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:37048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxmLN-0007Tw-DP; Fri, 21 Oct 2016 22:47:33 -0400 Received: by mail-it0-f50.google.com with SMTP id m138so25950285itm.0; Fri, 21 Oct 2016 19:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/kTeMt4pai3Z1EiZvZmMLkG+G2gnace9HPHRMJVCdYo=; b=sk0vBSuCm9+szflsSSCYOJbmK3Kdz8x8UBNRrcKdWHqZPFNZ41t+vrcvdr98qlGoc/ d0xXleZA46PaMENkz/Pc6dddEFaFF9+tcKMZQvJzFiU6t0Ho72yQ03K2VtF62nI0Im/W s9ooSJB9QGHA6sHah2XjRP1CyMkFWJNglBe9WosyRA/cswGZKcbqmIqlFCjg1crkGl+h CWAujEXw35dgaspbil6+Aw5mxeYTbEXK+Oa7xrcuSyWqfvJjcpQ5AU7bqmPwk5Z50JGI fqSGK54gaSpDRfGqHms89nx9M5qXofz0kVIPLd4pR+cIT7laj+Nrb2Rsk7CP2UOKWJRJ 0Tlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/kTeMt4pai3Z1EiZvZmMLkG+G2gnace9HPHRMJVCdYo=; b=jEkMqroJM7lMyScnaKu0GSCxVVtX1g8BW1bMwkHj4TBEyPZU3UuC60jytekPNOJIXJ TZmwNX2vQDS7o5uaqXCIoHh2B8E9u+L1f5J7MwFfam0JQ0H7KPapC1gqEEdZx2NQkou7 nv9Xbqc+AO/FR+AcoeQqeQCTcYWPcjL9pie4oIev/22UMcw64BVLO5ez3hHjAwG+HdXA UWS4+L0aKi/K2wFBgno94kf/Ai/oIJ5CEiueNYPZw89DSt/yj7enPDqr09oIAoY03e9A 3bfzmTR6tXZKcBY8diolFqexVgl8JOekgN38meTF9ELTJCUA8VF/2lKLRm+rDwbWXgMS mVcA== X-Gm-Message-State: ABUngvf7JwKGvML5mn3VPkUkb82OHzbl+rNJuNzVOpKCVScP8JYl3Vgy3mOBfMJRXzNO7A== X-Received: by 10.36.61.141 with SMTP id n135mr1481105itn.88.1477104447896; Fri, 21 Oct 2016 19:47:27 -0700 (PDT) Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id 70sm3141512iou.3.2016.10.21.19.47.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Oct 2016 19:47:27 -0700 (PDT) From: npostavs@users.sourceforge.net To: Drew Adams Subject: Re: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors References: <95980cc0-0429-449a-8e98-e629b2e885b8@default> <87ponhxb1d.fsf@users.sourceforge.net> Date: Fri, 21 Oct 2016 22:48:05 -0400 In-Reply-To: <87ponhxb1d.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Mon, 03 Oct 2016 19:33:50 -0400") Message-ID: <87funpt7yy.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 24221 Cc: 24221@debbugs.gnu.org, peder@klingenberg.no, Zachary Kanfer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) tags 24221 fixed close 24221 25.2 quit npostavs@users.sourceforge.net writes: > > Here's a patch that moves the checks into the interactive form and > updates the docstring: Pushed as 24e4e4e8 From unknown Thu Aug 14 22:18:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Nov 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator