From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: 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:11:38 +0000 Message-ID: <1503648698123.80907@bt.com> References: <1478012827020.47948@bt.com> <1503574770199.95054@bt.com> <87o9r59lyp.fsf_-_@users.sourceforge.net> <1503582257373.58386@bt.com>,<87inhca1s9.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1503648814 32217 195.159.176.226 (25 Aug 2017 08:13:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 08:13:34 +0000 (UTC) To: , <24848@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 25 10:13:29 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 1dl9jz-0007Zy-2I for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 10:13:19 +0200 Original-Received: from localhost ([::1]:52056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dl9k5-0007R6-OK for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 04:13:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dl9ip-0006tU-AD for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 04:12:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dl9ik-0003Rd-C8 for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 04:12:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dl9ik-0003RT-8Q for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 04:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dl9ik-0000HP-01 for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2017 04:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2017 08:12: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.15036487091054 (code B ref 24848); Fri, 25 Aug 2017 08:12:01 +0000 Original-Received: (at 24848) by debbugs.gnu.org; 25 Aug 2017 08:11:49 +0000 Original-Received: from localhost ([127.0.0.1]:53513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl9iX-0000Gw-3O for submit@debbugs.gnu.org; Fri, 25 Aug 2017 04:11:49 -0400 Original-Received: from smtpb1.bt.com ([62.7.242.142]:15592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl9iU-0000Gi-P1 for 24848@debbugs.gnu.org; Fri, 25 Aug 2017 04:11:47 -0400 Original-Received: from EVHUB03-UKBR.domain1.systemhost.net (193.113.108.185) by EVMED06-UKBR.bt.com (10.216.161.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 25 Aug 2017 09:11:38 +0100 Original-Received: from tpw09926dag12h.domain1.systemhost.net (10.9.212.36) by EVHUB03-UKBR.domain1.systemhost.net (193.113.108.185) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 25 Aug 2017 09:11:40 +0100 Original-Received: from tpw09926dag12e.domain1.systemhost.net (10.9.212.12) by tpw09926dag12h.domain1.systemhost.net (10.9.212.36) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Fri, 25 Aug 2017 09:11:38 +0100 Original-Received: from tpw09926dag12e.domain1.systemhost.net ([fe80::b8c9:c264:c4b3:b898]) by tpw09926dag12e.domain1.systemhost.net ([fe80::b8c9:c264:c4b3:b898%12]) with mapi id 15.00.1293.002; Fri, 25 Aug 2017 09:11:38 +0100 Thread-Topic: bug#24848: [sh-script] How to save "Local rules set" result from sh-learn-buffer-indent? Thread-Index: AQHTHNYjY9CjYqE9/kGSEHgspxmKaqKTf0gugADFBOaAAHJIjw== In-Reply-To: <87inhca1s9.fsf@users.sourceforge.net> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.187.101.36] 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:136185 Archived-At: Hi Noam,=0A= =0A= Thanks for the suggestions.=0A= =0A= I don't know whether my Emacs uses smie for sh-mode but there's apparently = no sh-use-smie variable set by default.=0A= =0A= However, running smie-config-guess seems to have the same effect as sm-lear= n-buffer-indent so perhaps it does. Unfortunately, I've still not managed = to save the config.=0A= =0A= Here's what I did:=0A= =0A= 1. I ran smie-config-guess on a correctly-indented bash script (see below) = and confirmed that it now indents as I would expect when I hit tab on any l= ine).=0A= =0A= 2. I then ran smie-save-config and it said it saved it to smie-config.=0A= =0A= 3. I ran customize-variable on smie-config and its value is now ((2 :elem b= asic 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.=0A= =0A= 4. I then clicked Apply and Save to add the setting to my ~/.emacs file.=0A= =0A= 5. I confirmed that it now appears in the (custom-set-variables ... ) secti= on.=0A= =0A= 6. I restarted Emacs and loaded the bash script.=0A= =0A= 7. As feared, indentation is back to the way I don't like.=0A= =0A= 8. I then modified the smie-config entry in (custom-set-variables ... ) to = correspond with your expression (that mentions "then").=0A= =0A= 9. I restarted Emacs and loaded the bash script.=0A= =0A= 10. Sadly, indentation is still unaffected.=0A= =0A= The bash script I've used as a test here is:=0A= =0A= #!/usr/bin/env bash=0A= =0A= if [ "$1" ]=0A= then=0A= echo "First argument is: $1"=0A= else=0A= echo "No arguments"=0A= fi=0A= =0A= In case there's a problem with formatting by the time this email reaches yo= u, only the two echo lines are indented, and each by two spaces. Hitting t= ab on the first of these changes the indent to four spaces; on the second, = indentation remains at two.=0A= =0A= Regards,=0A= =0A= Richard=