From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: Why is `C-M-x' only for top-level defuns? Date: Wed, 11 Jan 2012 22:34:55 +0100 Message-ID: <87vcohc48w.fsf@gnuvola.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1326317711 11619 80.91.229.12 (11 Jan 2012 21:35:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 21:35:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 11 22:35:07 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rl5p4-0006jL-Te for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2012 22:35:07 +0100 Original-Received: from localhost ([::1]:46824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl5p4-0005oX-E1 for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2012 16:35:06 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl5p0-0005my-Rc for emacs-devel@gnu.org; Wed, 11 Jan 2012 16:35:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl5oz-0003YG-GS for emacs-devel@gnu.org; Wed, 11 Jan 2012 16:35:02 -0500 Original-Received: from smtp208.alice.it ([82.57.200.104]:33420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl5oz-0003Y5-5O for emacs-devel@gnu.org; Wed, 11 Jan 2012 16:35:01 -0500 Original-Received: from ambire (79.51.73.240) by smtp208.alice.it (8.6.023.02) id 4F056E8500952E7B; Wed, 11 Jan 2012 22:34:56 +0100 Original-Received: from ttn by ambire with local (Exim 4.72) (envelope-from ) id 1Rl5ot-0004Pj-MZ; Wed, 11 Jan 2012 22:34:55 +0100 In-Reply-To: (Drew Adams's message of "Wed, 11 Jan 2012 09:06:24 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.104 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147596 Archived-At: () "Drew Adams" () Wed, 11 Jan 2012 09:06:24 -0800 There is likely a good reason for this, but I'll still pose the question, to learn. Why not let `C-M-x' re-evaluate a "defun" (defcustom, defface, etc.) that is not necessarily at top level? E.g., with point on, say, `defface' in this sexp, why shouldn't `C-M-x' redefine the face? (when twillig-&-the-tithy-toves-do-tyre-&-timble-in-the-twabe (defface ...)) Currently, in order to make `C-M-x' work for such a "defun" I temporarily move its first line to column 1 and then hit `C-M-x'. Seems like a silly workaround, but I don't know of a better one. Am I missing something? In the example above, the outermost form is a conditional expression, and the definition is internal. What if you have: (when CONDITION (deffoo NAME (if CONDITION (defbar NAME VALUE) (defbaz NAME VALUE)))) ? Then, getting =E2=80=98C-M-x=E2=80=99 to Do What You Mean when point is = "inside somewhere" is challenged by the multiple definitions. Better to move point to some place and be explicit. That's what =E2=80=98C-x C-e=E2=80=99= is for. That's the deriving answer. The authoritarian answer is that "defun" has a specific meaning (form w/ open-paren in column 0). The cavalier answer is that "maybe someone already asked this on help-gnu-emacs one or two decades ago, hint hint". [insert long-nosed mockup, here :-]