aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2025-03-23 07:45:16 +0200
committerEli Zaretskii2025-03-23 07:45:16 +0200
commitab25b4fca9a20ccc03a90ec9c2281a2f88872d93 (patch)
treef350e289283cbf62a3d806e544bffe748b777483
parent62368f93a5d2cf1b961626c705c032e15b1d5f43 (diff)
parentaa12cebaa684d7b3ea7e131666d33bcc71b45625 (diff)
downloademacs-ab25b4fca9a20ccc03a90ec9c2281a2f88872d93.tar.gz
emacs-ab25b4fca9a20ccc03a90ec9c2281a2f88872d93.zip
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
-rw-r--r--etc/NEWS.1932
-rw-r--r--lisp/files.el21
-rw-r--r--lisp/isearch.el2
-rw-r--r--src/nsfns.m7
-rw-r--r--src/nsterm.h1
-rw-r--r--src/nsterm.m18
-rw-r--r--test/lisp/files-resources/dir-locals-2-solo/.dir-locals-2.el1
-rw-r--r--test/lisp/files-resources/dir-locals-2-solo/dir-locals-2-solo.txt3
-rw-r--r--test/lisp/files-resources/dir-locals-and-2/.dir-locals-2.el1
-rw-r--r--test/lisp/files-resources/dir-locals-and-2/.dir-locals.el1
-rw-r--r--test/lisp/files-resources/dir-locals-and-2/dir-locals-and-2.txt4
-rw-r--r--test/lisp/files-tests.el15
12 files changed, 69 insertions, 37 deletions
diff --git a/etc/NEWS.19 b/etc/NEWS.19
index 0a1ef56c0fb..2ee6f95c820 100644
--- a/etc/NEWS.19
+++ b/etc/NEWS.19
@@ -3149,7 +3149,7 @@ tempo.el Template insertion with hotspots.
3149 3149
3150 3150
3151 3151
3152* User Editing Changes in 19.23. 3152* User Editing Changes in Emacs 19.23
3153 3153
3154** Emacs 19.23 uses Ispell version 3. 3154** Emacs 19.23 uses Ispell version 3.
3155 3155
@@ -4021,7 +4021,7 @@ by building Emacs.
4021** New macro 'easy-menu-define' 4021** New macro 'easy-menu-define'
4022 4022
4023 4023
4024* Changes in 19.22. 4024* Changes in Emacs 19.22
4025 4025
4026** The mouse click M-mouse-2 now inserts the current secondary 4026** The mouse click M-mouse-2 now inserts the current secondary
4027selection (from Emacs or any other X client) where you click. 4027selection (from Emacs or any other X client) where you click.
@@ -4085,7 +4085,7 @@ different properties.
4085 4085
4086 4086
4087 4087
4088* User editing changes in version 19.21. 4088* User editing changes in Emacs 19.21
4089 4089
4090** ISO Accents mode supports four additional characters: 4090** ISO Accents mode supports four additional characters:
4091A-with-ring (entered as /A), AE ligature (entered as /E), 4091A-with-ring (entered as /A), AE ligature (entered as /E),
@@ -4093,7 +4093,7 @@ and their lower-case equivalents.
4093 4093
4094 4094
4095 4095
4096* User editing changes in version 19.20. 4096* User editing changes in Emacs 19.20
4097(See following page for Lisp programming changes.) 4097(See following page for Lisp programming changes.)
4098 4098
4099Note that some of these changes were made subsequent to the Emacs 19.20 4099Note that some of these changes were made subsequent to the Emacs 19.20
@@ -4493,7 +4493,7 @@ Emacs command history.
4493 4493
4494 4494
4495 4495
4496* Changes in version 19.19. 4496* Changes in Emacs 19.19
4497 4497
4498** The new package bookmark.el records named bookmarks: positions that 4498** The new package bookmark.el records named bookmarks: positions that
4499you can jump to. Bookmarks are saved automatically between Emacs 4499you can jump to. Bookmarks are saved automatically between Emacs
@@ -4527,7 +4527,7 @@ inconsistent with integer `%'.
4527 4527
4528 4528
4529 4529
4530* Changes in version 19.18. 4530* Changes in Emacs 19.18
4531 4531
4532** Typing C-z in an iconified Emacs frame now deiconifies it. 4532** Typing C-z in an iconified Emacs frame now deiconifies it.
4533 4533
@@ -4669,7 +4669,7 @@ minibuffer window, and returns t if the window is currently active.
4669 4669
4670 4670
4671 4671
4672* Changes in version 19.17. 4672* Changes in Emacs 19.17
4673 4673
4674** When Emacs displays a list of completions in a buffer, 4674** When Emacs displays a list of completions in a buffer,
4675you can select a completion by clicking mouse button 2 4675you can select a completion by clicking mouse button 2
@@ -4857,7 +4857,7 @@ argument FRAME, which specifies which frames it should affect.
4857 4857
4858 4858
4859 4859
4860* Changes in version 19.16. 4860* Changes in Emacs 19.16
4861 4861
4862** When dragging the mouse to select a region, Emacs now highlights the 4862** When dragging the mouse to select a region, Emacs now highlights the
4863region as you drag (if Transient Mark mode is enabled). If you 4863region as you drag (if Transient Mark mode is enabled). If you
@@ -4984,7 +4984,7 @@ already thus enclosed.
4984 4984
4985 4985
4986 4986
4987* Changes in version 19.15. 4987* Changes in Emacs 19.15
4988 4988
4989** 'make-frame-visible', which uniconified frames, is now a command, 4989** 'make-frame-visible', which uniconified frames, is now a command,
4990and thus may be bound to a key. This makes sense because frames 4990and thus may be bound to a key. This makes sense because frames
@@ -5032,7 +5032,7 @@ and thus didn't document it.)
5032 5032
5033 5033
5034 5034
5035* Changes in version 19.14. 5035* Changes in Emacs 19.14
5036 5036
5037** To modify read-only text, bind the variable 'inhibit-read-only' 5037** To modify read-only text, bind the variable 'inhibit-read-only'
5038to a non-nil value. If the value is t, then all reasons that might 5038to a non-nil value. If the value is t, then all reasons that might
@@ -5078,7 +5078,7 @@ If you specify BEG or END, then the argument VISIT must be nil.
5078 5078
5079 5079
5080 5080
5081* Changes in version 19.13. 5081* Changes in Emacs 19.13
5082 5082
5083** Magic file names can now handle the 'load' operation. 5083** Magic file names can now handle the 'load' operation.
5084 5084
@@ -5098,14 +5098,14 @@ We may move them again for greater consistency with other modes.
5098 5098
5099 5099
5100 5100
5101* Changes in version 19.12. 5101* Changes in Emacs 19.12
5102 5102
5103** You can now make many of the sort commands ignore case by setting 5103** You can now make many of the sort commands ignore case by setting
5104'sort-fold-case' to a non-nil value. 5104'sort-fold-case' to a non-nil value.
5105 5105
5106 5106
5107 5107
5108* Changes in version 19.11. 5108* Changes in Emacs 19.11
5109 5109
5110** Supercite is installed. 5110** Supercite is installed.
5111 5111
@@ -5124,7 +5124,7 @@ it writes a file in the usual way.
5124 5124
5125 5125
5126 5126
5127* Changes in version 19.10. 5127* Changes in Emacs 19.10
5128 5128
5129** The command 'repeat-complex-command' is now on C-x ESC ESC. 5129** The command 'repeat-complex-command' is now on C-x ESC ESC.
5130It used to be bound to C-x ESC. 5130It used to be bound to C-x ESC.
@@ -5138,7 +5138,7 @@ using X).
5138 5138
5139 5139
5140 5140
5141* Changes in version 19.8. 5141* Changes in Emacs 19.8
5142 5142
5143** It is now simpler to tell Emacs to display accented characters under 5143** It is now simpler to tell Emacs to display accented characters under
5144X windows. M-x standard-display-european toggles the display of 5144X windows. M-x standard-display-european toggles the display of
@@ -5184,7 +5184,7 @@ If the optional arguments FACE and FRAME are specified, then
5184 5184
5185 5185
5186 5186
5187* Changes in version 19. 5187* Changes in Emacs 19.1
5188 5188
5189** When you kill buffers, Emacs now returns memory to the operating system, 5189** When you kill buffers, Emacs now returns memory to the operating system,
5190thus reducing the size of the Emacs process. All the space that you free 5190thus reducing the size of the Emacs process. All the space that you free
diff --git a/lisp/files.el b/lisp/files.el
index 461960d6f2b..4e3aeeb9246 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4713,21 +4713,22 @@ the \".dir-locals.el\".
4713 4713
4714See Info node `(elisp)Directory Local Variables' for details.") 4714See Info node `(elisp)Directory Local Variables' for details.")
4715 4715
4716(defun dir-locals--all-files (directory) 4716(defun dir-locals--all-files (directory &optional base-el-only)
4717 "Return a list of all readable dir-locals files in DIRECTORY. 4717 "Return a list of all readable dir-locals files in DIRECTORY.
4718The returned list is sorted by increasing priority. That is, 4718The returned list is sorted by increasing priority. That is,
4719values specified in the last file should take precedence over 4719values specified in the last file should take precedence over
4720those in the first." 4720those in the first."
4721 (when (file-readable-p directory) 4721 (when (file-readable-p directory)
4722 (let* ((file-1 (expand-file-name (if (eq system-type 'ms-dos) 4722 (let* ((file-1 (expand-file-name (if (eq system-type 'ms-dos)
4723 (dosified-file-name dir-locals-file) 4723 (dosified-file-name dir-locals-file)
4724 dir-locals-file) 4724 dir-locals-file)
4725 directory)) 4725 directory))
4726 (file-2 (when (string-match "\\.el\\'" file-1) 4726 (file-2 (when (string-match "\\.el\\'" file-1)
4727 (replace-match "-2.el" t nil file-1))) 4727 (replace-match "-2.el" t nil file-1)))
4728 (out nil)) 4728 out)
4729 ;; The order here is important. 4729 (dolist (f (or (and base-el-only (list file-1))
4730 (dolist (f (list file-2 file-1)) 4730 ;; The order here is important.
4731 (list file-2 file-1)))
4731 (when (and f 4732 (when (and f
4732 (file-readable-p f) 4733 (file-readable-p f)
4733 ;; FIXME: Aren't file-regular-p and 4734 ;; FIXME: Aren't file-regular-p and
@@ -4737,6 +4738,10 @@ those in the first."
4737 (push f out))) 4738 (push f out)))
4738 out))) 4739 out)))
4739 4740
4741(defun dir-locals--base-file (directory)
4742 "Return readable `dir-locals-file' in DIRECTORY, or nil."
4743 (dir-locals--all-files directory 'base-el-only))
4744
4740(defun dir-locals-find-file (file) 4745(defun dir-locals-find-file (file)
4741 "Find the directory-local variables for FILE. 4746 "Find the directory-local variables for FILE.
4742This searches upward in the directory tree from FILE. 4747This searches upward in the directory tree from FILE.
@@ -4758,7 +4763,7 @@ This function returns either:
4758 entry." 4763 entry."
4759 (setq file (expand-file-name file)) 4764 (setq file (expand-file-name file))
4760 (let* ((locals-dir (locate-dominating-file (file-name-directory file) 4765 (let* ((locals-dir (locate-dominating-file (file-name-directory file)
4761 #'dir-locals--all-files)) 4766 #'dir-locals--base-file))
4762 dir-elt) 4767 dir-elt)
4763 ;; `locate-dominating-file' may have abbreviated the name. 4768 ;; `locate-dominating-file' may have abbreviated the name.
4764 (when locals-dir 4769 (when locals-dir
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 31ad96d4a78..fa678740810 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -4265,7 +4265,7 @@ Attempt to do the search exactly the way the pending Isearch would."
4265 (and (eq isearch-lazy-highlight-invisible 'open) 4265 (and (eq isearch-lazy-highlight-invisible 'open)
4266 'can-be-opened))) 4266 'can-be-opened)))
4267 (funcall isearch-filter-predicate mb me))) 4267 (funcall isearch-filter-predicate mb me)))
4268 (let ((ov (make-overlay mb me))) 4268 (let ((ov (make-overlay mb me nil t nil)))
4269 (push ov isearch-lazy-highlight-overlays) 4269 (push ov isearch-lazy-highlight-overlays)
4270 ;; 1000 is higher than ediff's 100+, 4270 ;; 1000 is higher than ediff's 100+,
4271 ;; but lower than isearch main overlay's 1001 4271 ;; but lower than isearch main overlay's 1001
diff --git a/src/nsfns.m b/src/nsfns.m
index 9f52777879c..b1ed0eff58a 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1404,12 +1404,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1404#ifdef NS_IMPL_COCOA 1404#ifdef NS_IMPL_COCOA
1405 tem = gui_display_get_arg (dpyinfo, parms, Qns_appearance, NULL, NULL, 1405 tem = gui_display_get_arg (dpyinfo, parms, Qns_appearance, NULL, NULL,
1406 RES_TYPE_SYMBOL); 1406 RES_TYPE_SYMBOL);
1407 if (EQ (tem, Qdark)) 1407 ns_set_appearance_1 (f, tem);
1408 FRAME_NS_APPEARANCE (f) = ns_appearance_vibrant_dark;
1409 else if (EQ (tem, Qlight))
1410 FRAME_NS_APPEARANCE (f) = ns_appearance_aqua;
1411 else
1412 FRAME_NS_APPEARANCE (f) = ns_appearance_system_default;
1413 store_frame_param (f, Qns_appearance, 1408 store_frame_param (f, Qns_appearance,
1414 (!NILP (tem) && !EQ (tem, Qunbound)) ? tem : Qnil); 1409 (!NILP (tem) && !EQ (tem, Qunbound)) ? tem : Qnil);
1415 1410
diff --git a/src/nsterm.h b/src/nsterm.h
index 2616dacc3e2..2abf402f8bc 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1236,6 +1236,7 @@ extern void ns_set_no_accept_focus (struct frame *f, Lisp_Object new_value,
1236extern void ns_set_z_group (struct frame *f, Lisp_Object new_value, 1236extern void ns_set_z_group (struct frame *f, Lisp_Object new_value,
1237 Lisp_Object old_value); 1237 Lisp_Object old_value);
1238#ifdef NS_IMPL_COCOA 1238#ifdef NS_IMPL_COCOA
1239extern void ns_set_appearance_1 (struct frame *f, Lisp_Object value);
1239extern void ns_set_appearance (struct frame *f, Lisp_Object new_value, 1240extern void ns_set_appearance (struct frame *f, Lisp_Object new_value,
1240 Lisp_Object old_value); 1241 Lisp_Object old_value);
1241extern void ns_set_transparent_titlebar (struct frame *f, 1242extern void ns_set_transparent_titlebar (struct frame *f,
diff --git a/src/nsterm.m b/src/nsterm.m
index 46bb3f5dd7a..5514a693c86 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1932,6 +1932,17 @@ ns_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
1932 1932
1933#ifdef NS_IMPL_COCOA 1933#ifdef NS_IMPL_COCOA
1934void 1934void
1935ns_set_appearance_1 (struct frame *f, Lisp_Object new_value)
1936{
1937 if (EQ (new_value, Qdark))
1938 FRAME_NS_APPEARANCE (f) = ns_appearance_vibrant_dark;
1939 else if (EQ (new_value, Qlight))
1940 FRAME_NS_APPEARANCE (f) = ns_appearance_aqua;
1941 else
1942 FRAME_NS_APPEARANCE (f) = ns_appearance_system_default;
1943}
1944
1945void
1935ns_set_appearance (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) 1946ns_set_appearance (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
1936{ 1947{
1937#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 1948#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
@@ -1943,12 +1954,7 @@ ns_set_appearance (struct frame *f, Lisp_Object new_value, Lisp_Object old_value
1943 if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) 1954 if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10)
1944 return; 1955 return;
1945 1956
1946 if (EQ (new_value, Qdark)) 1957 ns_set_appearance_1 (f, new_value);
1947 FRAME_NS_APPEARANCE (f) = ns_appearance_vibrant_dark;
1948 else if (EQ (new_value, Qlight))
1949 FRAME_NS_APPEARANCE (f) = ns_appearance_aqua;
1950 else
1951 FRAME_NS_APPEARANCE (f) = ns_appearance_system_default;
1952 1958
1953 [window setAppearance]; 1959 [window setAppearance];
1954#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 */ 1960#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 */
diff --git a/test/lisp/files-resources/dir-locals-2-solo/.dir-locals-2.el b/test/lisp/files-resources/dir-locals-2-solo/.dir-locals-2.el
new file mode 100644
index 00000000000..08584933c41
--- /dev/null
+++ b/test/lisp/files-resources/dir-locals-2-solo/.dir-locals-2.el
@@ -0,0 +1 @@
((nil . ((dir-locals-2-loaded . t))))
diff --git a/test/lisp/files-resources/dir-locals-2-solo/dir-locals-2-solo.txt b/test/lisp/files-resources/dir-locals-2-solo/dir-locals-2-solo.txt
new file mode 100644
index 00000000000..83ed6482e06
--- /dev/null
+++ b/test/lisp/files-resources/dir-locals-2-solo/dir-locals-2-solo.txt
@@ -0,0 +1,3 @@
1# Used by files-test.el.
2# Due to solo .dir-locals-2.el, the local variable `dir-locals-2-loaded'
3# should be undefined.
diff --git a/test/lisp/files-resources/dir-locals-and-2/.dir-locals-2.el b/test/lisp/files-resources/dir-locals-and-2/.dir-locals-2.el
new file mode 100644
index 00000000000..08584933c41
--- /dev/null
+++ b/test/lisp/files-resources/dir-locals-and-2/.dir-locals-2.el
@@ -0,0 +1 @@
((nil . ((dir-locals-2-loaded . t))))
diff --git a/test/lisp/files-resources/dir-locals-and-2/.dir-locals.el b/test/lisp/files-resources/dir-locals-and-2/.dir-locals.el
new file mode 100644
index 00000000000..2b57bf9e7c0
--- /dev/null
+++ b/test/lisp/files-resources/dir-locals-and-2/.dir-locals.el
@@ -0,0 +1 @@
((nil . ((dir-locals-loaded . t))))
diff --git a/test/lisp/files-resources/dir-locals-and-2/dir-locals-and-2.txt b/test/lisp/files-resources/dir-locals-and-2/dir-locals-and-2.txt
new file mode 100644
index 00000000000..bb8a31ca147
--- /dev/null
+++ b/test/lisp/files-resources/dir-locals-and-2/dir-locals-and-2.txt
@@ -0,0 +1,4 @@
1# Used by files-test.el.
2# .dir-locals.el and .dir-locals-2.el should define:
3# local variable `dir-locals-loaded'
4# local variable `dir-locals-2-loaded'
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 9f17747da1f..91ca557204e 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1782,6 +1782,21 @@ set to."
1782 ;; Invocation through env, with modified environment. 1782 ;; Invocation through env, with modified environment.
1783 (files-tests--check-shebang "#!/usr/bin/env -S PYTHONPATH=/...:${PYTHONPATH} python" 'python-base-mode)) 1783 (files-tests--check-shebang "#!/usr/bin/env -S PYTHONPATH=/...:${PYTHONPATH} python" 'python-base-mode))
1784 1784
1785(ert-deftest files-test-dir-locals-2-solo ()
1786 "Ensure that solo `.dir-locals-2.el' is ignored."
1787 (with-current-buffer
1788 (find-file-noselect (ert-resource-file
1789 (concat "dir-locals-2-solo/dir-locals-2-solo.txt")))
1790 (should-not (local-variable-p 'dir-locals-2-loaded))))
1791
1792(ert-deftest files-test-dir-locals-2-paired ()
1793 "Ensure that `.dir-locals-2.el' is loaded, if paired."
1794 (let ((enable-local-variables :all))
1795 (with-current-buffer (find-file-noselect
1796 (ert-resource-file (concat "dir-locals-and-2/dir-locals-and-2.txt")))
1797 (should (local-variable-p 'dir-locals-loaded))
1798 (should (local-variable-p 'dir-locals-2-loaded)))))
1799
1785(ert-deftest files-test-dir-locals-auto-mode-alist () 1800(ert-deftest files-test-dir-locals-auto-mode-alist ()
1786 "Test an `auto-mode-alist' entry in `.dir-locals.el'" 1801 "Test an `auto-mode-alist' entry in `.dir-locals.el'"
1787 (find-file (ert-resource-file "whatever.quux")) 1802 (find-file (ert-resource-file "whatever.quux"))