From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#19217: 25.0.50; `C-M-x' (`eval-defun') on a `defface' that is not top-level Date: Sun, 30 Nov 2014 19:58:11 +0000 Message-ID: <20141130195811.GB12974@acm.acm> References: <20141129191023.34112.qmail@mail.muc.de> <3e0d66d6-99b6-4e0d-a1eb-b7f2e3731ea7@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1417377571 1906 80.91.229.3 (30 Nov 2014 19:59:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2014 19:59:31 +0000 (UTC) Cc: 19217@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 30 20:59:22 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 1XvAeP-0004ua-1E for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Nov 2014 20:59:21 +0100 Original-Received: from localhost ([::1]:51611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvAeO-0006eX-Kg for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Nov 2014 14:59:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvAeD-0006eF-Ul for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 14:59:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvAe6-0001HV-8Q for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 14:59:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvAe6-0001HP-5V for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 14:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XvAe5-0003SP-Uk for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 14:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Nov 2014 19:59:01 +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.141737752013248 (code B ref 19217); Sun, 30 Nov 2014 19:59:01 +0000 Original-Received: (at 19217) by debbugs.gnu.org; 30 Nov 2014 19:58:40 +0000 Original-Received: from localhost ([127.0.0.1]:50161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvAdk-0003Rb-6s for submit@debbugs.gnu.org; Sun, 30 Nov 2014 14:58:40 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:29222 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvAdh-0003RK-N0 for 19217@debbugs.gnu.org; Sun, 30 Nov 2014 14:58:38 -0500 Original-Received: (qmail 23915 invoked by uid 3782); 30 Nov 2014 19:58:35 -0000 Original-Received: from acm.muc.de (pD951B3FA.dip0.t-ipconnect.de [217.81.179.250]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 30 Nov 2014 20:58:34 +0100 Original-Received: (qmail 13731 invoked by uid 1000); 30 Nov 2014 19:58:11 -0000 Content-Disposition: inline In-Reply-To: <3e0d66d6-99b6-4e0d-a1eb-b7f2e3731ea7@default> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:96764 Archived-At: Hello, Drew. On Sat, Nov 29, 2014 at 12:08:14PM -0800, Drew Adams wrote: > > 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). I've never had a problem with C-x C-e that I can remember, and that includes several times with point after a random ) inside a defun. What happens when you do C-x C-e with point just after the `defface' form? > > > 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. What exactly are you suggesting? That `defface' be made a special case, and that if any of the sequence of enclosing (s opens a `defface' form, this should be the one chosen for execution? Or should any defining function count? What is special about `defface'? > 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. What happens when you try it? > > > 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. ;-) Neither C-M-x not C-x C-e are ambiguous. The first evaluates the top level form containing point, the second the sexp immediately preceding point. > 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. 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. > What am I missing? A detailed clear specification of what you want. -- Alan Mackenzie (Nuremberg, Germany).