GNU bug report logs - #16233
sh-smie-sh-forward-toke recurses forever

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Mon, 23 Dec 2013 23:08:01 UTC

Severity: normal

Done: Daniel Colascione <dancol <at> dancol.org>

Bug is archived. No further changes may be made.

Full log


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

From: Daniel Colascione <dancol <at> dancol.org>
To: 16233 <at> debbugs.gnu.org
Subject: Re: bug#16233: sh-smie-sh-forward-toke recurses forever
Date: Mon, 23 Dec 2013 15:30:47 -0800
On 12/23/2013 03:07 PM, Daniel Colascione wrote:
> In latest trunk, sh-smie-sh-forward-token has started to recurse
> forever. Here's the repro:
>
> "if "
>
> Create a buffer containing these three characters, put it in
> shell-script-mode, goto-char 2, and eval (funcall show-paren-data-function)

This patch appears to be fix the problem. Okay to apply?

=== modified file 'lisp/progmodes/sh-script.el'
--- lisp/progmodes/sh-script.el	2013-12-20 21:41:57 +0000
+++ lisp/progmodes/sh-script.el	2013-12-23 23:29:31 +0000
@@ -1844,7 +1844,7 @@
             ";")
         (let ((semi (sh-smie--newline-semi-p)))
           (forward-line 1)
-          (if semi ";"
+          (if (or semi (eobp)) ";"
             (sh-smie-sh-forward-token))))
     (forward-comment (point-max))
     (cond
@@ -2070,7 +2070,7 @@
             ";")
         (let ((semi (sh-smie--rc-newline-semi-p)))
           (forward-line 1)
-          (if semi ";"
+          (if (or semi (eobp)) ";"
             (sh-smie-rc-forward-token))))
     (forward-comment (point-max))
     (cond





This bug report was last modified 11 years and 149 days ago.

Previous Next


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