From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Why is `C-M-x' only for top-level defuns? Date: Wed, 11 Jan 2012 14:22:18 -0800 Message-ID: References: <87vcohc48w.fsf@gnuvola.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1326320557 32367 80.91.229.12 (11 Jan 2012 22:22:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 22:22:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Thien-Thi Nguyen'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 11 23:22:31 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 1Rl6Yw-0007Pm-0d for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2012 23:22:30 +0100 Original-Received: from localhost ([::1]:49039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl6Yv-0002xc-8a for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2012 17:22:29 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl6Ys-0002xL-57 for emacs-devel@gnu.org; Wed, 11 Jan 2012 17:22:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl6Yr-000328-23 for emacs-devel@gnu.org; Wed, 11 Jan 2012 17:22:26 -0500 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:55622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl6Yq-000323-TS for emacs-devel@gnu.org; Wed, 11 Jan 2012 17:22:25 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q0BMMLXh026406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Jan 2012 22:22:21 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q0BMMKvl009601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Jan 2012 22:22:20 GMT Original-Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q0BMMJau009346; Wed, 11 Jan 2012 16:22:20 -0600 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 11 Jan 2012 14:22:19 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87vcohc48w.fsf@gnuvola.org> Thread-Index: AczQqN7sXQxsmH3PQ2exH095DvwAOgAAiXVw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4F0E0B9D.00AA,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 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:147597 Archived-At: > (when CONDITION > (deffoo NAME (if CONDITION > (defbar NAME VALUE) > (defbaz NAME VALUE)))) > > Then, getting 'C-M-x' 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 'C-x C-e' is for. 1. I haven't thought about redesigning it. There might indeed be other things to consider. 2. Offhand, I'd say why not let `C-M-x' always act on the innermost defface, defcustom etc. containing point? That would be clear to users and presumably straightforward to implement. 3. That would mean that if you wanted to eval a top-level sexp containing a def* you would need to place point outside the def*. In this I agree with you that "it is better to move point somewhere and be explicit." Put point inside the form you want and outside any subform you do not want. 4. That's _not_ what `C-x C-e' is for, AFAIK. It does not re-eval an existing face's definition etc. AFAIK, the only way to get re-eval a defface etc. after changing its code is to use `C-M-x'. > That's the deriving answer. The authoritarian answer is that "defun" > has a specific meaning (form w/ open-paren in column 0). Well, yes. For some purposes (e.g. `beginning-of-defun') that makes sense. But does that column limitation make sense also for `C-M-x'? That's the question. ("Top-level" defun is really not the same thing as having its open paren in column 0. I'm glad that by default the actual criterion used is column 0 and not truly top-level. If that were not the case then the workaround of temporarily moving a non top-level defface to column 0 and hitting `C-M-x' would not work.) BTW, does option `open-paren-in-column-0-is-defun-start' work? I cannot see any difference if I set it to nil. What's a good recipe to show what it does? I was expecting that with a nil value `C-M-x' etc. would actually require a defface etc. to be top-level in the buffer, not just starting in column 0, in order for it to be redefined. > 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 :-] Dunno what you mean. Did I ask that decades ago? Could be. What was the answer? ;-)