From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24848: [sh-script] How to save "Local rules set" result from sh-learn-buffer-indent? Date: Fri, 25 Aug 2017 08:07:43 -0400 Message-ID: <87d17jam0g.fsf@users.sourceforge.net> References: <1478012827020.47948@bt.com> <1503574770199.95054@bt.com> <87o9r59lyp.fsf_-_@users.sourceforge.net> <1503582257373.58386@bt.com> <87inhca1s9.fsf@users.sourceforge.net> <1503648698123.80907@bt.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1503662851 22009 195.159.176.226 (25 Aug 2017 12:07:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 12:07:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 24848@debbugs.gnu.org To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 25 14:07:25 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlDOM-0004zW-Jg for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 14:07:14 +0200 Original-Received: from localhost ([::1]:52995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlDOT-0003JX-Cu for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 08:07:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlDOD-0003CU-It for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:07:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlDOA-0003j8-8v for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:07:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45072) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlDOA-0003iv-5q for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dlDO9-0007Vi-P0 for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 08:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2017 12:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24848 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24848-submit@debbugs.gnu.org id=B24848.150366277428815 (code B ref 24848); Fri, 25 Aug 2017 12:07:01 +0000 Original-Received: (at 24848) by debbugs.gnu.org; 25 Aug 2017 12:06:14 +0000 Original-Received: from localhost ([127.0.0.1]:53753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlDNN-0007Uh-NT for submit@debbugs.gnu.org; Fri, 25 Aug 2017 08:06:13 -0400 Original-Received: from mail-io0-f182.google.com ([209.85.223.182]:38428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlDNL-0007UU-KH for 24848@debbugs.gnu.org; Fri, 25 Aug 2017 08:06:11 -0400 Original-Received: by mail-io0-f182.google.com with SMTP id 81so6921096ioj.5 for <24848@debbugs.gnu.org>; Fri, 25 Aug 2017 05:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ObLtjHKuyo3QbElJvDSrAo+toUwpw2tHFZzaCG8mTBw=; b=NacCRYeZ4qnLy9ewDARCzJt5Vnt9lxZnpIz/V8ucQ+Qqw0o6gUqD0OfVFN8WXbdFcM PmVID0+l7RoOgplAs0yp8iuPyhTHqg+xmphXVJKFSJggrX7cmq1C2G6HLQzCcuMAk2x6 zBK5qGBoljxq/wNoahPzVC+/VC+j34BHNpvjVABI8xuyEO/Swc71JwOwy2KNPgu8CyeU yIXmUeNXqxmAQzgmSAH2Y5eFpiOMd5uSwP0+WIozAJthxkeh/6KlGc7yTW9rn8065Z4O 7bXcqy7isI8KIZ+NFPYAnDMnufaBHy9hIdnFoBAtivyK/XCJ11WGgJtyrSqemU0LG+T7 YlHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=ObLtjHKuyo3QbElJvDSrAo+toUwpw2tHFZzaCG8mTBw=; b=QWENv498SWyX5HXgOZQDyA1wzkIHQqi9OvyG+7f+iI904+fy2rm2YNw1+mHzdDxu2s VmP/87aX8DrLLNhA+LsRy1S24aaRp7i8tbEni3tP3PRHc8Fk3N3MUYWkocNw05sITEYs emBJ1jAikv6SSrakbM6Ij34/+otycb8uUSorJiWvOAW55K3fBrIttCToBuvv7s+fD+NP JA/516sNXWgxmUhshXkP38bKRWQ+0O7jbLiQ0Y6mmkln3K2wpb6I55nXMVX3Obw1vlGs wH1w9+zLU95sb14bk/DaopZ5zexOmHLqRhHad4B0PIzdgZOGLRxNGYNRQXbKSxBhEQDq kE5Q== X-Gm-Message-State: AHYfb5jzXZANpXqB9QKuOSx5ECwOdrhsvKUGaeobnUz1UWzOsrEILqZy GuaUMy93j0YnUP4i X-Received: by 10.107.5.66 with SMTP id 63mr7590457iof.184.1503662765490; Fri, 25 Aug 2017 05:06:05 -0700 (PDT) Original-Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id 67sm2910489iob.7.2017.08.25.05.06.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 05:06:04 -0700 (PDT) In-Reply-To: <1503648698123.80907@bt.com> (richard wiseman's message of "Fri, 25 Aug 2017 08:11:38 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:136189 Archived-At: writes: > I don't know whether my Emacs uses smie for sh-mode but there's > apparently no sh-use-smie variable set by default. What Emacs version do you have? (Based on what you said below, it sounds like smie is being used.) > The bash script I've used as a test here is: > > #!/usr/bin/env bash > > if [ "$1" ] > then > echo "First argument is: $1" > else > echo "No arguments" > fi Ah, so you've set sh-basic-offset to 2, right? That's Bug#21751. Hmm, it looks like the smie code is following sh-indentation instead of sh-basic-offset. It's not clear to me why both of those variables exist... > 3. I ran customize-variable on smie-config and its value is now ((2 > :elem basic 4)) which doesn't make any mention of indenting after > "then" which is weird, because as I said, it does now indent correctly > in this buffer. When I set sh-basic-offset to 2, I get that value for smie-config as well. > 7. As feared, indentation is back to the way I don't like. > > However, running smie-config-guess seems to have the same effect as > sm-learn-buffer-indent so perhaps it does. Unfortunately, I've still > not managed to save the config. I followed your steps and got similar results. The problem is actually that the config doesn't get loaded properly. It works if I then do 8. M-x customize-option RET smie-config RET 9. Modify the text of the value field, e.g., by adding a space at the end, so that the "State" turns to EDITED. 10. Click the "Apply" button (this is equivalent to the (customize-set-variable 'smie-config ...) expression I mentioned before). 11. Go to the bash script buffer and run M-x normal-mode RET so that the mode hooks are run again. 12. Indentation is correct.