GNU bug report logs - #17818
24.3.91; sh-learn-buffer-indent doesn't learn current indent anymore

Previous Next

Package: emacs;

Reported by: Reiner Steib <Reiner.Steib <at> gmx.de>

Date: Fri, 20 Jun 2014 14:57:01 UTC

Severity: important

Found in version 24.3.91

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Reiner Steib <Reiner.Steib <at> gmx.de>
Cc: 17818 <at> debbugs.gnu.org
Subject: Re: bug#17818: 24.3.91;
 sh-learn-buffer-indent doesn't learn current indent anymore
Date: Fri, 20 Jun 2014 17:10:44 -0400
> if true; do
>   echo "My sh-basic-offset offset should be 2."
> fi

The above "do" should be "then", right?

I installed the patch below which fixes some of the problem (the first
hunk fixes an incorrect guess and the second fixes the code so the guess
is actually activated).

Please confirm that the result is OK for your use case.



        Stefan


=== modified file 'lisp/emacs-lisp/smie.el'
--- lisp/emacs-lisp/smie.el	2014-06-20 01:05:40 +0000
+++ lisp/emacs-lisp/smie.el	2014-06-20 21:07:06 +0000
@@ -2138,7 +2138,7 @@
                   nil
                 (push (cons (+ offset (nth 2 sig)) sig) rules)
                 ;; Adjust the rest of the data.
-                (pcase-dolist ((and cotrace `(,count ,toffset ,trace))
+                (pcase-dolist ((and cotrace `(,count ,toffset . ,trace))
                                cotraces)
                   (setf (nth 1 cotrace) (- toffset offset))
                   (dolist (sig trace)
@@ -2167,15 +2167,14 @@
     (cond
      ((null config) (message "Nothing to change"))
      ((null smie-config--buffer-local)
-      (message "Local rules set")
-      (setq smie-config--buffer-local config))
+      (smie-config-local config)
+      (message "Local rules set"))
      ((y-or-n-p "Replace existing local config? ")
       (message "Local rules replaced")
-      (setq smie-config--buffer-local config))
+      (smie-config-local config))
      ((y-or-n-p "Merge with existing local config? ")
       (message "Local rules adjusted")
-      (setq smie-config--buffer-local
-            (append config smie-config--buffer-local)))
+      (smie-config-local (append config smie-config--buffer-local)))
      (t
       (message "Rules guessed: %S" config)))))
 





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

Previous Next


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