From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: command-separator char Date: Tue, 23 Jun 2015 20:43:13 +0200 Message-ID: <5589A8C1.5060707@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435085067 24223 80.91.229.3 (23 Jun 2015 18:44:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Jun 2015 18:44:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 23 20:44:19 2015 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 1Z7TBC-0004Xu-KU for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Jun 2015 20:44:18 +0200 Original-Received: from localhost ([::1]:46977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7TBB-0003Qm-Om for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Jun 2015 14:44:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7TAM-0002Yd-Ug for help-gnu-emacs@gnu.org; Tue, 23 Jun 2015 14:43:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7TAJ-0006Af-Ka for help-gnu-emacs@gnu.org; Tue, 23 Jun 2015 14:43:26 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.131]:59909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7TAJ-0006AT-Av for help-gnu-emacs@gnu.org; Tue, 23 Jun 2015 14:43:23 -0400 Original-Received: from [192.168.178.31] ([77.12.75.104]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MCdVO-1ZGmq01ASw-009PXq for ; Tue, 23 Jun 2015 20:43:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-Provags-ID: V03:K0:FhMlH/U0wbIOWnhB+M2tD/TyQYH2slDUGuUACHmQy6l2luB3jor QMjM/sARete10nHmS8JWJT6Qn0sf+Bha2a4gmiJQoV8l9hpjDGfP3pPuSMQUbDbnm6prBYt XBY+ReQPSAacgTX/jik8hV21GnBQT5XI2WsPhOJ6IqHmr+O2jZlantZLqmX7yFv8wYwH6Cm FWwPk6+JJkMz7ylS27sqg== X-UI-Out-Filterresults: notjunk:1;V01:K0:t0gPME0/Bdw=:hm7C2Zcmc7EfK7+4NsEPau 76KStTV0CcY77SX7sJnCsEFB1fxMY1ZX/lqy1p3bBEU7QMAP3DHLFgfOU2aciRwuN/XFl9iSf hpWyP4mShdLg1JJndoZYv/MDNhYMH90ZUfMnOrMv7c6FNbpivi6MEmqNO6oWciB3xsyGWCXiT yZYyC59g8ahUReKe7GsJf/rqLr6ZIqWOzXrU/JgCZGhODCX6k+j8fFptP2s3kG4RyFiJExlrq 13AaiVdT4GpmQ9CfWU5tyr+B3b4ZV/JHQ+ACMqvpX3ybWJhMO4FACBi+VryDLDIzVp6jRnGIj 9AynUpQV5F7XbPL8bZYRCyHsEcbYakXHpp6sEr6egBebaYcy3NgWIEQVvNcTlUB9ydNf42LqX rBDRm5LRY0w3NOijQ4q8sfM2JCSrFTcnNdX9mar1x9JWldFqKkGu1EXckq6i0ioSnQpBPZWV4 n996m2CE1YQk0gplzzq1TTzJrb25suLYWYMtioythsF5iDIl/6Wp6OWt9h7s7Sc8tINNxxwHV +jDtrk9Po+1hzQ3VuivuyNTrYEHoifyLhulgwD+uOUdG+KsXrRU+HUh7O1pUZX6pX6IwizE9X /R/AL8Nc2NqGEthPtGz//NXEE/tULy79VC0ingieuRxjJCpjUkbSq4sC2V1JR1ISb5OtnFx4j LDfVWSv+C+i5H8qw4Upshg0kMiUqsGB0LpZDlEAFS/q/bZw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.126.131 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:105102 Archived-At: Am 23.06.2015 um 19:00 schrieb Stefan Monnier: >> Seems still no idea or definition what a sexp should be. > Nope. It's only a UI issue. > > Sexp navigation is basically navigation within the AST, but a given > buffer position corresponds to several different spots in the AST, so > there's an ambiguity. Take your example line: > > echo "foo"; echo "asdf"; > > the AST looks like > > echo > / > cmd > / \ > / "foo" > ; > \ echo > \ / > cmd > \ > "asdf" Thanks a lot for your care! > The position at BOL can be take to be right before the "echo" node, or > right before the first "cmd" node or right before the toplevel composite > instruction that comprises the whole line. > > You can mostly tell SMIE which one you want if you call smie-forward-sexp, > by passing it a token explaining the level you care about. > > But forward-sexp is called by the user without any extra info, so it has > to make an arbitrary choice. For compatibility with the usual > forward-sexp semantics, the choice it makes is to consider the "deepest" > position in the tree. That would be plausible. Unfortunatly can't see that. From end of first string jumps into second string. While there is an expression of three minor expressions: echo _ "foo"_ ; WRT to deepest it should keep the level and end after ";" > But as explained earlier, if you put point *before* a semi-colon, and then use > M-C-f, then SMIE's forward-sexp will take this as a clue that you want > to skip over whatever belongs to the right-hand of this semi-colon. > So with point right after "foo", C-M-f will jump to right after "asdf". > > Along the same lines, you say: > > With cursor inside first string --> end of first string > > meaning that this is inconsistent, No, didn't say that. That behaviour is expected - inconsistence was shown by the relation of examples. > but it's perfectly consistent, since > forward-sexp does not jump to "the end of the currently enclosing > entity" but instead to "the end of the entity that starts right after > point". > > SMIE's forward-sexp could very well check syntax-ppss to see we're > inside a string (or comment) and move outside of that string, but then > it would be a different command. > IMHO a much more usefull one :) > Stefan > > > PS: That doesn't mean that it always works right either, of course. > M-C-f with point right after the second "o" of "foo" (i.e. right before > the closing double quotes) should signal an error Think navigation shouldn't signal an error. Rather return nil - as at EOB. > but will instead jump > to right after the opening double quotes of "asdf". > PPS: And `up-list' doesn't use SMIE quite right either. IMO grammar oriented commands are needed - starting with token maybe. Languages commonly know expressions, compositions of them - and so upwards. Thanks, Andreas