unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Alan Mackenzie <acm@muc.de>
Cc: 19217@debbugs.gnu.org
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)	[thread overview]
Message-ID: <e8734776-1c7e-4819-953d-be77844a926b@default> (raw)
In-Reply-To: <bb8ff8ae-46f7-4e18-9328-1ee5de5e49e5@default>

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.
> 
> I'll bisect my setup when I get a moment, to try to find out why it
> doesn't work for me.
> 
> 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))





  reply	other threads:[~2014-12-13  3:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<mailman.14952.1417284925.1147.bug-gnu-emacs@gnu.org>
     [not found] ` <<20141129191023.34112.qmail@mail.muc.de>
2014-11-29 20:08   ` bug#19217: 25.0.50; `C-M-x' (`eval-defun') on a `defface' that is not top-level Drew Adams
2014-11-30 19:58     ` Alan Mackenzie
2014-11-30 20:51       ` Drew Adams
2014-11-30 23:20         ` Alan Mackenzie
2014-12-01  0:00           ` Drew Adams
2014-12-06 19:10         ` Alan Mackenzie
2014-12-10 22:20           ` Drew Adams
2014-12-13  3:07             ` Drew Adams [this message]
2020-09-18 13:36           ` Lars Ingebrigtsen
2020-09-18 15:53             ` Drew Adams
2020-09-19 14:10               ` Lars Ingebrigtsen
2020-10-15 14:28             ` Lars Ingebrigtsen
2020-10-15 15:29               ` Drew Adams
2020-10-15 15:35                 ` Lars Ingebrigtsen
2020-10-15 16:15                   ` Drew Adams
2014-11-29 18:13 Drew Adams
     [not found] ` <mailman.14952.1417284925.1147.bug-gnu-emacs@gnu.org>
2014-11-29 19:10   ` Alan Mackenzie
2014-12-01  3:51 ` Stefan Monnier
2014-12-01  4:29   ` Drew Adams
2014-12-01 13:49     ` Stefan Monnier
     [not found] ` <mailman.15037.1417408221.1147.bug-gnu-emacs@gnu.org>
2014-12-01 17:02   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8734776-1c7e-4819-953d-be77844a926b@default \
    --to=drew.adams@oracle.com \
    --cc=19217@debbugs.gnu.org \
    --cc=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).