From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors Date: Sat, 17 Sep 2016 11:28:47 -0700 (PDT) Message-ID: <1a54fc94-0550-420a-8160-51c2e81e5355@default> References: <95980cc0-0429-449a-8e98-e629b2e885b8@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1474136979 32304 195.159.176.226 (17 Sep 2016 18:29:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2016 18:29:39 +0000 (UTC) Cc: 24221@debbugs.gnu.org To: peder@klingenberg.no, Zachary Kanfer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 17 20:29:35 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blKMX-0005wD-Dg for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Sep 2016 20:29:17 +0200 Original-Received: from localhost ([::1]:47080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blKMV-0001As-7N for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Sep 2016 14:29:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blKML-00019X-Eg for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2016 14:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blKMI-0001Ce-0z for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2016 14:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blKMH-0001CY-UI for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2016 14:29:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1blKMH-0000sJ-L9 for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2016 14:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2016 18:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24221 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24221-submit@debbugs.gnu.org id=B24221.14741369393354 (code B ref 24221); Sat, 17 Sep 2016 18:29:01 +0000 Original-Received: (at 24221) by debbugs.gnu.org; 17 Sep 2016 18:28:59 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123408 Archived-At: 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 ...) ...)