From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Johan_Bockg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: SMIE documentation Date: Sun, 13 May 2012 13:51:52 +0200 Message-ID: <87fwb4l2nb.fsf@gnu.org> References: <87bp56mim5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1336909924 18238 80.91.229.3 (13 May 2012 11:52:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 May 2012 11:52:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 13 13:52:03 2012 Return-path: Envelope-to: ged-emacs-devel@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 1STXLF-0007Nj-Uh for ged-emacs-devel@m.gmane.org; Sun, 13 May 2012 13:52:02 +0200 Original-Received: from localhost ([::1]:34484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STXLF-0000Ld-Bv for ged-emacs-devel@m.gmane.org; Sun, 13 May 2012 07:52:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STXLD-0000LI-73 for emacs-devel@gnu.org; Sun, 13 May 2012 07:52:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STXLB-0005UC-EW for emacs-devel@gnu.org; Sun, 13 May 2012 07:51:58 -0400 Original-Received: from smtprelay-b21.telenor.se ([195.54.99.212]:35356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STXLB-0005Tt-4L for emacs-devel@gnu.org; Sun, 13 May 2012 07:51:57 -0400 Original-Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-b21.telenor.se (Postfix) with ESMTP id 6E230EBC40 for ; Sun, 13 May 2012 13:51:55 +0200 (CEST) X-SMTPAUTH-B2: [bocjoh] X-SENDER-IP: [85.229.0.223] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArSQAP+er09V5QDfPGdsb2JhbABEijuoBAOBHBkBAQEBNzSCFQEBBAFWIxALISUPAQQYAQwKGhOICQm5R4t/hSMEqSg X-IronPort-AV: E=Sophos;i="4.75,580,1330902000"; d="scan'208";a="335162743" Original-Received: from c-df00e555.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.229.0.223]) by ipb1.telenor.se with ESMTP; 13 May 2012 13:51:55 +0200 Original-Received: by muon.localdomain (Postfix, from userid 1000) id 41DA74843D8; Sun, 13 May 2012 13:51:53 +0200 (CEST) Mail-Copies-To: never In-Reply-To: (Stefan Monnier's message of "Tue, 07 Dec 2010 14:27:04 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.54.99.212 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:150472 Archived-At: Stefan Monnier writes: >> First, here's a patch to make smie-next-sexp correctly return (t POS >> TOKEN) when bumping into a closing thingy in the forward direction. > >> --- a/lisp/emacs-lisp/smie.el >> +++ b/lisp/emacs-lisp/smie.el >> @@ -653,7 +653,8 @@ Possible return values: >> (if (and halfsexp (numberp (funcall op-forw toklevels))) >> (push toklevels levels) >> (throw 'return >> - (prog1 (list (or (car toklevels) t) (point) token) >> + (prog1 (list (or (funcall op-forw toklevels) t) >> + (point) token) >> (goto-char pos))))) >> (t >> (let ((lastlevels levels)) > > I do not understand what case this intends to solve. When I try to > "bump into a closing thingy in the forward direction" with the current > code, it seems to work correctly. 1. In test/indent/modula2.mod, (smie-backward-sexp) after IF returns ((172) ...) = "bumped into open-thingy", but (smie-forward-sexp) before END returns (0 ...) = "couldn't skip token because its level is too high", which is not correct. 2. Return values of the form ((NUMBER) ...) are not documented. 3. Doc string of smie-forward-sexp: "open-paren or the beginning of buffer" should be "close-paren or the end of buffer". Sorry for the rather late reply.