bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19217: 25.0.50; `C-M-x' (`eval-defun') on a `defface' that is not to


From: Drew Adams
Subject: bug#19217: 25.0.50; `C-M-x' (`eval-defun') on a `defface' that is not top-level
Date: Sat, 29 Nov 2014 12:08:14 -0800 (PST)

> You can also move point to just after the closing ) and do C-x C-e
> (`eval-last-sexp').

I too thought that was the case, but it does not seem to be.  I just
tried it, starting with emacs -Q in several Emacs versions (22, 24.4,
25 dev build).

> > How about letting users redefine a `defface' with `C-M-x' even in
> > this case?
> 
> How is Emacs to determine which depth of parenthesis is to be
> considered the opening one?  For example, if a defface is contained
> within a defmacro, which one is to be executed on C-M-x?

I really don't care about corner cases, if in fact there are any.

You could even require that point be on the symbol `defface' in the
sexp, for all I care.  Then it should be trivial to grab the `defface'
sexp (e.g., use `(list-at-point)').

The point is to have some way to reevaluate the defface sexp.  If
`C-x C-e' worked, that would be enough, but AFAICT it does not work.

> > Is there a good reason for doing this only at top-level?
> 
> I think it is to make it unambiguous, which form is to be evaluated.

Dunno how `C-x C-e' could be ambiguous wrt the sexp that precedes
point.  If the sexp preceding point is ambiguous then I think we're
probably in a world of trouble. ;-)

Coming back to `C-M-x': Then don't seek perfection.  Require that
point be closer to the list enclosing `defface' than to another
list when you try `C-M-x', in order for it to unambiguously pick
up the right sexp.

What am I missing?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]