[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e45abc832d: Fix regression with multiple mode: entries in the pro
From: |
Lars Ingebrigtsen |
Subject: |
master e45abc832d: Fix regression with multiple mode: entries in the prop line |
Date: |
Tue, 19 Apr 2022 12:09:07 -0400 (EDT) |
branch: master
commit e45abc832db7d1a64a0761dcb51565b7c282999a
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Fix regression with multiple mode: entries in the prop line
* lisp/files.el (hack-local-variables--find-variables): Use the
final mode: line (which is the same as having several mode: bits
in the header line.
---
lisp/files.el | 2 +-
test/lisp/files-resources/file-mode-prop-line | 1 +
test/lisp/files-tests.el | 4 ++++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/files.el b/lisp/files.el
index a9d4b5aea8..2b0dc54db8 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3900,7 +3900,7 @@ inhibited."
;; Note this is a no-op if enable-local-variables is nil.
(hack-dir-local-variables))
(let ((result (append (hack-local-variables--find-variables handle-mode)
- (hack-local-variables-prop-line))))
+ (hack-local-variables-prop-line handle-mode))))
(if (and enable-local-variables
(not (inhibit-local-variables-p)))
(progn
diff --git a/test/lisp/files-resources/file-mode-prop-line
b/test/lisp/files-resources/file-mode-prop-line
new file mode 100644
index 0000000000..e0e7ad24d7
--- /dev/null
+++ b/test/lisp/files-resources/file-mode-prop-line
@@ -0,0 +1 @@
+-*- mode: notexist; mode: text -*-
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index c886bd7985..c5b0fe0bbb 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1825,5 +1825,9 @@ Prompt users for any modified buffer with
`buffer-offer-save' non-nil."
(find-file (ert-resource-file "file-mode-multiple"))
(should (eq major-mode 'outline-mode)))
+(ert-deftest files-test-set-mode-prop-line ()
+ (find-file (ert-resource-file "file-mode-prop-line"))
+ (should (eq major-mode 'text-mode)))
+
(provide 'files-tests)
;;; files-tests.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master e45abc832d: Fix regression with multiple mode: entries in the prop line,
Lars Ingebrigtsen <=