unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dave Abrahams <dave@boostpro.com>
To: emacs-devel@gnu.org
Subject: Re: Why is `C-M-x' only for top-level defuns?
Date: Thu, 12 Jan 2012 11:52:40 -0500	[thread overview]
Message-ID: <m239bkualj.fsf@pluto.luannocracy.com> (raw)
In-Reply-To: 77BCC4C254904FBE9B2298F0B07F88BE@us.oracle.com


on Thu Jan 12 2012, "Drew Adams" <drew.adams-AT-oracle.com> wrote:

>> Another possibility could be to respect different prefix args 
>> in different ways (edebug vs this feature).  But the simplest
>> solution is likely having a separate command/key.
>
> 1. It just occurred to me that edebug instrumentation is only for functions, and
> the redefinition feature I'm talking about is only for faces and vars.
>
> So presumably there would be no need to distinguish different kinds of prefix
> args.  We could let a prefix arg mean to either redefine the innermost face/var
> definition containing point, if any, or instrument the column-0 defun (what it
> does now).
>
> In the not-so-common context of a def(face|custom|var) that is inside a defun
> that you want to instrument for edebug, the behavior of a prefix arg would
> differ depending on the position of point.  Whether that case is common enough
> to warrant requiring different prefix-arg values to distinguish the two, I don't
> know (I doubt it).
>
> 2. Another possibility: let `C-M-x' inside a def(face|custom|var) always
> redefine it (i.e., without a prefix arg).  That would mean that to make `C-M-x'
> eval a sexp starting in column 0, point would need to be outside any sub-sexp
> that is a def(face|custom|var).
>
> (But I repeat that I'm OK with having a separate command/key for this, not
> `C-M-x'.)

I just wanna say: I've always wanted the behavior Drew is proposing (for
edebug-defun, eval-defun, and xxx-defun in general) and despite the fact
that I should know better by now, I am surprised every time these
functions go all the way to the outermost sexp.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




  reply	other threads:[~2012-01-12 16:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 17:06 Why is `C-M-x' only for top-level defuns? Drew Adams
2012-01-11 21:34 ` Thien-Thi Nguyen
2012-01-11 22:22   ` Drew Adams
2012-01-12  0:11 ` Juri Linkov
2012-01-12  0:36   ` Drew Adams
2012-01-12  1:27     ` Stefan Monnier
2012-01-12  2:40       ` Daniel Colascione
2012-01-12  3:42         ` Drew Adams
2012-01-12  4:05           ` Stefan Monnier
2012-01-12  4:15             ` Daniel Colascione
2012-01-12  6:34             ` Thierry Volpiatto
2012-01-12 15:29               ` Drew Adams
2012-01-12 10:30             ` Juri Linkov
2012-01-12 15:29               ` Drew Adams
2012-01-12 15:21             ` Drew Adams
2012-01-12 16:25               ` Drew Adams
2012-01-12 16:52                 ` Dave Abrahams [this message]
2012-01-12  5:23 ` Stephen J. Turnbull
2012-01-12 15:29   ` Drew Adams
2012-01-12 16:47     ` Stephen J. Turnbull
2012-01-12 16:56       ` Dave Abrahams

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=m239bkualj.fsf@pluto.luannocracy.com \
    --to=dave@boostpro.com \
    --cc=emacs-devel@gnu.org \
    /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).