From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#17761: 24.3.91; smie-for-sexp and parentheses of-by-one bug? Date: Thu, 12 Jun 2014 19:58:20 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1402574436 1005 80.91.229.3 (12 Jun 2014 12:00:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Jun 2014 12:00:36 +0000 (UTC) To: 17761@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 12 14:00:28 2014 Return-path: Envelope-to: geb-bug-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 1Wv3gB-0001YA-1Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Jun 2014 14:00:27 +0200 Original-Received: from localhost ([::1]:53551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv3gA-0001ak-Oi for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Jun 2014 08:00:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv3fy-0001UB-MR for bug-gnu-emacs@gnu.org; Thu, 12 Jun 2014 08:00:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv3fp-0006IC-Lr for bug-gnu-emacs@gnu.org; Thu, 12 Jun 2014 08:00:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv3fp-0006HU-Ax for bug-gnu-emacs@gnu.org; Thu, 12 Jun 2014 08:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wv3fo-0008D7-3q; Thu, 12 Jun 2014 08:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jun 2014 12:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.140257435631430 (code B ref -1); Thu, 12 Jun 2014 12:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Jun 2014 11:59:16 +0000 Original-Received: from localhost ([127.0.0.1]:45097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wv3ey-0008Aj-CI for submit@debbugs.gnu.org; Thu, 12 Jun 2014 07:59:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43411) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wv3es-0008A5-4L for submit@debbugs.gnu.org; Thu, 12 Jun 2014 07:59:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv3ee-0005Qb-0v for submit@debbugs.gnu.org; Thu, 12 Jun 2014 07:59:00 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:43824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv3ed-0005QD-TZ for submit@debbugs.gnu.org; Thu, 12 Jun 2014 07:58:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv3eU-0000yp-JE for bug-gnu-emacs@gnu.org; Thu, 12 Jun 2014 07:58:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv3eL-0005CA-8w for bug-gnu-emacs@gnu.org; Thu, 12 Jun 2014 07:58:42 -0400 Original-Received: from mail-pb0-x231.google.com ([2607:f8b0:400e:c01::231]:58790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv3eL-0005Bu-1J for bug-gnu-emacs@gnu.org; Thu, 12 Jun 2014 07:58:33 -0400 Original-Received: by mail-pb0-f49.google.com with SMTP id jt11so927039pbb.22 for ; Thu, 12 Jun 2014 04:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=9QHwAbgq8uMzxLuG5XQ2YOWgAJLyE4pxV02w9G9Lu8s=; b=iuRImR6F8grBsy70KmuBdbuMlGlf2VRdVf3t3fGtS0y0qShgiR2vpNnP/qRa1y3MHQ eI28Kn7ziVZzVTOxyX7kTCBByjrKB0MY3+M3To7YC2MA81boOo3aoMyQxC0RnJP93T7h DQtWE4yyOCjKbgU1FjHSvGAfVKkNilNATiWU+hLCdFEQmNDie9+9VGOsSWCSKjesPxDu uZzubMgXA/xnCgH7fHREEcXr7mOaPBDP3/d3LLQKAkCKqrftKQV3NK7jxeFUFjPkTpvJ +E6Q8C3+QtpInyPxzaGqHS6O1UeLuNeX+NA+fPjT2wAOByRu9K6HQYhiaBLS/CoPp+Bd JjKQ== X-Received: by 10.66.219.167 with SMTP id pp7mr20341811pac.21.1402574311317; Thu, 12 Jun 2014 04:58:31 -0700 (PDT) Original-Received: from fortuna ([123.119.84.119]) by mx.google.com with ESMTPSA id fu12sm4256027pad.42.2014.06.12.04.58.27 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 12 Jun 2014 04:58:30 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90292 Archived-At: 1. Open a buffer in octave mode and insert ( ) with point between the parentheses 2. Eval (smie-forward-sexp) which should give back something like (t 2 ")") POS is before the token ")" instead of the end position of the token. Is this a bug? This can often cause infinite loop if one is not careful. BTW, although smie-config-guess's return value is not documented, it seems no harm to do something like the following: === modified file 'lisp/emacs-lisp/smie.el' --- lisp/emacs-lisp/smie.el 2014-03-04 08:35:11 +0000 +++ lisp/emacs-lisp/smie.el 2014-06-12 11:20:38 +0000 @@ -2156,7 +2156,7 @@ (user-error "This buffer does not seem to be using SMIE")) (let ((config (smie-config--guess (point-min) (point-max)))) (cond - ((null config) (message "Nothing to change")) + ((null config) (message "Nothing to change") nil) ((null smie-config--buffer-local) (message "Local rules set") (setq smie-config--buffer-local config)) Thanks, Leo