From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Neil Roberts Newsgroups: gmane.emacs.bugs Subject: bug#33400: 26.1; Order changed for overriding =?UTF-8?Q?=E2=80=9Cnil=E2=80=9D?= mode in dir-locals Date: Thu, 15 Nov 2018 14:21:27 +0100 Message-ID: <87tvkiwk6g.fsf@yahoo.co.uk> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1542291934 31892 195.159.176.226 (15 Nov 2018 14:25:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2018 14:25:34 +0000 (UTC) To: 33400@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 15 15:25:30 2018 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 1gNIaH-0008BX-NM for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Nov 2018 15:25:29 +0100 Original-Received: from localhost ([::1]:39122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNIcO-0006nt-6j for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Nov 2018 09:27:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNIV8-0000YO-1h for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 09:20:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNIV3-0005OT-Oq for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 09:20:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48877) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNIV3-0005OD-9M for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 09:20:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNIV3-0002WI-4S for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 09:20:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Neil Roberts Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Nov 2018 14:20:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33400 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.15422916009652 (code B ref -1); Thu, 15 Nov 2018 14:20:05 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Nov 2018 14:20:00 +0000 Original-Received: from localhost ([127.0.0.1]:53133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNIUx-0002VW-9W for submit@debbugs.gnu.org; Thu, 15 Nov 2018 09:20:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNHap-0001Al-8u for submit@debbugs.gnu.org; Thu, 15 Nov 2018 08:21:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNHai-0006ds-Mj for submit@debbugs.gnu.org; Thu, 15 Nov 2018 08:21:54 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNHai-0006dn-JX for submit@debbugs.gnu.org; Thu, 15 Nov 2018 08:21:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNHag-0002dK-UF for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 08:21:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNHab-0006Yp-A8 for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 08:21:50 -0500 Original-Received: from sonic311-30.consmr.mail.ir2.yahoo.com ([77.238.176.162]:41061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNHaZ-0006Tn-3j for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 08:21:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1542288091; bh=bb0c2gP9xK1+jBnt1KegV5/VgdC0XlSYUGX7Jmw4PEA=; h=From:To:Subject:Date:From:Subject; b=Ea6H5vbH7DH2v2RnF0YnpYbz2pkQMvmGMIRY03FwO017DHovL+ow+hQfGCOOTGk5KWV1AQhvoNfYB6GTpEb9SK2t7J0cd7kZuhQPBX5XK1vrjb1aHc2+Qpr/SSsP+iUTP6UOI8qeOHSZT1+Fa5ek+bFRDb4Oyeu4JAV9pHaK2tLQu5XFEXuY+K3gJtsH785ShaydRd+s4iUQid4I5Y1hMZbcbXUhGA4QbRRs2I2zrZm9wThRcjDisqLF89i1wJJ5Tnjzt6LBkSB9hmkTEnTvieO0SuA/9wwSweketkQRm1KQNjcPEcZt+2k0en68ZBY+BCDIRONLw4zv/8DXuNiATA== X-YMail-OSG: _TrklOkVM1nmh9TScLl9JJStsOCPl8OB073HZAdSS8KDL65mzDMSWkitF3Kb94X dMpa3J9gbpd8mo_zdWlrrYRVMqFg88kK_MNKxKtv17.CZvXhJg04yuk_IhPo0akDji79H4mZEk1O HOLfJKXCNEk0iIBkPTOwK0NOgsSoRhH8PuJaQ16TY4Xj8u4iZPAoHZKe6r.U.OvNKlR4b5OPe5YY NT2SGVAnz1yUK0P17rFCYqiP4RyHwA6GR6TiOMHYah1YOWPdjWJj_buGQbWp_K_IrbPldqLLFcYe fkf_4JdQ2DjUbT4LVqZj7Yo8WfsJDFJKp6Z.XUZp7LZ7604T_Tz7tnM__55CVD_vWoLno7EjkGoH h2B1KobyFSHMEIcXS3KjDKnqeydVQOKubTjmQzl5jqaXKxcvH1WDzEMjFRpBmlaCqIeTAsW.epzV RQg_UHrrNuquO8nKNx3F.2MNCU5ApaxItz5Re4ntxyZe.23FPapg9UfMw_jxfypB04FGMDIAm4WK DY0_ABSKWBSDfGHytOaFpnSOuvY6DPW9nqBGdVY9iekKY9BsYCcNOfuG8ozKubB_EbnkaQUcHf6N ndCqRiF1hKXrBCKEt__b802iqZiYyZIi94MhLVkY0j1RjtZngfdXbkHSqtBtmzH4UfHr5NZ5oSbp gVn7f2p4X9oz9zppo5YTsrBFGKpLkxRz0DKVgHtg0wjQf7oe0pX9rnTZ_7tY5.o.45Qh0qC4543r HrpOqADnDe01I7SRWkRLr1ct_2t8t2Mu2sgNcA2eX7LlGG0CQnjYxARhcppE7s0lM0rO9iYsicHd .3pNOLleRPnutCRnxqocrhUpnCS.R_oByq57qJG4HT Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Thu, 15 Nov 2018 13:21:31 +0000 Original-Received: from lns-bzn-38-82-253-104-2.adsl.proxad.net (EHLO localhost) ([82.253.104.2]) by smtp422.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 71f2af5c13edbd68d0dea6775fc841dc for ; Thu, 15 Nov 2018 13:21:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Thu, 15 Nov 2018 09:19:57 -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:152419 Archived-At: There is a project called Piglit with a .dir_locals.el file=C2=B9 like this: ((nil . ((indent-tabs-mode . t))) (python-mode . ((indent-tabs-mode . nil)))) I think the intention is that most files in the project should use indent-tabs-mode but Python files should not. This doesn=E2=80=99t seem to = work in 26.1 and the definition for the nil mode overrides the definition for the Python mode and Emacs enables tab indentation for Python files. If I swap the order of the two lines then the Python mode overrides the nil mode and it works as intended. However, this appears to be a change in 26.1. Previously the opposite order gets the right behaviour. In git master the behaviour is fixed again so that the order shown above makes it work. I bisected the fix down to 97b7e58c4d34722e8b0. However it doesn=E2=80=99t look like this is deliberately fixing the bug. It looks = like it=E2=80=99s due to the fact that a call like the following ends up reversi= ng the order of newvars as a side effect: (map-merge-with 'list 'func nil newvars) That commit just makes it avoid calling map-merge-with when there is only one file. So presumably the bug still exists in git master when there are multiple files. Perhaps you could argue that this isn=E2=80=99t really a bug and that having multiple values for a directory local variable is just undefined behaviour. However I think the previous behaviour was quite useful and it would be nice to maintain it. Or maybe ideally it could even just say that any more specific mode overrides any less specific mode. This was discussed on StackExchange here: https://emacs.stackexchange.com/questions/45998 - Neil 1. https://cgit.freedesktop.org/piglit/tree/.dir-locals.el In GNU Emacs 26.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.22.30) of 2018-06-26 built on buildhw-10.phx2.fedoraproject.org Windowing system distributor 'Fedora Project', version 11.0.11906000 System Description: Fedora release 28 (Twenty Eight) Configured using: 'configure --build=3Dx86_64-redhat-linux-gnu --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64 --libexecdir=3D/usr/libexec --localstatedir=3D/var --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3 --with-gpm=3Dno --with-xwidgets --with-modules build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=3D-Wl,-z,relro PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS XWIDGETS LCMS2 Important settings: value of $LANG: fr_FR.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: GNUmakefile Minor modes in effect: shell-dirtrack-mode: t whitespace-mode: t show-paren-mode: t diff-auto-refine-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Load-path shadows: None found. Features: (shadow emacsbug completion info ibuf-ext ibuffer ibuffer-loaddefs bug-reference autoconf autoconf-mode notmuch-jump mhtml-mode css-mode eww flyspell js pp rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode nxml-util nxml-enc xmltok dired-aux smerge-mode conf-mode view ffap tramp-cmds tabify imenu man make-mode apropos ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff python files-x tramp-cache tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize sh-script smie executable cmake-mode rx cl-print debug grep cl-extra eieio-opt speedbar sb-image ezimage dframe find-func doc-view jka-compr image-mode shell pcomplete find-dired shr-color color shr svg dom misearch multi-isearch sendmail qp ispell mm-archive sort mail-extr whitespace server gtags paren notmuch hl-line notmuch-message notmuch-hello notmuch-tree notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser notmuch-wash diff-mode coolj notmuch-query goto-addr icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag edmacro kmacro crm notmuch-lib notmuch-version notmuch-compat gnus-html url-queue help-fns radix-tree help-mode browse-url url-cache mm-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core eieio-loaddefs url-vars gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus nnheader javadoc-help thingatpt advice git log-edit easy-mmode message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log ewoc cus-edit cus-start cus-load iso-transl color-theme-subdued color-theme-neil-dark cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs warnings elec-pair compile comint ansi-color ring color-theme easymenu wid-edit cl clang-rename clang-include-fixer let-alist json map seq byte-opt bytecomp byte-compile cconv clang-format cl-macs gv xml cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded 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 dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 3743848 478859) (symbols 48 51709 1) (miscs 40 98163 24087) (strings 32 331746 46857) (string-bytes 1 25016091) (vectors 16 79464) (vector-slots 8 2261743 505600) (floats 8 665 2273) (intervals 56 503332 20703) (buffers 992 695))