From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#19217: 25.0.50; `C-M-x' (`eval-defun') on a `defface' that is not top-level Date: Fri, 12 Dec 2014 19:07:08 -0800 (PST) Message-ID: References: <20141129191023.34112.qmail@mail.muc.de> <3e0d66d6-99b6-4e0d-a1eb-b7f2e3731ea7@default> <20141130195811.GB12974@acm.acm> <6718ace6-b672-40fc-a5bc-ea29eb155239@default> <20141206191057.GB3233@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1418440112 6149 80.91.229.3 (13 Dec 2014 03:08:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Dec 2014 03:08:32 +0000 (UTC) Cc: 19217@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 13 04:08:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xzd4C-0007cC-58 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Dec 2014 04:08:24 +0100 Original-Received: from localhost ([::1]:60128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xzd4B-00079A-Ie for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Dec 2014 22:08:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xzd3z-000793-QZ for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2014 22:08:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xzd3r-00053i-2c for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2014 22:08:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xzd3q-00053c-VV for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2014 22:08:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xzd3q-0006kH-K1 for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2014 22:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Dec 2014 03:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19217 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19217-submit@debbugs.gnu.org id=B19217.141844004125599 (code B ref 19217); Sat, 13 Dec 2014 03:08:02 +0000 Original-Received: (at 19217) by debbugs.gnu.org; 13 Dec 2014 03:07:21 +0000 Original-Received: from localhost ([127.0.0.1]:44312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xzd3A-0006ep-5N for submit@debbugs.gnu.org; Fri, 12 Dec 2014 22:07:20 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:47433) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xzd37-0006eS-DY for 19217@debbugs.gnu.org; Fri, 12 Dec 2014 22:07:18 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sBD37ATR016240 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 13 Dec 2014 03:07:11 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBD379mn004726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 13 Dec 2014 03:07:10 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id sBD378kW005279; Sat, 13 Dec 2014 03:07:09 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97280 Archived-At: Hi Alan, > Starting from emacs -Q, it works, for both face & var. With my > setup, however, it does not work (no change from before). Dunno > why. Tried it with `lexical-binding' t and nil - neither worked. >=20 > I'll bisect my setup when I get a moment, to try to find out why it > doesn't work for me. >=20 > Thanks for working on this. I found the explanation. I bind `C-x C-e' to `pp-eval-last-sexp', not to `eval-last-sexp'. Apparently the latter got considerably redefined after Emacs 24.4, so that `pp-eval-last-sexp' is no longer parallel with `eval-last-sexp' - the code is very different. Your fix seems good for `eval-last-sexp'. But I would like to also see a similar fix for `pp-eval-last-sexp'. Could you perhaps take a look at fixing that as well? I filed a separate bug (#19362) for bringing `pp.el' into line with the changes that were made in moving from `lisp-mode.el' to `elisp-mode.el'. I'm not sure about all that might be involved for such a fix, as I don't know just what has changed. So that bug report is worded vaguely. But I would at least like to see `pp-eval-last-sexp' updated similarly to how `eval-last-sexp' was (for Emacs-Lisp buffers). A quick glance suggests that the change involves respecting `lexical-binding', but it might be more or other than that. Could you perhaps take a look? I would like to be able to get both (a) any advantages brought to `eval-last-sexp' by the Emacs 25 changes to it and (b) the advantage of your fix to it (this bug). But I also want to be able to continue using `pp-eval-last-sexp' instead of `eval-last-sexp'. I just want the former to enjoy the same advantages as latter. I have my own enhancement to `pp-eval-expression' (which is used by `pp-eval-last-sexp'), but the changes I make to that are probably orthogonal and I will be able to make them to whatever updated definition of `pp-eval-last-sexp' there is. --- FYI, the changes I make to `pp-eval-expression' are these: 1. Read with completion using `pp-read-expression-map'. 2. Progress message added. 3. Added optional arg and insertion behavior. 4. Respect `pp-eval-expression-print-length', `pp-eval-expression-print-level', and `eval-expression-debug-on-error'. #1 means bindings for `lisp-indent-line', `lisp-complete-symbol', `indent-sexp', `eval-defun', and `indent-pp-sexp'. #3 means this: With a prefix arg, insert the value into the current buffer at point. With a negative prefix arg, if the value is a string then insert it into the buffer without double-quotes (`"'). #4 means you can use different values from the same options without the prefix `pp-'. --- FYI, I do this, wrt keys: (substitute-key-definition 'eval-last-sexp 'pp-eval-last-sexp global-map) (substitute-key-definition 'eval-expression 'pp-eval-expression global-map))