From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: 26.1; Order changed for overriding =?UTF-8?Q?=E2=80=9Cnil=E2=80=9D?= mode in dir-locals 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: To: 33400@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15422916009652 (code B ref -1); Thu, 15 Nov 2018 14:20:05 +0000 Received: (at submit) by debbugs.gnu.org; 15 Nov 2018 14:20:00 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 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 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 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 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_oByq57qJG4HTEYmthWnOppPED261ungOmzSvSfYVVyg3XO ZeEPAEUbUz2VXrwSwASjdcP34WAKY4QjDtM4UPRJousk.mXRpeJ_FQcyOVn47d9JVrXG3TMP7Ziv nt_k7GC.HQ7evD.NNlFiJkGZVlspGgtz0aNQPNVjoXugtm78jHlGD6pkLLBKz2REgnUoelKP0fZr NR.NUZw-- 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 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) From: Neil Roberts Date: Thu, 15 Nov 2018 14:21:27 +0100 Message-ID: <87tvkiwk6g.fsf@yahoo.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) 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)) From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Neil Roberts Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Nov 2018 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33400@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15423049486203 (code B ref -1); Thu, 15 Nov 2018 18:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Nov 2018 18:02:28 +0000 Received: from localhost ([127.0.0.1]:54420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNLyF-0001bb-Va for submit@debbugs.gnu.org; Thu, 15 Nov 2018 13:02:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNLyD-0001X2-Q5 for submit@debbugs.gnu.org; Thu, 15 Nov 2018 13:02:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNLy5-0004L5-Cz for submit@debbugs.gnu.org; Thu, 15 Nov 2018 13:02:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNLy0-00042x-QD for submit@debbugs.gnu.org; Thu, 15 Nov 2018 13:02:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNLxy-0006ji-N9 for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 13:02:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNLxt-0003WW-2V for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 13:02:09 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:42904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNLxj-0002d1-Be for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2018 13:01:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=UW2kPNEHE0PHxNYZkBHUVxc4wZxsA9jVxZPKOimuLQw=; b=d2KsOFwF10u7C6x05CTemlk2idoGOzIOdT+feLnMHH9HRpXl9H8/JFBqmmHjiJWp2GD87NBmqsN64C67VdVKRSuwqXChqfXEn83Nk9r60v4oKgZMGrarpmpe9vT3SCjWaWXKsOmpMQpn5zteow5w05V22yDelm0Pm4CORKC/6PKnDokuXXfCmnl8RD8ZuPQtgfJpXufU5y6Zqyu4mArfqqYH1PteR7Ycf3EaqAa9xKKjpjv+PMY73chPaY9kGuLrer/0JSACIAVhOeQa0eu7jro2n3wYgmluBDZwwJ3Vix0jkprOonkRDO5k3txOu+ya/z5CKMKD/4kpyOQoGANPIA==; Received: from lns-bzn-38-82-253-104-2.adsl.proxad.net ([82.253.104.2] helo=localhost.localdomain) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gNLxf-0005pq-9f for ; Thu, 15 Nov 2018 19:01:51 +0100 From: Neil Roberts Date: Thu, 15 Nov 2018 19:01:17 +0100 Message-Id: <20181115180117.10423-1-bpeeluk@yahoo.co.uk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <87tvkiwk6g.fsf@yahoo.co.uk> References: <87tvkiwk6g.fsf@yahoo.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) The list of dir local variables to apply is now sorted by the number of parent modes of the mode used as the key in the association list. That way when the variables are applied in order the variables from more specific modes will override those from less specific modes. If there are directory entries in the list then they are sorted in order of name length. The list of modes for that dir is then recursively sorted with the same mechanism. That way variables tied to a particular subdirectory override those in in a parent directory. Previously the behaviour didn’t seem to be well defined anyway and was dependent on the order they appeared in the file. However this order was changed in version 26.1 and it probably also depended on the number of dir-local files that are merged. Bug#33400 --- lisp/files.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index dbac6f614f..09bee6a5f9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4093,6 +4093,51 @@ dir-locals-find-file (declare-function map-merge-with "map" (type function &rest maps)) (declare-function map-merge "map" (type &rest maps)) +(defun dir-locals-get-sort-score (node) + "Return a number used for sorting the definitions of dir locals. +NODE is assumed to be a cons cell where the car is either a +string or a symbol representing a mode name. + +If it is a mode then the the depth of the mode (ie, how many +parents that mode has) will be returned. + +If it is a string then the length of the string plus 1000 will be +returned. + +Otherwise it returns -1. + +That way the value can be used to sort the list such that deeper +modes will be after the other modes. This will be followed by +directory entries in order of length. If the entries are all +applied in order then that means the more specific modes will +override the values specified by the earlier modes and directory +variables will override modes." + (let ((key (car node))) + (cond ((null key) -1) + ((symbolp key) + (let ((mode key) + (depth 0)) + (while (setq mode (get mode 'derived-mode-parent)) + (setq depth (1+ depth))) + depth)) + ((stringp key) + (+ 1000 (length key))) + (t -2)))) + +(defun dir-locals-sort-variables (variables) + "Sorts VARIABLES so that applying them in order has the right effect. +The variables are compared by dir-locals-get-sort-score. Directory entries +are then recursively sorted using the same criteria." + (setq variables (sort variables + (lambda (a b) + (< (dir-locals-get-sort-score a) + (dir-locals-get-sort-score b))))) + (dolist (n variables) + (when (stringp (car n)) + (setcdr n (dir-locals-sort-variables (cdr n))))) + + variables) + (defun dir-locals-read-from-dir (dir) "Load all variables files in DIR and register a new class and instance. DIR is the absolute name of a directory which must contain at @@ -4130,6 +4175,7 @@ dir-locals-read-from-dir variables newvars)))))) (setq success latest)) + (setq variables (dir-locals-sort-variables variables)) (dir-locals-set-class-variables class-name variables) (dir-locals-set-directory-class dir class-name success) class-name)) -- 2.17.1 From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: 26.1; Order changed for overriding =?UTF-8?Q?=E2=80=9Cnil=E2=80=9D?= mode in dir-locals Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Nov 2018 09:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Neil Roberts , 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.15423617335273 (code B ref 33400); Fri, 16 Nov 2018 09:49:02 +0000 Received: (at 33400) by debbugs.gnu.org; 16 Nov 2018 09:48:53 +0000 Received: from localhost ([127.0.0.1]:54779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNak9-0001Mz-EZ for submit@debbugs.gnu.org; Fri, 16 Nov 2018 04:48:53 -0500 Received: from smtp-3.orcon.net.nz ([60.234.4.44]:57723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNak6-0001Mp-RB for 33400@debbugs.gnu.org; Fri, 16 Nov 2018 04:48:52 -0500 Received: from [150.107.172.17] (port=9344 helo=[192.168.20.103]) by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1gNak4-0003z7-4I; Fri, 16 Nov 2018 22:48:48 +1300 References: <87tvkiwk6g.fsf@yahoo.co.uk> From: Phil Sainty Message-ID: <55e14209-801c-921d-dbcb-3146b334bed8@orcon.net.nz> Date: Fri, 16 Nov 2018 22:48:47 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87tvkiwk6g.fsf@yahoo.co.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 16/11/18 2:21 AM, Neil Roberts wrote: > Perhaps you could argue that this isn’t 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. I agree -- it makes intuitive sense for it to work that way, and I firmly believe that people *do* use it that way already (as per the example given), as the documentation always presented examples with the nil case first, and therefore following its example would result in that intuitive functionality (except in 26.1). I'd like to see this fixed in 26.2, as I feel it's a very unexpected change which can break things for users in confusing ways. -Phil From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: BUMP: please merge the fix for this bug References: <87tvkiwk6g.fsf@yahoo.co.uk> In-Reply-To: <87tvkiwk6g.fsf@yahoo.co.uk> Resent-From: Mark Janes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Apr 2019 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.15562122281156 (code B ref 33400); Thu, 25 Apr 2019 17:11:02 +0000 Received: (at 33400) by debbugs.gnu.org; 25 Apr 2019 17:10:28 +0000 Received: from localhost ([127.0.0.1]:59243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJhtE-0000IY-Fa for submit@debbugs.gnu.org; Thu, 25 Apr 2019 13:10:28 -0400 Received: from mga04.intel.com ([192.55.52.120]:43396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJhr5-0000ES-H6 for 33400@debbugs.gnu.org; Thu, 25 Apr 2019 13:08:16 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 10:08:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,394,1549958400"; d="scan'208";a="167915766" Received: from normanwo-mobl.amr.corp.intel.com (HELO giraffe.jf.intel.com) ([10.251.31.84]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2019 10:08:12 -0700 From: Mark Janes Date: Thu, 25 Apr 2019 10:08:11 -0700 Message-ID: <87lfzy57yc.fsf@pigpen.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Mailman-Approved-At: Thu, 25 Apr 2019 13:10:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) The fix for this bug has been available for several months. Major distributions like debian have rolled out updates to Emacs which include this bug, harming the development of large community projects like Mesa. Can someone take a look and merge Neil's fix? From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: Merge with bug#30008? References: <87tvkiwk6g.fsf@yahoo.co.uk> In-Reply-To: <87tvkiwk6g.fsf@yahoo.co.uk> Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Apr 2019 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155630078517061 (code B ref 33400); Fri, 26 Apr 2019 17:47:02 +0000 Received: (at 33400) by debbugs.gnu.org; 26 Apr 2019 17:46:25 +0000 Received: from localhost ([127.0.0.1]:33497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK4vZ-0004R6-3a for submit@debbugs.gnu.org; Fri, 26 Apr 2019 13:46:25 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:35102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK4vV-0004Qs-P8 for 33400@debbugs.gnu.org; Fri, 26 Apr 2019 13:46:22 -0400 Received: by mail-wr1-f54.google.com with SMTP id f7so5556700wrs.2 for <33400@debbugs.gnu.org>; Fri, 26 Apr 2019 10:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=LogkSbOLyiORU73JPaa7ld638i2vie9ug2QpDY/AqR4=; b=h4PlcC5KtCOJXCBe/owVK6ClXMIT/HXLMGqlgNH28Oow9q7tsN2n/PjfQFsVWDZyCC XFqISHJgm7gQ0/RKVNlvuJqgOspKpSQ6v9g32K2d+/fwYoQ99eEais9X7Kvoh0s7QvIr JaZs176OgWv+9VXiE1ZZEmvI8I2Ad97EuovLxD1idmBa5MrrgXcfMLUqtH2IdziI+lhY cFdfJPhycehDZkFUZzrUon6w/vDgUJDMYU9OXngdnPlL11fNyFYRsFkig5fxwjiG3dSQ qNib9bUDADtL8HZ9x2Pz6SD4p8euXApTrtUHfoFwdaakbPpAxhBL9UNgwATLGSwDaqAr UPCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=LogkSbOLyiORU73JPaa7ld638i2vie9ug2QpDY/AqR4=; b=XMgtZjI9cqtVDiNUPOSSwXsw4Ew+TTf+6klI/VVEs1hH9FYwSXpxvPxIPKH94ojv1V 2gWY4ys9tB62TNMKlVQ6qT1M6pjPr+espoH91Lwkwy2DurPn/hwrJi7tIi+pT0G6C83P bCRYKqcglAIVw5m+8jvPhzVfIeLOJoRtm0R8wlmrFCT1eK2SvUUyOL2yjtOuQT6chieC EY6kdJ5l7cvUSYkFTVfFGIKZK+PS67MtFL84enXEStVrIK7Oj7zvlOhRhx+azIT+Q+YY Cu01CHlFDZGhw2MbYQK2uViwGlNPc00KoWxv3BQt6o4KjRD1Lg5dWUTYjOP+Qx41dsgG V+Pw== X-Gm-Message-State: APjAAAV52oMGm4q/7BL73aseD6BwsRmO4JX4dmBfC1rI4voNBmA70Luq W5Ilyb4ywqOpvwRSWZwNYdpCn4Z3 X-Google-Smtp-Source: APXvYqzFNgTk695wXKRBLTc8S1vqpkDRWFgjxc6zb2L+wykH+H0fAfFaOpWlcw10G5FcIn3x+35uSw== X-Received: by 2002:adf:9c91:: with SMTP id d17mr6559449wre.285.1556300775625; Fri, 26 Apr 2019 10:46:15 -0700 (PDT) Received: from nc10-laptop ([109.190.253.11]) by smtp.gmail.com with ESMTPSA id x11sm3722704wmc.46.2019.04.26.10.46.14 for <33400@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 10:46:14 -0700 (PDT) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Date: Fri, 26 Apr 2019 19:46:10 +0200 Message-ID: <87o94swtgd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, I just saw Mark's bump by chance; this reminds me of a report I made a year ago (bug#30008), which went unnoticed AFAICT. Are these two issues related? If that's the case, I guess they could be merged. From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2019 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Neil Roberts Cc: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155638836215585 (code B ref 33400); Sat, 27 Apr 2019 18:06:02 +0000 Received: (at 33400) by debbugs.gnu.org; 27 Apr 2019 18:06:02 +0000 Received: from localhost ([127.0.0.1]:35981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKRi5-00043F-L3 for submit@debbugs.gnu.org; Sat, 27 Apr 2019 14:06:01 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:32769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKRi2-00042x-Mi for 33400@debbugs.gnu.org; Sat, 27 Apr 2019 14:06:00 -0400 Received: by mail-qt1-f193.google.com with SMTP id g7so7798925qtc.0 for <33400@debbugs.gnu.org>; Sat, 27 Apr 2019 11:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=sHJ+1NBEdX8tpSR2gumpjHWRYp0mlux/Rc/skHcpL5g=; b=Bh5RFy+c6qC0Qj6pTdHq7MZOk+3nZquPtVXOQJK7hyYajQL+N256FMZHFLMP2gGaR8 XqzpITDbGi3+Qac0ntHmtamLdwJiFGwy65Ze29emqyNYNm6hMUEyV8hiJkgsz4hIhAjp 6iu9G/lvUKAaSCLi5LQvKkFywxZOFvk3qxkBPNFFcOFjcbZUAn1jFL3fUR3OYPflIIEy m5PwV1dpznkEjdEIOQSRfKz4TwKuZLGuHWrKoG9496Q8YV58Mp/Yt9w3flHjLg1zt9qG Wtg7MDxj1XKML1angX758SpzR7Lc+UIxPVPpDKsKvJ98PGPMwrE3DRHSaBWSHthrdW6l omZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=sHJ+1NBEdX8tpSR2gumpjHWRYp0mlux/Rc/skHcpL5g=; b=RfZY14mSk0xLR5sHRfF2kz2pOnN1zp/GfcOhaiLfxvNwaDMbpA6L+ukZdHT+5ECu2z KlOsYOgy4WuQVmyhoTaXrJ5bXGRO75CpoGIgyosjQVqtHwT9D2YY6BqbOv5BZDcb9sN2 uNsZtW/UpgIXPMXEZcOG8ghH0wxcNTCZl74msRzxEjJ/CCB/frOJBkVCR7if4K8Zko8X Xlmi5OQe2zINcitSEeGBRzsvcP7tAL9eXHBPi1GrMyaOM/Ajk0aggB1ZLaVQdzXh5ZW4 JDrUamP3V/vXkwF/KoM9udAOd1cJh/4kIJiZnvOitKzmKr8/S/clFCUXWdZ9p9k9G0W+ oTYA== X-Gm-Message-State: APjAAAXigg+mCDKgLxUVJ6bHXFHgJJ9qtvqe7va3MSFlVtJRFeIUFPo+ gFzMKel01ASJfq5NvY662P2wXfa4 X-Google-Smtp-Source: APXvYqwvTE7hz+DQTETSWISHmsKniyXys1br5VP1smBfCIGw+2z+4sxuiQbjuDe3NuauEJhxiTv+yA== X-Received: by 2002:a0c:980b:: with SMTP id c11mr514237qvd.115.1556388353116; Sat, 27 Apr 2019 11:05:53 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id l199sm13054748qke.54.2019.04.27.11.05.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Apr 2019 11:05:52 -0700 (PDT) From: Noam Postavsky References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> Date: Sat, 27 Apr 2019 14:05:51 -0400 In-Reply-To: <20181115180117.10423-1-bpeeluk@yahoo.co.uk> (Neil Roberts's message of "Thu, 15 Nov 2018 19:01:17 +0100") Message-ID: <87v9yzpbls.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Neil Roberts writes: > The list of dir local variables to apply is now sorted by the number > of parent modes of the mode used as the key in the association > list. That way when the variables are applied in order the variables > from more specific modes will override those from less specific modes. > > If there are directory entries in the list then they are sorted in > order of name length. The list of modes for that dir is then > recursively sorted with the same mechanism. That way variables tied to > a particular subdirectory override those in in a parent directory. > > Previously the behaviour didn=E2=80=99t seem to be well defined anyway an= d was > dependent on the order they appeared in the file. However this order > was changed in version 26.1 and it probably also depended on the > number of dir-local files that are merged. This patch looks basically good to me (some minor formatting: sentences should end in double space, and the commit message misses a ChangeLog formatted entry), but it exceeds to copyright exemption limit. Would you be willing to sign papers? From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: Merge with bug#30008? Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2019 18:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155638842915742 (code B ref 33400); Sat, 27 Apr 2019 18:08:01 +0000 Received: (at 33400) by debbugs.gnu.org; 27 Apr 2019 18:07:09 +0000 Received: from localhost ([127.0.0.1]:35987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKRjB-00045l-8a for submit@debbugs.gnu.org; Sat, 27 Apr 2019 14:07:09 -0400 Received: from mail-qt1-f179.google.com ([209.85.160.179]:40681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKRj9-00045R-CF; Sat, 27 Apr 2019 14:07:07 -0400 Received: by mail-qt1-f179.google.com with SMTP id y49so2037901qta.7; Sat, 27 Apr 2019 11:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=A+TYOVO7UvTEO04dIUkH81/3/BfvBY2l2pu2gylsf0g=; b=hnYq3sMM86uNvH1VAP+slcnbK80UchB9angLNCxuXXmq58vn8xEaAmbaGF2gn67M1B sOvk5AEKO9eO/hzFfc7fPcqbR578hkf5KE8Y5qa+cdxVfDtNYpQHYXU/OPV7qs0iyS25 tkTCEqOjrjh8Q5kbldmB7a1WwrH+XdE9O3ZnGIAY5jCgudDtCYjTAVSNl8k6f5ma5nY7 j6ofi5U+k7V3p0l6xkfCMo2bXksGg6RRlfwjqLw3Hi8hyccsMBCOxB1PAuwp/3BFO2Bp 7NhEmshrowgLZgY5ycQ8sMu5zNOxB4jZNdXbFGsI698QKqR6R4atdl0yrhK8sgq+1R19 K6dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=A+TYOVO7UvTEO04dIUkH81/3/BfvBY2l2pu2gylsf0g=; b=EBbY3TANy3TwuXecUIsIx9Cl0KFyrTYel5q87xVgVTM940DR3GTdykrUyLIG4jrtyq ogpXBzy5YwCGj+bC5DY4qAgcfg5AcVNIlBX3Bu8boxxO4y4dSAjBcjynuozOi4sUNiuq ZZRt5MaSARSFMbTAK/czuxzp2g6broau5leRokvJ/CtAL40tfpY/T8/UV0QfkIvEWyHM 0NHIVCKw/e22slAbkyhZXgLZaDpfWOhDtY0K/zPTG/uzyoLpMVBJniBof/ca5n/F/iGa xfqGK+GZLRCfW+OyLRWiJjZYK4BS/DQ9kaqCecECI6D2mBihbkC9Ffi3T0ZiJZ5y3T/S kkoQ== X-Gm-Message-State: APjAAAWyo+9uENs224iar3ewuFHJGepN+eti9WgKChoZTbyKyg5nghM8 f/omDU4a0QR3blvWP5lz11z1uvyw X-Google-Smtp-Source: APXvYqw+pqpK5kHMFRHjDFpAhaxT0nFhXkxO+abdTCr1r4ciC0b9RYUvHVuirq0md8E4qOHhc6kL8Q== X-Received: by 2002:ad4:43e1:: with SMTP id f1mr12959323qvu.95.1556388421815; Sat, 27 Apr 2019 11:07:01 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 62sm6618307qtf.89.2019.04.27.11.07.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Apr 2019 11:07:00 -0700 (PDT) From: Noam Postavsky References: <87tvkiwk6g.fsf@yahoo.co.uk> <87o94swtgd.fsf@gmail.com> Date: Sat, 27 Apr 2019 14:06:59 -0400 In-Reply-To: <87o94swtgd.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Fri, 26 Apr 2019 19:46:10 +0200") Message-ID: <87sgu3pbjw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 33400 30008 quit K=C3=A9vin Le Gouguec writes: > Hi, > > I just saw Mark's bump by chance; this reminds me of a report I made a > year ago (bug#30008), which went unnoticed AFAICT. Are these two issues > related? If that's the case, I guess they could be merged. Yes, and I believe Neil's patch covers both. From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Neil Roberts Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2019 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.15565239601778 (code B ref 33400); Mon, 29 Apr 2019 07:46:02 +0000 Received: (at 33400) by debbugs.gnu.org; 29 Apr 2019 07:46:00 +0000 Received: from localhost ([127.0.0.1]:38326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL0zA-0000Sc-4J for submit@debbugs.gnu.org; Mon, 29 Apr 2019 03:46:00 -0400 Received: from sonic308-17.consmr.mail.ir2.yahoo.com ([77.238.178.145]:32870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL0z6-0000SH-6N for 33400@debbugs.gnu.org; Mon, 29 Apr 2019 03:45:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1556523949; bh=uWNnjMHz66VuSHfbzfpQpeLRWekDlwDamJ6sXrPUjs4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject; b=dvf53npzVvdiW7G4P8kigrxxTdzKBTUGxJbAARVdVj5qP+cOS9RnmZMh93bMNBsqVVpfU+EirBRkn3f6A/wYVnefBE1NUIk2nhpiXNZo1zmjFF5H8WPCnSY6wpQQizc2nwy2VoLllKbUIuDdPm2OiUUyD+P7d4tRAw/J2X+pONl2GlQ8iUgJqfb47faAjfc4Z6QbO+arsizfxWSW3MMsQPdde0/ih08GUWoGjziNcidHN1PgXqRoDsyCkEKSboUmsKLLomsguekbDM5e75hXrcKrdhEEjOV7e3vZF9DGyCdBo6TlW4Vyt2wy8lzIs5Gdqhh5Lpcyk6fVEpAZg1Mv8A== X-YMail-OSG: 6Noa8WwVM1mMOMorOyMQkiMFzfup6GHRNnhBX6TTA8O0N2JRkF59gPWsFz9Y8Bd q6SzaG.WsMPDSISR3LcTjfpnOvRm8tSJNvvPKKEOO.xiS3i5dv1awf5mnvdxIlo7ilph_DExsIQW vaJ7TY3hc5TaH1.3eRbzi0FNJqrkik0GbuZv.14TnuctsmnYcEbfOoPHlw61uToCB6UDcmO9ily7 dqwwcEzcf65yxSZSJ58AQSWQqpWuVeKxNWAhNr7SA2Xb6fSoJB1cL9p5wnqiuxmXYw2Bn8EkjSHa wBihCFiaPxT0UIEwzQLjMGCfhUpmdZYRTFcG0M.Vz_oGy2Bz9pypKld94kj11a85Q86uQEKb3JSQ UwJ2KJSwebvKHC1OYv19X1wwPq8Ifepu3M9ar8DqFIjWxTsvLh7ppBDuAAH.0AkHYO1PrZ5wPzLG rC53MTD7xEQkZrogDwfSumI7h26eleSHkiv6PFEDZlxWBAQ3mXt4QkZ_RMNLX2HiVO07vP2GC3w6 WH.w2NlbvIOl8m54kPMjbun62wgwKnLumlK8K073Y6WHMeUMteqJhY7fZvLtUKY8q3oJOJTGeZSW lkjF_tNHCgl2op8hSK1KETVsf3tptUsCs0X_AKuwarnGxzn4Y2E.weirFDGFf73ue0R1JNBg6_3b feB.5DTF2o5En3ZXQLi5jft5mOzfPi_OtzX.RBvDI2Kt7NLY4my2IQylXNGCeFuxpTkkop9FC5Jf ySmH2lH13Phv2YvN74iysBIFtvWRt5IzLCqZUI4jC9lHATxWJ1K5AMh11_pIaUSkDzxjL4o3mj2p JCXjqVMy4PiRtceJT_RVhhRK0RlSmzB1pAEgPNGCeVLPXQGHGe.UJQI0OECmwiacoC1A_v6mYl6T BDBBiwsSezCfbOX1d8RtGd6VwgU4gENSG_mCZJylFago5fPASivU5KiNTLy0j88jh3PJJOsYPjRP 8hIOidUqrksydF5aXNgXTpe9QVDgjlLKaGUnKfEzpxj8K7wwZIs2GecpdgcncVFK4oRWIgQZ4NzW vvJS2OQ77Fam6M60EH1PAdciVHOx1MRMm9ZPFkiK1o1ZzieZTLziKyKzwHGtqA2am54UoNsjKN5b D7mzx7N5wqoaPCtJXohiYeTJ7Edbyfjwl2nhyRZI9WhdHjF78nj.crQShokPymtkCXHo- Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Mon, 29 Apr 2019 07:45:49 +0000 Received: from lns-bzn-38-82-253-104-2.adsl.proxad.net (EHLO localhost) ([82.253.104.2]) by smtp402.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 47cab8dac3fcdd45547047d75fa02184; Mon, 29 Apr 2019 07:45:45 +0000 (UTC) From: Neil Roberts In-Reply-To: <87v9yzpbls.fsf@gmail.com> References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> <87v9yzpbls.fsf@gmail.com> Date: Mon, 29 Apr 2019 09:45:41 +0200 Message-ID: <87h8ahz23e.fsf@yahoo.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Noam Postavsky writes: > This patch looks basically good to me (some minor formatting: sentences > should end in double space, and the commit message misses a ChangeLog > formatted entry), but it exceeds to copyright exemption limit. Would > you be willing to sign papers? Would you be able to point me to where I can find these papers? The CONTRIBUTE document doesn=E2=80=99t seem to mention them. Thanks. Regards, =2D Neil --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEcG2MQ+rhmiipAuy4X4plIMP6qyQFAlzGq6UACgkQX4plIMP6 qyR3LRAAs55+5yVh7gWGcduGmtjGRl1mXlgUf6ukBYAKURnm7TOINbf8HsDFkQmj Bb9lFAl1Lg/3TlTFQWontGW+HENAzOVY9lMbGBzZqKc+dfJP9hOFy7zw4F3GgQpv mt68SR0ffX/CW8juJaFOFfKXrdIqQpqPT6pTzHlov5Qo66dlyjZ4KT7/zJT1ldtu O2Udles7TZijhlxjAvOLq5oSz2yZ+kF+hrdOm5rgX3l17Bhvdjawl/0xBeArGJmz sQvtanvYQXQXvEIEoMAn9erl41J0FXFu2AAP7eZzdIgXpa3EuGZGdIc2a0/M/Re/ C8m8Fp0nKa7tmHUJMtHgxSPyAZW8xy9cJA0inAm/Y9x11F6lVAC6sfNeEEGrBAxJ +7lsP4HH6duyo8+wvTjUEiFuPJ7PQOWx+1Kj7BBd2W/JyNOuvcvg9d4EkQLVsR8o 6spXhyvxXzMPSl+Djn9pSecrpCFEXTjM/ehCrWQWsfu22UC/2n7FiNkwOnqzyh7r aqFdvlu+wiKoaUDowWg8K0vMALn1779e327L4dSoy3Sx3p3gOOzOp62q75EHarXz bitjdQ1e1GQrvs57rgUrmPMUe5W1DgMHTt1TXAFjTLX0Xand52mZ61Imka3IfQrw DRbzzckb/djrBHLhyqjzo8irYYXY8D7joopCmCboy42U168wji4= =156z -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2019 12:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Neil Roberts , 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.15565427267118 (code B ref 33400); Mon, 29 Apr 2019 12:59:02 +0000 Received: (at 33400) by debbugs.gnu.org; 29 Apr 2019 12:58:46 +0000 Received: from localhost ([127.0.0.1]:38638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL5rq-0001qi-2O for submit@debbugs.gnu.org; Mon, 29 Apr 2019 08:58:46 -0400 Received: from mout.gmx.net ([212.227.15.18]:32873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL5rn-0001qS-E2 for 33400@debbugs.gnu.org; Mon, 29 Apr 2019 08:58:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556542716; bh=/P+1eq/02dv731BwN6pjkwOyIJ7eJ2oswugPrwMl1Os=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=jUtddzQ6MoqsbNnGRfRa6d7KbHttxdS4/Un7PbV2BZoHQUL8CsgWvwcC57EfwiWb4 QaNQng80l9nnuYGumfDV3SjESMj8lpW++PcV918wlTjgk1BcuXm2dazSskQHZm+0SQ OxH3j008PAv+DYtsZIZdlPaY5Y8o9sMGOnnQYLPQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from detlef.gmx.de ([213.220.159.69]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M5QJD-1hKGWE3LiX-001VST; Mon, 29 Apr 2019 14:58:35 +0200 From: Michael Albinus References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> <87v9yzpbls.fsf@gmail.com> Date: Mon, 29 Apr 2019 14:58:34 +0200 In-Reply-To: <87v9yzpbls.fsf@gmail.com> (Noam Postavsky's message of "Sat, 27 Apr 2019 14:05:51 -0400") Message-ID: <87zho9vuh1.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:KK0DD9pXWn9zql1W7hLO23jfHrTiJF2wHmyc140nW7eHvn2p9pW TRmKpZGOqC9Q8n3HuIrFHwGOY9cITXxgR+lLtiXYyQF0gf0HAcI4Qh5Rqu6RZmITRzIYd1O OIFZeiZAkCvJpZYIgS0ZuOSLiCS7l9eGtOGeo6OaZuwl4MtNTsP7KW8CaN47eBAtCl2x7zx fjDSnU/tXZ3qN8WsGy99Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:O0jcxynKYmo=:mN8WsRAqlUVAZm04/hpxPy nh6+8ZpVUsjt9Kd8OJpdIlEv3ivSieTlqLOO5ztXtJAMiekomDWrJUFUzVa2iWzzIEHDQmeXa 61fKHbUpUlSlOHeIoWOt73nRl3YdbtsO0dDl0pjj5teRbL2UocFw3aVVmrmVh11DPJPnlDYUh 8wUSmgWcU5xGRt/N21WqP39D7Qnat5jRq9JMlKRsmb6irn90bY+hAFamGHBxDNXOXnxNuJ150 CIwOnoN48IBF/BeOo4SuxzhQHFsbYHUXU9vvDdKcPtskk2z694Vlz5ZCDxSKTMcH4obJG3Toa W1qU6IrYVnMs+guULhBqgdCdzKm/H3Sg4UK3jhuOOLLEIuY+4IiSsepsnVRJISJwgQyALnUIf poiVbwl26ZsQv42J3fh50VROmUpbnS5TMcuABE4ivNCYWe7kfSsZ/5Kl3hv7sYCP5bbruw/x0 En5ujf5v4qdo2RyH4uZj/erdRlGqxr/8loMaLxB8+Joke/OWZVpV2etd0E7a/PweXWjJofvay b4ccuDU95ldEeblileCR2YOfJCOjbSXfFAaNX1Vb0hgdLN5uie7BKO0Ptp0VwfOvMQ/fBbBLD mbEMdBqE9ySQBHDys3nyHYAU6u57DVoO5lpIxRrNjypo3fTy6b98mHrThNlIfd+bXDYC05LeP 8KtOrHKec/4lNGyiwiHUx/ZcRLzgQogWH3f0zofW8Xs1fC0UxPs0jlgb8ZzG4A72CMAOlITG6 jRFCmndtIEv8H0LzGMzOhgYc5igIGRgKvMlciYwbZQoOpoMx2+XYfWfcwTBDac+I5nq09JICj pHvpqH47pt8zPtgoIvU3nKI2aycLKlotvwkTq9oHT17XpW60is6/DDXf6ErQYBpSyRHMHEzYX AF9HgpIO1G7l4lNGp3f8UMYzc3fX/FTq+He+Qsxzhcg6K6udJbBHF4rkEmGKC7D0jXgGk+5sE Vh4jr8srPlw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Noam Postavsky writes: >> The list of dir local variables to apply is now sorted by the number >> of parent modes of the mode used as the key in the association >> list. That way when the variables are applied in order the variables >> from more specific modes will override those from less specific modes. >> >> If there are directory entries in the list then they are sorted in >> order of name length. The list of modes for that dir is then >> recursively sorted with the same mechanism. That way variables tied to >> a particular subdirectory override those in in a parent directory. >> >> Previously the behaviour didn=E2=80=99t seem to be well defined anyway a= nd was >> dependent on the order they appeared in the file. However this order >> was changed in version 26.1 and it probably also depended on the >> number of dir-local files that are merged. > > This patch looks basically good to me (some minor formatting: sentences > should end in double space, and the commit message misses a ChangeLog > formatted entry), but it exceeds to copyright exemption limit. Would > you be willing to sign papers? I also believe the patch is worth to be applied, to the emacs-26 branch. It fixes a regression introduced with Emacs 26.1. I'd appreciate if this behavior, priority of .dir-locals entries, is documented in the Emacs manual. Could this be added to the patch? Thanks, and best regards, Michael. From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2019 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Neil Roberts Cc: npostavs@gmail.com, 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155654892417593 (code B ref 33400); Mon, 29 Apr 2019 14:43:02 +0000 Received: (at 33400) by debbugs.gnu.org; 29 Apr 2019 14:42:04 +0000 Received: from localhost ([127.0.0.1]:39455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL7To-0004Zg-Eh for submit@debbugs.gnu.org; Mon, 29 Apr 2019 10:42:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL7Tm-0004Z4-Cv for 33400@debbugs.gnu.org; Mon, 29 Apr 2019 10:42:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hL7Th-00079V-4t; Mon, 29 Apr 2019 10:41:57 -0400 Received: from [176.228.60.248] (port=3324 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hL7Tg-0003AZ-BX; Mon, 29 Apr 2019 10:41:56 -0400 Date: Mon, 29 Apr 2019 17:41:48 +0300 Message-Id: <83lfzsub4j.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87h8ahz23e.fsf@yahoo.co.uk> (message from Neil Roberts on Mon, 29 Apr 2019 09:45:41 +0200) References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> <87v9yzpbls.fsf@gmail.com> <87h8ahz23e.fsf@yahoo.co.uk> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Neil Roberts > Date: Mon, 29 Apr 2019 09:45:41 +0200 > Cc: 33400@debbugs.gnu.org > > Would you be able to point me to where I can find these papers? The > CONTRIBUTE document doesn’t seem to mention them. Form sent off-list. From debbugs-submit-bounces@debbugs.gnu.org Wed May 01 12:46:21 2019 Received: (at control) by debbugs.gnu.org; 1 May 2019 16:46:21 +0000 Received: from localhost ([127.0.0.1]:44739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLsNB-0007dH-8X for submit@debbugs.gnu.org; Wed, 01 May 2019 12:46:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLsN9-0007d2-80 for control@debbugs.gnu.org; Wed, 01 May 2019 12:46:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLsN4-0003eX-2a for control@debbugs.gnu.org; Wed, 01 May 2019 12:46:14 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hLsN3-0002Ya-M0 for control@debbugs.gnu.org; Wed, 01 May 2019 12:46:13 -0400 Subject: control message for bug 35522 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Wed, 01 May 2019 12:46:13 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 33400 35522 From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Neil Roberts Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 May 2019 07:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155729994021195 (code B ref 33400); Wed, 08 May 2019 07:19:02 +0000 Received: (at 33400) by debbugs.gnu.org; 8 May 2019 07:19:00 +0000 Received: from localhost ([127.0.0.1]:60240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOGqx-0005Vn-Tp for submit@debbugs.gnu.org; Wed, 08 May 2019 03:19:00 -0400 Received: from sonic303-19.consmr.mail.ir2.yahoo.com ([77.238.178.200]:35307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOGqu-0005VW-Ov for 33400@debbugs.gnu.org; Wed, 08 May 2019 03:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1557299929; bh=Kw9U4jvzZpYvNv4IrzZCTU0MH1rhl11V4EbPo4GGAWM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject; b=EjizvIgtLkMB0HXmVtSYFmdy8gXzxKBOK3nYGvjWBUdjxX0T25E4MPy/0Vt/cUysz7sH5/qZ0IyCQgxrokRaKtTd31vEqbT3Z9OwuQA71GFJdsToyA1ZVYqevowLsG4Y7Bbl5YjVAyVIn9q66QFWmxWo8txDLJUYour1QyE5X2OwwdnjDdDvjCu9SzmHwcpeYXaRbRxqr55HbFWQjIwAtdXgcqDlJR5ZfakVLIeuKvAaYy4xlwkgYX+Sl9kEcJxYqnUOSyxPhwuCKJwX13Ao0dl3MrXEv/Y+E1hkYpFdIyHindlXc6UdI3yI4X3xRCyQSaNxW/oaq9mlSiVAD1wwjA== X-YMail-OSG: lUCrpD8VM1k1f6SPvfEMs7cOcPYeW.5tOuEmtNglBt4Fuvgt6dgImBhKduJ97va QITEfOvM.T8W3GNDNmwspgKRmADM4Kad5PJm8AgQyWQnCsyOXBzKMdR11qEt7bYgcluTF0oc69W9 IJifo65qJDezGjZd5urczQxVwWZU6mmkHZaDXDxaJ4tNDjkeRc15d57t3mB50JXzEMGZKqO.mM3S HqiBZr1gCnmi3yuL9bR5XdMc6qjy84pG1eug_vSDwiS4DppjxfGZV.JYXkl8akEvTjoaQILmAMyy XAKFi4X2ygqVMRR0xlI_l8Ix58qiBEUY25Pai7HZlTTgZH1KwHA4LXDVAesSLcLGA_7k_BG90Iph bzSadjC_Ck4u6qbm0qGgUjub4629nuhdch0a_LU4oZ9mnhc3GtYqDS.sK85g18Q3XdN85.SEr_uT qQYL3kHOmVSYwW68Rr1wC9ZrHIGqDknQbC9mhm3eCcvzbJ5UKFk.UnVqnm9RbcKrCW47Qz1jQ3em qjqbQI8iCv5jUOZkxp6otVQkl8ZqTVBkvAVYo8W8g0gycpnvUeeNrjg1U4kkIA6n.j9iCR3CgqAy 3GEJJK2kQD.T4s69zz4ereHLpZS_8RR7KMPuxfFsw4cXS3G_nA31hNFaR62QdH5RJcmPY_v.Ee96 3TT1gz_8fg_g3Rn10QR4i5j25HM4i6IgqZFtsMulp1l3oG0rD3ji6LjOWL7SF.4JaWXKLcYH6zoG f07o2Y7GirMg9l3yhKBffLTMw_1rNfLVW9vdq3FDOkf1WeqUzjrRm.3fQYpk0oyREKyiDnSkvSQ2 2On223LddXnpc8LhXoES8pCNYEAs_.bjchjePkCp.qKczo3TXpwOs7oTiQ.6.oDwvqE_gKhdfzVk TuPtWrnn81vZMg6pn1XLQuPXWH.UXM0eS4nGKIkbfz0LkOSPOj9vjoN7e_pkx6UXzkQrO7OYFU3M 2MasBOhethsAmJs3knUp8ZjZJOWQjKMwFvJVXUwHYqjBWKgEce1wK20Gl33L7Y1gNVeSy8fVGXNi RJtp.i5IlOS4bTxkbKavuc4OhIegzeW2sX48TY33XeO5bgQjtK.fyFJHZb0YOMFUEoonKDgdvxGY .q1FbgQtPC.AzUTKpsA3moupIPgiTlHZuCmS4_6g737ZquwT8za.KOafMvZzEw5U13eE- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Wed, 8 May 2019 07:18:49 +0000 Received: from lns-bzn-38-82-253-104-2.adsl.proxad.net (EHLO localhost) ([82.253.104.2]) by smtp409.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 2527a0490c446d41f0c28776146c3581; Wed, 08 May 2019 07:18:46 +0000 (UTC) From: Neil Roberts In-Reply-To: <87v9yzpbls.fsf@gmail.com> References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> <87v9yzpbls.fsf@gmail.com> Date: Wed, 08 May 2019 09:18:45 +0200 Message-ID: <87mujxxvl6.fsf@yahoo.co.uk> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Noam Postavsky writes: > This patch looks basically good to me (some minor formatting: > sentences should end in double space, and the commit message misses a > ChangeLog formatted entry), but it exceeds to copyright exemption > limit. Would you be willing to sign papers? Apparently my assignment/disclaimer process is complete. I sent a v2 of the patch which I think addresses the issues you mentioned and also adds documentation to the manual. I got confused by the complicated bug tracking system and it ended up as a new bug (#35522). Regards, - Neil From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2019 01:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Neil Roberts Cc: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155745185529792 (code B ref 33400); Fri, 10 May 2019 01:31:01 +0000 Received: (at 33400) by debbugs.gnu.org; 10 May 2019 01:30:55 +0000 Received: from localhost ([127.0.0.1]:36766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOuND-0007kS-Dl for submit@debbugs.gnu.org; Thu, 09 May 2019 21:30:55 -0400 Received: from mail-it1-f169.google.com ([209.85.166.169]:40536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOuNC-0007kE-2e for 33400@debbugs.gnu.org; Thu, 09 May 2019 21:30:54 -0400 Received: by mail-it1-f169.google.com with SMTP id g71so6552290ita.5 for <33400@debbugs.gnu.org>; Thu, 09 May 2019 18:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=3Jan7TR1IywXzen204IrtaAIRAiS2OfVzvppjN0FztM=; b=V4bP7RIGeW9yetRNUj1kz/HO0W5eZluWSmF39ZXoBgjPGnHFqLuRnDDaTbeDjMhzkw 89f5B5r7V2OMbr3JpvSJaaw/MWhJtm5VNsGRIsGqEwfSMiLmBXdjUy9zo3AVIKd+BuFR N8kvotlIAIlbQ2oZgkIwIDymWVviMxovjhASB9nudHlm7jbRWAu3ioJv2V+aYLDb3oI4 /+SB//tOCC/FvDnLsGQJxiEaWgg6nRD8i9Ulvvxp8NHZ1NcLpqgiwbe6yqQNLOlfeRMV B+h5Okyt5iC3KfwRyZo/BFD4cPA5ZDsgG1itckKyhclgSTi3Ob59kLW4nRJj4oMLovW7 OdXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=3Jan7TR1IywXzen204IrtaAIRAiS2OfVzvppjN0FztM=; b=bc0SZtP83OFg8/vaXULYTw8rA7ut33XKg//Vqdoo9vXq7siruCT9IgX/2UnoQNEqkD UQO2eteMgM/4BaMTkYNlLFb+a/gUFocDZujF6/gjinGvTcdJrKXFyaOk36phqyYkjj1Q c+wbDE3TQNxU/9YSpq9cxZNTstb7COwD+sjES0H+RtdVKnA7ZUajRO6SjyNYz7xnShXf gU09Ujrlbcwv0M7yNY6IMOqoJ+EpGc5dqeQak1GQesXTMUcNzELQlNLy7NM2OlL1Y1hs iMlOYkHVRSgk4hPm8vqGLuD4883ziW5dzCPKNkpEVn9eO8JydFi4ewPB5cFqjc8Nyv54 2qrw== X-Gm-Message-State: APjAAAUF1ymGA6UAp421IKwgk1etrvOu7uUgneFbwOmBV+ToMTiCNo4v Wk5Gl14O5BaRstJ2trMrb8d1w2bk X-Google-Smtp-Source: APXvYqwL2pUinUaAmuJlSWTo9zEISPotJtHKJ7iTIqYwX4+OdcB8fsgxT63ptH6YBjsN0ceDD7dgZA== X-Received: by 2002:a24:fa88:: with SMTP id v130mr5721270ith.122.1557451848059; Thu, 09 May 2019 18:30:48 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id g13sm1534434iom.46.2019.05.09.18.30.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 May 2019 18:30:46 -0700 (PDT) From: Noam Postavsky References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> <87v9yzpbls.fsf@gmail.com> <87mujxxvl6.fsf@yahoo.co.uk> Date: Thu, 09 May 2019 21:30:46 -0400 In-Reply-To: <87mujxxvl6.fsf@yahoo.co.uk> (Neil Roberts's message of "Wed, 08 May 2019 09:18:45 +0200") Message-ID: <87a7fvjdtl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Neil Roberts writes: > > Apparently my assignment/disclaimer process is complete. I sent a v2 of > the patch which I think addresses the issues you mentioned and also adds > documentation to the manual. I got confused by the complicated bug > tracking system and it ended up as a new bug (#35522). That's alright. Can we have this in emacs-26 on the grounds that the order of evaluation was already changed from 25, or should this go to master? From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH] Let dir locals for more specific modes override those from less Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2019 06:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: bpeeluk@yahoo.co.uk, 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155747068426802 (code B ref 33400); Fri, 10 May 2019 06:45:02 +0000 Received: (at 33400) by debbugs.gnu.org; 10 May 2019 06:44:44 +0000 Received: from localhost ([127.0.0.1]:36967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOzGu-0006yE-Ai for submit@debbugs.gnu.org; Fri, 10 May 2019 02:44:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOzGr-0006xz-RA for 33400@debbugs.gnu.org; Fri, 10 May 2019 02:44:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOzGk-0001wq-OA; Fri, 10 May 2019 02:44:35 -0400 Received: from [176.228.60.248] (port=4389 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hOzGi-0007I3-1C; Fri, 10 May 2019 02:44:32 -0400 Date: Fri, 10 May 2019 09:44:23 +0300 Message-Id: <83tve2g660.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87a7fvjdtl.fsf@gmail.com> (message from Noam Postavsky on Thu, 09 May 2019 21:30:46 -0400) References: <87tvkiwk6g.fsf@yahoo.co.uk> <20181115180117.10423-1-bpeeluk@yahoo.co.uk> <87v9yzpbls.fsf@gmail.com> <87mujxxvl6.fsf@yahoo.co.uk> <87a7fvjdtl.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Noam Postavsky > Date: Thu, 09 May 2019 21:30:46 -0400 > Cc: 33400@debbugs.gnu.org > > That's alright. Can we have this in emacs-26 on the grounds that the > order of evaluation was already changed from 25, or should this go to > master? It's fine with me to push this to emacs-26, but please clean up the formatting, add the documentation requested by Michael, and I think the new function should be internal one (i.e. 2 dashes in its name). Thanks. From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH v3] Let dir locals for more specific modes override those from less Resent-From: Neil Roberts Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2019 11:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.15574859761564 (code B ref 33400); Fri, 10 May 2019 11:00:02 +0000 Received: (at 33400) by debbugs.gnu.org; 10 May 2019 10:59:36 +0000 Received: from localhost ([127.0.0.1]:37315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hP3FX-0000P9-HA for submit@debbugs.gnu.org; Fri, 10 May 2019 06:59:35 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:46163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hP3FS-0000Ol-4r for 33400@debbugs.gnu.org; Fri, 10 May 2019 06:59:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=XU7BzNknPboAOdapUu66K379XEbWakooYjjt1Ozads4=; b=sccy0WB//RuOFhQ7GG+3lQIamdtL06LWC3ApQNS9j0LlBwkvI1EdC0qlyc4zh/bgany2FP6N7wci/FrTpColn66gdjSFjCo+jYFdB5THoxWnu2mnkRO5ahoNejFgtO75HjZ+lStmlMkRSeoEqCu+B9ruCLYKs6YaTfRjYVbBh+xaSIkbevNwpwo3ng+OPREbSfeyLmh6qX5hdJXQKxo15ZiSUqwjMTChKE36LHYA2Uifk8bWmtP8o26DhTmG+nBhE5zSzLIWYFQ8cfMepw1O6BtzG+5SBRLtDysxMdRCzDV229b4QH8/Cumt2Nl3DrOKMM6gXV8n3wzB/7eMIbDInA==; Received: from [37.173.106.249] (helo=localhost.localdomain) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1hP3FG-0004ec-UR for <33400@debbugs.gnu.org>; Fri, 10 May 2019 12:59:21 +0200 From: Neil Roberts Date: Fri, 10 May 2019 12:57:28 +0200 Message-Id: <20190510105728.7143-1-bpeeluk@yahoo.co.uk> X-Mailer: git-send-email 2.17.2 In-Reply-To: <83tve2g660.fsf@gnu.org> References: <83tve2g660.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) The list of dir local variables to apply is now sorted by the number of parent modes of the mode used as the key in the association list. That way when the variables are applied in order the variables from more specific modes will override those from less specific modes. If there are directory entries in the list then they are sorted in order of name length. The list of modes for that dir is then recursively sorted with the same mechanism. That way variables tied to a particular subdirectory override those in in a parent directory. Previously the behaviour didn’t seem to be well defined anyway and was dependent on the order they appeared in the file. However this order was changed in version 26.1 and it probably also depended on the number of dir-local files that are merged. Bug#33400 * lisp/files.el (dir-locals-get-sort-score, dir-locals-sort-variables, dir-locals-read-from-dir): Sort the dir locals so that more precise modes and directory-specific entries have override lesser ones. * doc/emacs/custom.texi (Directory Variables): Document the priority. --- doc/emacs/custom.texi | 22 ++++++++++++++++++++ lisp/files.el | 47 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 22e352ef9f..3a85907b45 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1377,6 +1377,28 @@ Directory Variables Finally, it specifies a different @file{ChangeLog} file name for any file in the @file{src/imported} subdirectory. +If the @file{.dir-locals.el} file contains multiple different values +for a variable using different mode names or directories, the values +will be applied in an order such that the values for more specific +modes take priority over more generic modes. Values specified under a +directory have even more priority. For example: + +@example +((nil . ((fill-column . 40))) + (c-mode . ((fill-column . 50))) + (prog-mode . ((fill-column . 60))) + ("narrow-files" . ((nil . (fill-column 20))))) +@end example + +Files that use @code{c-mode} also match @code{prog-mode} because the +former inherits from the latter. The value used for +@code{fill-column} in C files will however be @code{50} because the +mode name is more specific than @code{prog-mode}. Files using other +modes inheriting from @code{prog-mode} will use @code{60}. Any file +under the directory @file{narrow-files} will use the value @code{20} +even if they use @code{c-mode} because directory entries have priority +over mode entries. + You can specify the variables @code{mode}, @code{eval}, and @code{unibyte} in your @file{.dir-locals.el}, and they have the same meanings as they would have in file local variables. @code{coding} diff --git a/lisp/files.el b/lisp/files.el index 8477c227bc..ae52fff730 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4110,6 +4110,52 @@ dir-locals-find-file (declare-function map-merge-with "map" (type function &rest maps)) (declare-function map-merge "map" (type &rest maps)) +(defun dir-locals--get-sort-score (node) + "Return a number used for sorting the definitions of dir locals. +NODE is assumed to be a cons cell where the car is either a +string or a symbol representing a mode name. + +If it is a mode then the the depth of the mode (ie, how many +parents that mode has) will be returned. + +If it is a string then the length of the string plus 1000 will be +returned. + +Otherwise it returns -1. + +That way the value can be used to sort the list such that deeper +modes will be after the other modes. This will be followed by +directory entries in order of length. If the entries are all +applied in order then that means the more specific modes will +override the values specified by the earlier modes and directory +variables will override modes." + (let ((key (car node))) + (cond ((null key) -1) + ((symbolp key) + (let ((mode key) + (depth 0)) + (while (setq mode (get mode 'derived-mode-parent)) + (setq depth (1+ depth))) + depth)) + ((stringp key) + (+ 1000 (length key))) + (t -2)))) + +(defun dir-locals--sort-variables (variables) + "Sorts VARIABLES so that applying them in order has the right effect. +The variables are compared by dir-locals--get-sort-score. +Directory entries are then recursively sorted using the same +criteria." + (setq variables (sort variables + (lambda (a b) + (< (dir-locals--get-sort-score a) + (dir-locals--get-sort-score b))))) + (dolist (n variables) + (when (stringp (car n)) + (setcdr n (dir-locals--sort-variables (cdr n))))) + + variables) + (defun dir-locals-read-from-dir (dir) "Load all variables files in DIR and register a new class and instance. DIR is the absolute name of a directory which must contain at @@ -4147,6 +4193,7 @@ dir-locals-read-from-dir variables newvars)))))) (setq success latest)) + (setq variables (dir-locals--sort-variables variables)) (dir-locals-set-class-variables class-name variables) (dir-locals-set-directory-class dir class-name success) class-name)) -- 2.17.2 From unknown Tue Jun 17 22:10:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33400: [PATCH v3] Let dir locals for more specific modes override those from less Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 May 2019 14:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Neil Roberts Cc: 33400@debbugs.gnu.org Received: via spool by 33400-submit@debbugs.gnu.org id=B33400.155766983232474 (code B ref 33400); Sun, 12 May 2019 14:04:02 +0000 Received: (at 33400) by debbugs.gnu.org; 12 May 2019 14:03:52 +0000 Received: from localhost ([127.0.0.1]:43013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPp4y-0008Rd-6H for submit@debbugs.gnu.org; Sun, 12 May 2019 10:03:52 -0400 Received: from mail-it1-f170.google.com ([209.85.166.170]:35863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPp4v-0008RI-Hj; Sun, 12 May 2019 10:03:50 -0400 Received: by mail-it1-f170.google.com with SMTP id e184so4055962ite.1; Sun, 12 May 2019 07:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=cGyLgOxduaLjrWBx+h7nGNWADAxzPAlk/5SyanUc+AM=; b=HrENZpmBM3GRTieLRebggNrJkgkojl2c4A0bsifMYaH9qbRf6Aqzsi8Uwsew+MPZH7 oCt7Ulapp0+6RyI/3srQ3zU22ASwwxTpMZDl2rW8ejIlUT7YPs+dvg9K1WD8w5EAliTo eIr2KCIwQVFSAF/8bburg6DHtrDgkPWHCRqvPCOWGtVls8IkU8J0m2nlFaQMcSIuqija G0kNgsRYrflzKj8WiRB+KGSvv2JpqShPxMn/ZW4qmhJZsOCjoFxeSd3KPm2lFa3wX7jG 10su1wDBDMXwO0FF2Y6kVZp/V/66xWOaTpJioI1faOHGAzGa44IeOC5gubldz12wKszB 3iyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=cGyLgOxduaLjrWBx+h7nGNWADAxzPAlk/5SyanUc+AM=; b=LVKVbmKoJ7kwsS/kEV9uCt1ddDGQBxlCykecs26RHAci3iC+OWorbnbJ+H0ux9skdx HqUP0nNXJ9K2HbFJmjQ7Dk8HznKSEdia5FBR2lbL9rmDsZa581/nh29X4jV+k+kdNbDN buJAnyd6ZJcvrK+mRfyN/hH8OPqmdSY3+JTrJ7uNnpNNI4pNkGISdACLyscxzh6DLhFx JSYjrwapWCyPTV4GdqmfHuwVsPZfT4jinnK7spzq/7KTrKMC7QasFoKrQApo+VnaVd5n pUXXZPANtyhJr+U3HPHr3HhtewS5Lc92LJju/JWnSKWtVq9cXO07ON+FxojJHK/dnSx+ x4vA== X-Gm-Message-State: APjAAAVfUZsQcGvjMNtSqJgjptgd3Nkl+ZEx/yRF7yZYWO9PkLwcpa4U CvjbipeIgYriDWCou9wmQPFYiUq3 X-Google-Smtp-Source: APXvYqwBvepk61bNn8HjGusa/ZceIwY+dFSoSjCySrjevilt+FWO8XGR9mupaye6v5v/gQLtsK/gxw== X-Received: by 2002:a24:4ace:: with SMTP id k197mr15381863itb.34.1557669823641; Sun, 12 May 2019 07:03:43 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id 14sm5287061itl.1.2019.05.12.07.03.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 May 2019 07:03:42 -0700 (PDT) From: Noam Postavsky References: <83tve2g660.fsf@gnu.org> <20190510105728.7143-1-bpeeluk@yahoo.co.uk> Date: Sun, 12 May 2019 10:03:42 -0400 In-Reply-To: <20190510105728.7143-1-bpeeluk@yahoo.co.uk> (Neil Roberts's message of "Fri, 10 May 2019 12:57:28 +0200") Message-ID: <877eavixc1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 33400 fixed close 33400 26.3 quit Pushed to emacs-26, with a couple of minor fixes: > * lisp/files.el (dir-locals-get-sort-score, dir-locals-sort-variables, > dir-locals-read-from-dir): Sort the dir locals so that more precise We close the parens at end of line for ChangeLog entries: * lisp/files.el (dir-locals-get-sort-score, dir-locals-sort-variables) (dir-locals-read-from-dir): Sort the dir locals so that more precise > +@example > +((nil . ((fill-column . 40))) > + (c-mode . ((fill-column . 50))) > + (prog-mode . ((fill-column . 60))) > + ("narrow-files" . ((nil . (fill-column 20))))) > +@end example The last line in the example needs to be + ("narrow-files" . ((nil . ((fill-column . 20)))))) 02bee7860f 2019-05-12T09:59:55-04:00 "Let dir locals for more specific modes override those from less" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=02bee7860f7e650ef13e00fe1a7f9a362e3eb001