GNU bug report logs - #17761
24.3.91; smie-for-sexp and parentheses of-by-one bug?

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Thu, 12 Jun 2014 12:00:03 UTC

Severity: normal

Found in version 24.3.91

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17761 in the body.
You can then email your comments to 17761 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#17761; Package emacs. (Thu, 12 Jun 2014 12:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Liu <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Thu, 12 Jun 2014 12:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.91; smie-for-sexp and parentheses of-by-one bug?
Date: Thu, 12 Jun 2014 19:58:20 +0800
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17761; Package emacs. (Fri, 13 Jun 2014 15:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 17761 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 17761 <at> debbugs.gnu.org
Subject: Re: bug#17761: 24.3.91; smie-for-sexp and parentheses of-by-one bug?
Date: Fri, 13 Jun 2014 11:33:44 -0400
> 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?

Indeed, thanks.  I installed a patch into `emacs-24' which should
fix this.  As you can see, SMIE is mostly used to parse backward!

> BTW, although smie-config-guess's return value is not documented, it
> seems no harm to do something like the following:

Using its return value is an error, so I'd rather not encourage this error.


        Stefan




Reply sent to Leo Liu <sdl.web <at> gmail.com>:
You have taken responsibility. (Fri, 13 Jun 2014 16:15:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Liu <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Fri, 13 Jun 2014 16:15:03 GMT) Full text and rfc822 format available.

Message #13 received at 17761-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17761-done <at> debbugs.gnu.org
Subject: Re: bug#17761: 24.3.91; smie-for-sexp and parentheses of-by-one bug?
Date: Sat, 14 Jun 2014 00:14:34 +0800
Fixed 24.4

On 2014-06-13 11:33 -0400, Stefan Monnier wrote:
> Indeed, thanks.  I installed a patch into `emacs-24' which should
> fix this.  As you can see, SMIE is mostly used to parse backward!

Indeed and thanks for the fix.

Leo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 Jul 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 347 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.