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 07:44:41 +0000 Message-ID: <1505115881331.63387@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> 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 1505115943 15353 195.159.176.226 (11 Sep 2017 07:45:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2017 07:45:43 +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 09:45:36 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 1drJPC-0002xn-Ii for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 09:45:18 +0200 Original-Received: from localhost ([::1]:55987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drJPJ-0005vG-VV for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 03:45:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drJP8-0005ui-GZ for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 03:45:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drJP4-0004G0-7m for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 03:45:14 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drJP4-0004Fk-3K for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 03:45:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1drJOw-0001Og-DH for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 03:45: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 07:45: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.15051158975342 (code B ref 24848); Mon, 11 Sep 2017 07:45:02 +0000 Original-Received: (at 24848) by debbugs.gnu.org; 11 Sep 2017 07:44:57 +0000 Original-Received: from localhost ([127.0.0.1]:60394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drJOr-0001O6-1F for submit@debbugs.gnu.org; Mon, 11 Sep 2017 03:44:57 -0400 Original-Received: from smtpb1.bt.com ([62.7.242.135]:7230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drJOp-0001Nt-4S for 24848@debbugs.gnu.org; Mon, 11 Sep 2017 03:44:55 -0400 Original-Received: from E07HT05-UKBR.domain1.systemhost.net (193.113.197.167) by EVMED01-UKBR.bt.com (10.216.161.31) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Sep 2017 08:44:45 +0100 Original-Received: from tpw09926dag12e.domain1.systemhost.net (10.9.212.12) by E07HT05-UKBR.domain1.systemhost.net (193.113.197.167) with Microsoft SMTP Server (TLS) id 8.3.342.0; Mon, 11 Sep 2017 08:44:48 +0100 Original-Received: from tpw09926dag12e.domain1.systemhost.net (10.9.212.12) by tpw09926dag12e.domain1.systemhost.net (10.9.212.12) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 11 Sep 2017 08:44:41 +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 08:44:41 +0100 Thread-Topic: bug#24848: [sh-script] How to save "Local rules set" result from sh-learn-buffer-indent? Thread-Index: AQHTHNYjY9CjYqE9/kGSEHgspxmKaqKTf0gugADFBOaAAHJIj4AARNOCgAAXHmGACIiFj4AG2m5ogAdB3CGAA7Hozw== In-Reply-To: <87o9qkg4tn.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.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:136769 Archived-At: 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=