From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Why is `C-M-x' only for top-level defuns? Date: Thu, 12 Jan 2012 07:34:00 +0100 Message-ID: <87fwflsa3r.fsf@gmail.com> References: <87zkdtdbk1.fsf@mail.jurta.org> <4F0E4835.1030106@dancol.org> <5115ABD13D084717AA639D79BCCE9753@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326350071 3749 80.91.229.12 (12 Jan 2012 06:34:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Jan 2012 06:34:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 12 07:34:27 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 1RlEEz-0003bs-Ac for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2012 07:34:25 +0100 Original-Received: from localhost ([::1]:41199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlEEy-0001Ws-GU for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2012 01:34:24 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlEEw-0001WQ-7W for emacs-devel@gnu.org; Thu, 12 Jan 2012 01:34:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlEEu-000106-4k for emacs-devel@gnu.org; Thu, 12 Jan 2012 01:34:22 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:43091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlEEt-0000zo-VR for emacs-devel@gnu.org; Thu, 12 Jan 2012 01:34:20 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RlEEr-0003Zg-8Q for emacs-devel@gnu.org; Thu, 12 Jan 2012 07:34:17 +0100 Original-Received: from 121.77.197.77.rev.sfr.net ([77.197.77.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Jan 2012 07:34:17 +0100 Original-Received: from thierry.volpiatto by 121.77.197.77.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Jan 2012 07:34:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 121.77.197.77.rev.sfr.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:7D/3O+seUgwcdzcIBIlMExPd7b0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:147607 Archived-At: Stefan Monnier writes: >> Stefan might be right that it would be difficult to get right - dunno. >> Off the top of my head, however, I'd guess that just going `uplist' >> from point till finding `defface', `defcustom', or `defvar' as the car >> might be good enough. > > C-M-x differs from C-x C-e in two aspects: > 1- it "guesses" which sexp is meant. > 2- it handles defface/defvar/defcustom specially. > IIUC you're only worried about the first partt o the extent that it > prevents you from getting to the second. I.e. what you're after is > a way to get (2) of C-M-x for sexps where (1) currently fails. > > I'm not very much in fa vor of trying to make (1) smarter because it > will make it less uniform. So we could maybe provide a new command > half-way between C-x C-e and C-M-x, or maybe change (1) so that it uses > the region if active. With anything, you can put point in any sexp of a block an eval it. If needed you can edit it in minibuffer to provide a result. Here cursor is on the let sexp and i hit `C-u C-:' and then edit it to have a value for 'a' and 'b'. (defun foo (a b) -!-(let ((c (+ a b))) (+ a b c))) http://tinyurl.com/739svnv -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997