From: Stefan Monnier Date: Wed, 19 Jun 2024 18:34:26 +0000 (-0400) Subject: Integrate feedback from Stefan Kangas and Michael Albinus X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=99855de66f05073b8ed28d067cf4879fbded8c5a;p=emacs.git Integrate feedback from Stefan Kangas and Michael Albinus * lisp/editorconfig.el, lisp/editorconfig-tools.el, lisp/editorconfig-core.el: * lisp/editorconfig-core-handle.el, lisp/editorconfig-conf-mode.el: * lisp/editorconfig-fnmatch.el: Fix the reference to CONTRIBUTORS. * doc/emacs/custom.texi (EditorConfig support): * etc/NEWS: Improve wording and markup. (cherry picked from commit 8d0a7c718b4e50056645ec1cab56423f5a31ce07) --- diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index c0ff573b13b..f5feb3db7e1 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1554,19 +1554,22 @@ as Dired buffers (@pxref{Dired}). @subsubsection Per-Directory Variables via EditorConfig @cindex EditorConfig support -The EditorConfig standard is an alternative to the @code{.dir-locals.el} +The EditorConfig standard is an alternative to the @file{.dir-locals.el} files, which can control only a very small number of variables, but has the advantage of being editor-neutral. Those settings are stored in -files named @code{.editorconfig}. +files named @file{.editorconfig}. If you want Emacs to obey those settings, you need to enable the @code{editorconfig-mode} minor mode. This is usually all that is -needed: when the mode is activated, Emacs will look for @code{.editorconfig} -files whenever a file is visited, just as it does for @code{.dir-locals.el}. - -When both @code{.editorconfig} and @code{.dir-locals.el} files are -encountered, the corresponding settings are combined, and in case there -is overlap, the settings coming from the nearest file take precedence. +needed: when the mode is activated, Emacs will look for @file{.editorconfig} +files whenever a file is visited, just as it does for @file{.dir-locals.el}. +When both @file{.editorconfig} and @file{.dir-locals.el} files are +found, their settings are combined, and in case of a conflict, the +setting coming from the closest file takes precedence. +If they are equally close, @file{.dir-locals.el} takes precedence. +In terms of security, those settings are subject to the same checks +as those coming from @file{.dir-locals.el} (and also honor +@code{enable-local-variables}). The @code{indent_size} setting of the EditorConfig standard does not correspond to a fixed variable in Emacs, but instead needs to set @@ -1577,7 +1580,7 @@ effect because the major mode does not yet support it, you can customize the @code{editorconfig-indentation-alist} variable to tell Emacs which variables need to be set in that major mode. -Similarly, there are several different ways to ``trim whitespace'' at +Similarly, there are several different ways to trim whitespace at the end of lines. When the EditorConfig @code{trim_trailing_whitespace} setting is used, by default @code{editorconfig-mode} simply calls @code{delete-trailing-whitespace} every time you save your file. diff --git a/etc/NEWS b/etc/NEWS index cfcf6923c93..88e03202db8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2058,11 +2058,11 @@ The following new XML schemas are now supported: * New Modes and Packages in Emacs 30.1 ** New package EditorConfig. -This package provides support for the EditorConfig standard that -is an editor-neutral way to provide directory local settings. +This package provides support for the EditorConfig standard, +an editor-neutral way to provide directory local (project-wide) settings. It is enabled via a new global minor mode 'editorconfig-mode' which makes Emacs obey the '.editorconfig' files. -And the package also comes with a new major mode 'editorconfig-conf-mode' +There is also a new major mode 'editorconfig-conf-mode' to edit those configuration files. +++ diff --git a/lisp/editorconfig-conf-mode.el b/lisp/editorconfig-conf-mode.el index 105ce48a9bb..3102c3d6581 100644 --- a/lisp/editorconfig-conf-mode.el +++ b/lisp/editorconfig-conf-mode.el @@ -5,8 +5,9 @@ ;; Author: EditorConfig Team ;; See -;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors -;; or the CONTRIBUTORS file for the list of contributors. +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors or +;; https://github.com/editorconfig/editorconfig-emacs/blob/master/CONTRIBUTORS +;; for the list of contributors. ;; This file is part of GNU Emacs. diff --git a/lisp/editorconfig-core-handle.el b/lisp/editorconfig-core-handle.el index 8857c35c62c..b8570ac5c6a 100644 --- a/lisp/editorconfig-core-handle.el +++ b/lisp/editorconfig-core-handle.el @@ -5,8 +5,9 @@ ;; Author: EditorConfig Team ;; See -;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors -;; or the CONTRIBUTORS file for the list of contributors. +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors or +;; https://github.com/editorconfig/editorconfig-emacs/blob/master/CONTRIBUTORS +;; for the list of contributors. ;; This file is part of GNU Emacs. diff --git a/lisp/editorconfig-core.el b/lisp/editorconfig-core.el index 02a2b7885ec..8183ff6298c 100644 --- a/lisp/editorconfig-core.el +++ b/lisp/editorconfig-core.el @@ -1,12 +1,13 @@ -;;; editorconfig-core.el --- EditorConfig Core library in Emacs Lisp -*- lexical-binding: t -*- +;;; editorconfig-core.el --- EditorConfig Core library -*- lexical-binding: t -*- ;; Copyright (C) 2011-2024 Free Software Foundation, Inc. ;; Author: EditorConfig Team ;; See -;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors -;; or the CONTRIBUTORS file for the list of contributors. +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors or +;; https://github.com/editorconfig/editorconfig-emacs/blob/master/CONTRIBUTORS +;; for the list of contributors. ;; This file is part of GNU Emacs. diff --git a/lisp/editorconfig-fnmatch.el b/lisp/editorconfig-fnmatch.el index e614e8ef3e4..cd040880434 100644 --- a/lisp/editorconfig-fnmatch.el +++ b/lisp/editorconfig-fnmatch.el @@ -1,12 +1,13 @@ -;;; editorconfig-fnmatch.el --- Glob pattern matching in Emacs lisp -*- lexical-binding: t -*- +;;; editorconfig-fnmatch.el --- Glob pattern matching -*- lexical-binding: t -*- ;; Copyright (C) 2011-2024 Free Software Foundation, Inc. ;; Author: EditorConfig Team ;; See -;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors -;; or the CONTRIBUTORS file for the list of contributors. +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors or +;; https://github.com/editorconfig/editorconfig-emacs/blob/master/CONTRIBUTORS +;; for the list of contributors. ;; This file is part of GNU Emacs. diff --git a/lisp/editorconfig-tools.el b/lisp/editorconfig-tools.el index ebc6a45d7bd..512dd67f56f 100644 --- a/lisp/editorconfig-tools.el +++ b/lisp/editorconfig-tools.el @@ -5,8 +5,9 @@ ;; Author: EditorConfig Team ;; See -;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors -;; or the CONTRIBUTORS file for the list of contributors. +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors or +;; https://github.com/editorconfig/editorconfig-emacs/blob/master/CONTRIBUTORS +;; for the list of contributors. ;; This file is part of GNU Emacs. diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el index 03b949ee71d..46b5843f99f 100644 --- a/lisp/editorconfig.el +++ b/lisp/editorconfig.el @@ -9,8 +9,9 @@ ;; Keywords: convenience editorconfig ;; See -;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors -;; or the CONTRIBUTORS file for the list of contributors. +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors or +;; https://github.com/editorconfig/editorconfig-emacs/blob/master/CONTRIBUTORS +;; for the list of contributors. ;; This file is part of GNU Emacs.