unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Reiner Steib <Reiner.Steib@gmx.de>
Cc: 17818@debbugs.gnu.org
Subject: bug#17818: 24.3.91; sh-learn-buffer-indent doesn't learn current indent anymore
Date: Fri, 20 Jun 2014 17:10:44 -0400	[thread overview]
Message-ID: <jwvegyjmgqe.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87ha3fy6lv.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Fri, 20 Jun 2014 16:54:04 +0200")

> 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)))))
 






  parent reply	other threads:[~2014-06-20 21:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 14:54 bug#17818: 24.3.91; sh-learn-buffer-indent doesn't learn current indent anymore Reiner Steib
2014-06-20 15:48 ` Stefan Monnier
2014-06-20 21:10 ` Stefan Monnier [this message]
2014-06-23 16:04   ` Reiner Steib
2014-06-24 13:49     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvegyjmgqe.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=17818@debbugs.gnu.org \
    --cc=Reiner.Steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).