mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
editorconfig.el: Fix bug#78097
When there is no `.editorconfig` variable, the `file-name-directory` call can signal an error, but that can happen only if `editorconfig-get-local-variables-functions` added entries "out of thin air". So just skip running that hook to avoid this corner case. * lisp/editorconfig.el (editorconfig--get-dir-local-variables): Don't run `editorconfig-get-local-variables-functions` when we found no EditorConfig settings.
This commit is contained in:
parent
b9b52f0092
commit
28a8bd6061
1 changed files with 2 additions and 1 deletions
|
|
@ -709,7 +709,8 @@ Meant to be used on `auto-coding-functions'."
|
|||
Meant to be used on `hack-dir-local-get-variables-functions'."
|
||||
(when (stringp buffer-file-name)
|
||||
(let* ((props (editorconfig-call-get-properties-function buffer-file-name))
|
||||
(alist (editorconfig--get-local-variables props)))
|
||||
(alist (if (< 0 (hash-table-count props))
|
||||
(editorconfig--get-local-variables props))))
|
||||
;; FIXME: If there's `/foo/.editorconfig', `/foo/bar/.dir-locals.el',
|
||||
;; and `/foo/bar/baz/.editorconfig', it would be nice to return two
|
||||
;; pairs here, so that hack-dir-local can give different priorities
|
||||
|
|
|
|||
Loading…
Reference in a new issue