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: Sun, 30 Nov 2014 16:00:09 -0800 (PST) [thread overview]
Message-ID: <a03eadb3-0b29-4295-93e4-46cd06eb24ad@default> (raw)
In-Reply-To: <20141130232003.GC12974@acm.acm>
> Ah. Yes, `defface' is like `defvar', in that if you defface a face
> twice, the second try does not overwrite the first.
`defvar' too should be fixed, for the same cases & reasons. There
is no user-oriented reason that `C-M-x' should not re-evaluate the
sexp, redefining the variable or the face.
There can be implementation reasons (too hard to do, or whatever),
but I see no user reason.
And wrt the implementation, I see no reason why TRT cannot be done,
at least for common, simple use cases (e.g., point on the symbol
being redefined).
> So I now see what you're complaining about, and I think would too,
> if I were doing anything at all with faces.
> ... use C-M-x. And for the latter, you need the opening paren
> at top level.
1. That evaluates more than the defface inside that opening paren.
E.g., in the test case I gave, the opening top-level paren is
for (when... ).
2. Even if that did the right thing, which does not (see #1), it
is far too restrictive - far more restrictive than it needs to
be. See what I wrote above.
> If I were you, I'd hack something together for
> my own use based on what's in lisp-mode.el.
...
> You could probably fix this with a bit of advice (whether
> old-style or new-style ;-).
Thanks for the advice, but I prefer to file this bug report
and hope that Emacs gets fixed. I've lived with it this way
for decades already. It is for Emacs, not for me, that I file
the bug report.
> > (2) `C-M-x' with point inside a defface sexp should also work.
> > If the latter cannot easily be made to work with point anywhere
> > inside the sexp, then at least make it work with point on
> `defface'
> > or near it (e.g. at the same list level).
>
> > > That `defface' be made a special case,
>
> > If that's necessary, yes. It should be made to work, whether that
> > means special-casing it or not.
>
> Given how much of a special case faces already are, in terms of
> awkwardness and inflexibility, maybe that's not too much to ask for.
> But beware of what you're asking for - you might get it. Then
> when you do C-M-x, expecting to evaluate a defun, you accidentally
> get a face defined instead, which you then can't get rid of.
Why can't I "get rid of it"?
Anyway, I can live with `C-M-x' redefining the stuff I use it on.
I will expect it to do that. If I don't want to do that then I
can use `eval-region' or similar, which perform normal load-like
evaluation.
> > > I'm not sure how you're going to construe "closer", given that a
> > > list typically extends over many characters and when point is
> > > within it, that must count as distance zero. Or something.
>
> > It's trivial to determine whether point is at the same list level
> > as the `defface' symbol.
>
> That would indeed be one way of doing it.
Thanks for taking a look, in any case. Should someone decide to
fix this bug, it might be good to (a) take a user poll and (b)
provide a way (e.g. a user option) to return to the previous (i.e.,
current), lame behavior for those who prefer it.
next prev parent reply other threads:[~2014-12-01 0:00 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 [this message]
2014-12-06 19:10 ` Alan Mackenzie
2014-12-10 22:20 ` Drew Adams
2014-12-13 3:07 ` Drew Adams
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a03eadb3-0b29-4295-93e4-46cd06eb24ad@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.