From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.devel,gmane.emacs.xemacs.beta Subject: Re: simplifying beginning-of-defun Date: Sun, 27 Sep 2009 07:17:28 -0400 Message-ID: <1254050248.6168.30.camel@projectile.siege-engine.com> References: <4ABE54F9.7090107@online.de> <4ABF3DCB.3060602@online.de> Reply-To: eric@siege-engine.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1254050258 8818 80.91.229.12 (27 Sep 2009 11:17:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Sep 2009 11:17:38 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , XEmacs-Beta@xemacs.org To: Andreas Roehler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 27 13:17:30 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mrrkw-0007ip-7P for ged-emacs-devel@m.gmane.org; Sun, 27 Sep 2009 13:17:30 +0200 Original-Received: from localhost ([127.0.0.1]:60592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mrrku-0001mL-VH for ged-emacs-devel@m.gmane.org; Sun, 27 Sep 2009 07:17:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mrrkp-0001l4-SH for emacs-devel@gnu.org; Sun, 27 Sep 2009 07:17:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mrrkn-0001if-DR for emacs-devel@gnu.org; Sun, 27 Sep 2009 07:17:22 -0400 Original-Received: from [199.232.76.173] (port=60268 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mrrkn-0001ia-Av for emacs-devel@gnu.org; Sun, 27 Sep 2009 07:17:21 -0400 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10]:53014 helo=projectile.siege-engine.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mrrkn-000317-0K for emacs-devel@gnu.org; Sun, 27 Sep 2009 07:17:21 -0400 Original-Received: from projectile.siege-engine.com (localhost [127.0.0.1]) by projectile.siege-engine.com (8.14.3/8.14.3/Debian-6) with ESMTP id n8RBHTnZ032646; Sun, 27 Sep 2009 07:17:29 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.14.3/8.14.3/Submit) id n8RBHSFr032645; Sun, 27 Sep 2009 07:17:28 -0400 X-Authentication-Warning: projectile.siege-engine.com: zappo set sender to eric@siege-engine.com using -f In-Reply-To: <4ABF3DCB.3060602@online.de> X-Mailer: Evolution 2.26.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115688 gmane.emacs.xemacs.beta:30585 Archived-At: On Sun, 2009-09-27 at 12:26 +0200, Andreas Roehler wrote: > ... > > any argument. So your code wouldn't be acceptable as is since it would > > likely break several packages. > > > > ... > > > Hi Stefan, > > reflecting this question a little bit further: > > as expressive settings of `push-mark' are removed, some functions > while rely upon and fail then. > > However, `push-mark' is a very basic and considerable > editing command. If a function needs it, it should implement it at place. > > Suggest keeping things apart: move functions should > move, not deliver a hair-cut. :) > > If more is needed, another function should take over than. > > All-at-once essays create complexity and never ending > bugs finally. > > So far, think simplifying is worthwhile on the longer run. > > > Andreas I agree with the basic mechanics of what Andreas is providing here, not any specific feature change involved in the patch. If there were some function like the -raw functions he proposed that program modes would use if they wanted exactly that behavior, and a separate interactive function, then that opens the door for improvements on the interactive function. This comes up specifically with CEDET, where I can use parser information to do a real `beginning-of-defun' for langauges whos defuns don't happen to start with a ( in the first column. From an interactive point of view, a total win. From a programs point of view, this would mean disaster if all their code was expecting the cursor to show up on some opening {, and not on the text actually starting the defun. For modes like cc-mode that write their own correct `beginning-of-defun', they would use that internally anyway, so no loss. Right now, the feature I describe in CEDET/Semantic is done with advice and various if statements making sure not to do the modification in non-interactive cases. The code is in senator.el. http://cedet.cvs.sourceforge.net/viewvc/cedet/cedet/semantic/senator.el?view=markup Eric