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: Mon, 11 Sep 2017 09:53:50 +0000 Message-ID: <1505123630318.10795@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> <1503648698123.80907@bt.com> <87d17jam0g.fsf@users.sourceforge.net> <1503668647564.74012@bt.com> <871sns8vm0.fsf@users.sourceforge.net> <1504513809301.60282@bt.com>, <87o9qkg4tn.fsf@users.sourceforge.net>, <1505115881331.63387@bt.com> 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 1505123673 26507 195.159.176.226 (11 Sep 2017 09:54:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2017 09:54:33 +0000 (UTC) To: , <24848@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 11 11:54: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 1drLPt-0005os-WF for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 11:54:10 +0200 Original-Received: from localhost ([::1]:56417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drLQ1-00027D-3c for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 05:54:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drLPt-00025Y-5Q for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 05:54:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drLPn-0001U3-9d for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 05:54:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drLPn-0001Tj-5e for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 05:54:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1drLPm-0004WN-C8 for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 05:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2017 09:54:02 +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: patch Original-Received: via spool by 24848-submit@debbugs.gnu.org id=B24848.150512363917369 (code B ref 24848); Mon, 11 Sep 2017 09:54:02 +0000 Original-Received: (at 24848) by debbugs.gnu.org; 11 Sep 2017 09:53:59 +0000 Original-Received: from localhost ([127.0.0.1]:60525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drLPj-0004W5-Br for submit@debbugs.gnu.org; Mon, 11 Sep 2017 05:53:59 -0400 Original-Received: from smtpb1.bt.com ([62.7.242.141]:14544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drLPh-0004Vr-Rj for 24848@debbugs.gnu.org; Mon, 11 Sep 2017 05:53:58 -0400 Original-Received: from EVMHT05-UKBR.domain1.systemhost.net (193.113.108.58) by EVMED05-UKBR.bt.com (10.216.161.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Sep 2017 10:53:48 +0100 Original-Received: from tpw09926dag12h.domain1.systemhost.net (10.9.212.36) by EVMHT05-UKBR.domain1.systemhost.net (193.113.108.58) with Microsoft SMTP Server (TLS) id 8.3.342.0; Mon, 11 Sep 2017 10:53:51 +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; Mon, 11 Sep 2017 10:53:50 +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; Mon, 11 Sep 2017 10:53:50 +0100 Thread-Topic: bug#24848: [sh-script] How to save "Local rules set" result from sh-learn-buffer-indent? Thread-Index: AQHTHNYjY9CjYqE9/kGSEHgspxmKaqKTf0gugADFBOaAAHJIj4AARNOCgAAXHmGACIiFj4AG2m5ogAdB3CGAA7Hoz4AAI83z In-Reply-To: <1505115881331.63387@bt.com> 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.39] 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:136771 Archived-At: I've added the code to an unzipped version of smie.el and to sh-script.el a= nd byte-compiled both. Emacs loads without errors now, but to be honest, I= 'm unsure how to check that it now loads smie-config properly! I load a sc= ript file and check the value of smie-config and it says it's set for the c= urrent session only but its value is nil.=0A= =0A= ________________________________________=0A= From: Wiseman,R,Richard,TUK2 R=0A= Sent: 11 September 2017 08:44=0A= To: npostavs@users.sourceforge.net; 24848@debbugs.gnu.org=0A= Subject: Re: bug#24848: [sh-script] How to save "Local rules set" result fr= om sh-learn-buffer-indent?=0A= =0A= You're quite right: my smie library is gzipped. I had no idea that might b= e the case!=0A= =0A= I tried your suggestion of putting the code into my .emacs file but it didn= 't seem to like that...=0A= =0A= =0A= Warning (initialization): An error occurred while loading `/home/richard/.e= macs':=0A= =0A= Symbol's value as variable is void: smie-config--modefuns=0A= =0A= To ensure normal operation, you should investigate and remove the=0A= cause of the error in your initialization file. Start Emacs with=0A= the `--debug-init' option to view a complete error backtrace.=0A= =0A= =0A= (I put it right at the end: I assumed that was safest.)=0A= =0A= I'll try and apply the patch to an unzipped version of smie.el.gz instead, = and let you know how that goes.=0A= =0A= Regards,=0A= =0A= Richard=0A= =0A= =0A= ________________________________________=0A= From: Noam Postavsky on behalf of npostavs@users.sourc= eforge.net =0A= Sent: 09 September 2017 00:15=0A= To: Wiseman,R,Richard,TUK2 R=0A= Cc: 24848@debbugs.gnu.org=0A= Subject: Re: bug#24848: [sh-script] How to save "Local rules set" result fr= om sh-learn-buffer-indent?=0A= =0A= writes:=0A= =0A= > Thanks Noam. I'm not sure I've got any way to test this patch,=0A= > though... I don't seem to have an smie.el file anywhere. I've=0A= > installed the emacs24-el package expecting that to contain it but it=0A= > doesn't -- at least, I've searched my entire hard drive for it (using=0A= > sudo, just in case) and it wasn't found.=0A= =0A= What does M-x find-library RET smie RET give you?=0A= =0A= I see /usr/share/emacs/24.5/lisp/emacs-lisp/smie.el.gz listed in=0A= https://packages.ubuntu.com/zesty/all/emacs24-el/filelist. If you have=0A= the gzipped version, you might have to unzip before you can apply the=0A= patch.=0A= =0A= Alternatively, I'm fairly sure if you just drop the patched definitions=0A= of smie-config--setter and smie-config into your .emacs it will have the=0A= same effect:=0A= =0A= (defun smie-config--setter (var value)=0A= (set-default var value)=0A= (let ((old-modefuns smie-config--modefuns))=0A= (setq smie-config--modefuns nil)=0A= (pcase-dolist (`(,mode . ,rules) value)=0A= (let ((modefunname (intern (format "smie-config--modefun-%s" mode= ))))=0A= (fset modefunname (lambda () (smie-config--mode-hook rules)))= =0A= (push modefunname smie-config--modefuns)=0A= (add-hook (intern (format "%s-hook" mode)) modefunname)))=0A= ;; Neuter any left-over previously installed hook.=0A= (dolist (modefun old-modefuns)=0A= (unless (memq modefun smie-config--modefuns)=0A= (fset modefun #'ignore)))))=0A= =0A= (defcustom smie-config nil=0A= ;; FIXME: there should be a file-local equivalent.=0A= "User configuration of SMIE indentation.=0A= This is a list of elements (MODE . RULES), where RULES is a list=0A= of elements describing when and how to change the indentation rules.=0A= Each RULE element should be of the form (NEW KIND TOKEN NORMAL),=0A= where KIND and TOKEN are the elements passed to `smie-rules-function',= =0A= NORMAL is the value returned by `smie-rules-function' and NEW is the=0A= value with which to replace it."=0A= :version "24.4"=0A= ;; FIXME improve value-type.=0A= :type '(choice (const nil)=0A= (alist :key-type symbol))=0A= :initialize 'custom-initialize-set=0A= :set #'smie-config--setter)=0A=