From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matej =?UTF-8?Q?Ko=C5=A1=C3=ADk?= Newsgroups: gmane.emacs.bugs Subject: bug#29414: 24.5; failure to configure a particular Ocaml indentation parameter (via SMIE) Date: Thu, 23 Nov 2017 16:59:20 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MIh2jkvsXSwKNJBQ4jeTj8C6aUB1umLbp" X-Trace: blaine.gmane.org 1511457333 7650 195.159.176.226 (23 Nov 2017 17:15:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Nov 2017 17:15:33 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 Cc: monnier@IRO.UMontreal.CA To: 29414@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 23 18:15: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 1eHv5k-0000p2-Q1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Nov 2017 18:15:13 +0100 Original-Received: from localhost ([::1]:45406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHv5s-0003wN-7H for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Nov 2017 12:15:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHv5f-0003sx-IK for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 12:15:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHv5a-0008Uo-N8 for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 12:15:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHv5a-0008US-JK for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 12:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHv5a-0000C2-5r for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 12:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matej =?UTF-8?Q?Ko=C5=A1=C3=ADk?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Nov 2017 17:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29414 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1511457256655 (code B ref -1); Thu, 23 Nov 2017 17:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Nov 2017 17:14:16 +0000 Original-Received: from localhost ([127.0.0.1]:54089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHv4p-0000AT-5B for submit@debbugs.gnu.org; Thu, 23 Nov 2017 12:14:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHuTm-0007kX-G6 for submit@debbugs.gnu.org; Thu, 23 Nov 2017 11:35:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHuTf-000360-Mc for submit@debbugs.gnu.org; Thu, 23 Nov 2017 11:35:53 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHuTf-00035c-F6 for submit@debbugs.gnu.org; Thu, 23 Nov 2017 11:35:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHuTb-0007gi-C3 for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 11:35:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHuTX-0002wy-R9 for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 11:35:47 -0500 Original-Received: from 105.ip-145-239-83.eu ([145.239.83.105]:58876 helo=matej-kosik.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHuTX-0002sd-EB for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 11:35:43 -0500 Original-Received: from [192.168.1.10] (adsl-dyn76.78-99-102.t-com.sk [78.99.102.76]) by matej-kosik.net (Postfix) with ESMTPSA id 71A3F230FE; Thu, 23 Nov 2017 16:59:22 +0100 (CET) Openpgp: id=1CD41D0A52319DC7ABC1B79F50AFFA128CE48649; url=http://matej-kosik.net/doc/kosik.asc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Thu, 23 Nov 2017 12:14:13 -0500 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:140269 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MIh2jkvsXSwKNJBQ4jeTj8C6aUB1umLbp Content-Type: multipart/mixed; boundary="9TsccXGvGUrDFCmGOokQD27KCmsVGKAnH"; protected-headers="v1" From: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= To: bug-gnu-emacs@gnu.org Cc: monnier@IRO.UMontreal.CA Message-ID: Subject: 24.5; failure to configure a particular Ocaml indentation parameter (via SMIE) --9TsccXGvGUrDFCmGOokQD27KCmsVGKAnH Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, I would like to configure Emacs, while editing Ocaml code, so that it indents the code consistently with the way how "Ocaml Batteries Included"= is indented. (or any kind of sane convention --- I don't care particularly which one as long as I can override the default behavior which I find distracting)= However, my attempts to do this failed. This is what I have tried to do: -------------------------------------------------------------------------= ----- - I have "tuareg 2.1.0" installed - My "~/.emacs" file contains only the following line: (load "/home/mkosik/.opam/4.06.0/share/emacs/site-lisp/tuareg-site-fi= le") It is the line that was printed as a suggestion at the end of the Tuare= g installation (via OPAM). - NOTE: The designated file /home/mkosik/.opam/4.06.0/share/emacs/site-lisp/tuareg-site-file does not exist. Is that to be expected? - I go to this line: https://github.com/ocaml-batteries-team/batteries-included/blob/e069e= 28678a0d15d338721e1ff5e480fe0ad26c5/src/batComplex.ml#L82-L83 - change the indentation to a non-default value (e.g. moving that line 4 = more spaces to the right) (NOTE: at this point, I have just randomly chosen any non-default value= ) - I run the following command: M-x smie-config-set-indent I see the following question Adjust rule (:before "|-or" -> nil) to (default 4) I press ENTER. Then I see a message: Added rule :before "|-or" -> 4 (via nil) - I run the following command: smie-config-save I see a message: Local rules saved in `smie-config` - I run the following command: M-: (print smie-config) I see ((tuareg-mode (4 :before "|-or" nil))) ((tuareg-mode (4 :before "|-or" nil))) I have no idea whether this an expected or unexpected value. :-/ - I run the following command: M-x customize-save-customized I see a message: Wrote /home/mkosik/.emacs - Now my ~/.emacs file looks like this: (load "/home/mkosik/.opam/4.06.0/share/emacs/site-lisp/tuareg-site-fi= le") (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(inhibit-startup-screen t) '(smie-config (quote ((tuareg-mode (4 :before "|-or" nil)))))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) NOTE: I have no idea whether this is an expected value or not. I do not understand the meaning of "smie-config" variable. I am now going to test whether my setting had any effect, so: - I close my Emacs window. - I launch Emacs again with the same file and I place the cursor to the s= ame line as before: https://github.com/ocaml-batteries-team/batteries-included/blob/e069e= 28678a0d15d338721e1ff5e480fe0ad26c5/src/batComplex.ml#L82-L83 - I press TAB. What I see is that the whole line is shifted to the right by 2 columns.= I don't understand why by 2 columns to the right? Why wasn't the line indented by 4 columns to the right (this is what I defined above as desired indentation). Incidentally, whatever value I set as a desired indentation, after I restart Emacs and press TAB on a given line, the line always moves by 2 places to the right. Why? -------------------------------------------------------------------------= ----- In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-12 on hullmann, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.1190200= 0 System Description: Debian GNU/Linux 9.2 (stretch) Configured using: `configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/local/share/emacs/= 24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/sit= e-lisp:/usr/share/emacs/site-lisp --without-gnutls --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/local/share/emacs/= 24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/sit= e-lisp:/usr/share/emacs/site-lisp --without-gnutls --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -fdebug-prefix-map=3D/build/emacs24-24.5+1=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall -fno-PIE' 'CPPFLAGS=3D-Wdate-ti= me -D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-z,relro -no-pie'' Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Tuareg Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)... Loading cjk-enc...done Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done Loading /etc/emacs/site-start.d/50noweb.el (source)...done Loading /home/mkosik/.opam/4.06.0/share/emacs/site-lisp/tuareg-site-file.= =2E.done For information about GNU Emacs and the GNU system, type C-h C-a. Auto-saving...done Quit Saving file /home/mkosik/git/other/batteries-included/src/batComplex.ml..= =2E Wrote /home/mkosik/git/other/batteries-included/src/batComplex.ml Load-path shadows: /usr/share/emacs/24.5/site-lisp/debian-startup hides /usr/share/emacs/sit= e-lisp/debian-startup Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils vc-git tuareg speedbar sb-image ezimage dframe compile comint ansi-color ring smie easymenu package epg-config time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --9TsccXGvGUrDFCmGOokQD27KCmsVGKAnH-- --MIh2jkvsXSwKNJBQ4jeTj8C6aUB1umLbp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEHNQdClIxncerwbefUK/6EozkhkkFAloW8FgACgkQUK/6Eozk hklhkRAAqJGlMzCNOnOOJTsLhEL1XuH+J+jBXq1981Yh8G7z/RKZRXyRvB5UF3xU T0NZs6YFZDNeJawaWY6xK5wvC6S0zhdxz8hv9qhYmPTz5oBV5D+qfzG6+VMlyv4R btit6wELfM+3gqW3J2cnCC6ze2bYxBAvKq0xG0NceoM53e3U9mbdBnw1cY6B5cxR qaxhYdzo7XM5W5oOS7TeFfrvRy0dhHqP/LaerpFQQs6IxtyrxN5kjxIcG3TeWGnI hrR6/1f3A7+ObXrBDhAuQPu57LBC2YzRcaliju4RcmlJvGKlisZVeZys6xLBfRMy T52w5UL7/u5alv0aUEldLWLZwVsc99TUsb+9ibtxV0Qm0pVaycMaNabB9MnVuQA9 boIqF8G14q+iqqNHyMEg9hIwFEacllvl4c7EkJyAwSKmTPHgVNKBhThQrAAwVPJ1 vDvl2abGNdS+A/tjkAGoZzyC3+95VBRbegnLzIEI2NjcAZeMvOaLQVkFyvv/NwfY Jf1huAQ84Mg3JCooWgr5eTiEOLgex8+yynR1z7EaoboMPkMKehQ+OBIfo/CPkLcF wJGjY9zuDZy5efegcaDGbiapuNX+UwSFoy/QjWgDqruBlq7F2/HsugBBkxuIDfwl oVSG2ySQKbndJok0aTmhzyJ5sk5wuYB7zuiTYyPAM11VAxyu95Q= =Pmok -----END PGP SIGNATURE----- --MIh2jkvsXSwKNJBQ4jeTj8C6aUB1umLbp--