From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: moving in js Date: Fri, 10 Aug 2012 13:15:03 +0200 Message-ID: <5024ED37.6060501@easy-emacs.de> References: <5021685A.2080408@easy-emacs.de> <5021FB1B.1070201@easy-emacs.de> <50234E6E.4060303@easy-emacs.de> <5023E330.8070205@easy-emacs.de> <5023F124.50900@easy-emacs.de> <5024ADFF.6090405@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1344597358 18236 80.91.229.3 (10 Aug 2012 11:15:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2012 11:15:58 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org List" To: =?ISO-8859-1?Q?Jo=E3o_T=E1vora?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 10 13:15:59 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SznC5-0007xH-Ed for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 13:15:53 +0200 Original-Received: from localhost ([::1]:48885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SznC4-000484-GB for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 07:15:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SznBw-00040d-VC for help-gnu-emacs@gnu.org; Fri, 10 Aug 2012 07:15:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SznBt-0006M1-Dm for help-gnu-emacs@gnu.org; Fri, 10 Aug 2012 07:15:44 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.8]:61767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SznBt-0006Lq-3t for help-gnu-emacs@gnu.org; Fri, 10 Aug 2012 07:15:41 -0400 Original-Received: from [192.168.178.27] (brln-4d0c0d25.pool.mediaWays.net [77.12.13.37]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0LdEZd-1TQIFn1dOz-00iT5o; Fri, 10 Aug 2012 13:15:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: X-Provags-ID: V02:K0:7C1x1pq9tFyeeLwOP7Be/SGvZtDF/NTqQWuUxLZW4yU 1M5JW/tmcXqzXb/8fs0oGWiyv2JzZEVv9B77wIXfGDeZSn2JDa TF6PWeD0SpGOO5pkSlbZqOQcxjH297KWVmsQzC5oRAOR2cfbf+ dZpMemE35MJM61Y5qLbk12k3RNJFqGAbxqrHXwUKsioEjtrv/3 DWygshy0FcZBVvDceeqAXPYt9r8iaP05cW/5sj0rfDDG0a5+6l ilE7XkuTMMUIQwIIdPG6mHV/UTDvvYljehM4No1ZOofW5zwuKw xIVdnWURB1BFAaQ5hsefGuHhoz9qQl8toO0IvArt6HFntqIxxX mo6U2jVIpuo3T6cyAl/OiOIQXTtaD5tIXSXqIUw/r X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86283 Archived-At: Am 10.08.2012 11:16, schrieb João Távora: >> But don't expect a kind of validation from, saying: oh, this list ends here. >> It should just pick the next suitable element than. > > I do understand the expectation that a move command should do "the > next best thing" and never error. But that is already what C-b and M-b > do. which is okay for natural languages. What's needed still is the respective thing for programs: moving over expressions. BTW all this "balanced" or "symbolic" qualifications are futil IMO. Programs are composed of expressions, Emacs modes should be able to deal with it, nonwithstanding if "4 + 4", "asdf" or "(foo . bar)" are at cursor pos. As syntax differs, certainly Emacs' move commands can't use a single forward-expression implementation for all alike. So let's start with Emacs lisp, implementing a move-command at finest grain. (defun foo () (interactive "*") nil) If cursor at the interactive code characters "*", C-M-b should not error, but go to the beginning of string first, than at word-start interactive, than at interactive spec (list-beginning). Agreed? > I'm quite used (and fond of) the errors C-M-b raises, it informs > me about the quality of my code: if I didn't expect an error, it's > because code wasn't structured the way I expected it to be. > > I think you would want some kind of command that backward-sexp's when > it can, and when it can't pops *out* of a sexp. > > Whereas I wouldn't mind this: a command that backward-sexp's when it > can, and when it can't raises the error. But calling it again > immediately afterwards would pop out of the sexp. A bit like > isearch-forward at the last match. > > Maybe I'll try to hack these post them here, I think they can be done > easily with some defadvice. > IMHO its easier to start from scratch. Happily some wise person provided a forward-sexp-function variable, so hacking must not interfere with original code. BTW I'm on it at python-mode.el, using py-expression for the purpose. Not ready yet, solution is scheduled for 2012-09-04 https://launchpad.net/python-mode/+milestone/6.0.12 Cheers, Andreas