aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2025-01-04 09:59:55 -0500
committerEli Zaretskii2025-01-04 09:59:55 -0500
commit6814ab06f2c7b5b271e6d78d4e05ce498ffc403d (patch)
treee28e9a577f3759cd9da0e487e1c5eb83740fde33
parenta1b687568fdf204f1e7e1244b60cf9d41c3ce7eb (diff)
parent6468c3f7a74133b130d15172d770c8b7eebfeac5 (diff)
downloademacs-6814ab06f2c7b5b271e6d78d4e05ce498ffc403d.tar.gz
emacs-6814ab06f2c7b5b271e6d78d4e05ce498ffc403d.zip
Merge from origin/emacs-30
6468c3f7a74 Update doc string of 'insert' 6d8c3c0cbe4 Use `keymap*-set' over `global-set-key'/`define-key' in e... 4b2bb63b7ac Fix documentation and prompt in 'package-isolate' 55f43f5b220 ; Fix typo in treesit-explore-mode 921f454f508 Update fontification for attribute values in heex-ts-mode ae2589ea7a5 Add expression handling to heex-ts-mode 0cacf806391 ; * etc/NEWS: Document change of 'make-cursor-line-fully-... f47a29da5c4 * lisp/man.el (Man-mode): Improve docstring. # Conflicts: # etc/NEWS
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi120
-rw-r--r--etc/NEWS.307
-rw-r--r--lisp/emacs-lisp/package.el15
-rw-r--r--lisp/man.el16
-rw-r--r--lisp/progmodes/heex-ts-mode.el5
-rw-r--r--lisp/treesit.el2
-rw-r--r--src/editfns.c4
-rw-r--r--test/lisp/progmodes/heex-ts-mode-resources/indent.erts16
8 files changed, 129 insertions, 56 deletions
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 3e3febaf162..2c94e7f407e 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -13810,7 +13810,7 @@ syntax table determines which characters these are."
13810If you wish, you can also install this key binding by evaluating it: 13810If you wish, you can also install this key binding by evaluating it:
13811 13811
13812@smallexample 13812@smallexample
13813(global-set-key "\C-c=" '@value{COUNT-WORDS}) 13813(keymap-global-set "C-c =" '@value{COUNT-WORDS})
13814@end smallexample 13814@end smallexample
13815 13815
13816To conduct the first test, set mark and point to the beginning and end 13816To conduct the first test, set mark and point to the beginning and end
@@ -14762,7 +14762,7 @@ almost the same code as for the recursive version of
14762Let's reuse @kbd{C-c =} as a convenient key binding: 14762Let's reuse @kbd{C-c =} as a convenient key binding:
14763 14763
14764@smallexample 14764@smallexample
14765(global-set-key "\C-c=" 'count-words-defun) 14765(keymap-global-set "C-c =" 'count-words-defun)
14766@end smallexample 14766@end smallexample
14767 14767
14768Now we can try out @code{count-words-defun}: install both 14768Now we can try out @code{count-words-defun}: install both
@@ -17229,7 +17229,7 @@ Now for some personal key bindings:
17229@smallexample 17229@smallexample
17230@group 17230@group
17231;;; Compare windows 17231;;; Compare windows
17232(global-set-key "\C-cw" 'compare-windows) 17232(keymap-global-set "C-c w" 'compare-windows)
17233@end group 17233@end group
17234@end smallexample 17234@end smallexample
17235 17235
@@ -17242,20 +17242,18 @@ each window as far as they match. I use this command all the time.
17242This also shows how to set a key globally, for all modes. 17242This also shows how to set a key globally, for all modes.
17243 17243
17244@cindex Setting a key globally 17244@cindex Setting a key globally
17245@cindex Global set key 17245@cindex Keymap global set
17246@cindex Key setting globally 17246@cindex Key setting globally
17247@findex global-set-key 17247@findex keymap-global-set
17248The command is @code{global-set-key}. It is followed by the 17248The key setting command is @code{keymap-global-set}. It is followed by
17249key binding. In a @file{.emacs} file, the keybinding is written as 17249the key binding. In a @file{.emacs} file, the keybinding is written as
17250shown: @code{\C-c} stands for Control-C, which means to press the 17250shown: @code{C-c} stands for Control-C, which means to press the control
17251control key and the @kbd{c} key at the same time. The @code{w} means 17251key and the @kbd{c} key at the same time. The @code{w} means to press
17252to press the @kbd{w} key. The key binding is surrounded by double 17252the @kbd{w} key. The key binding is surrounded by double quotation
17253quotation marks. In documentation, you would write this as 17253marks. (If you were binding a @key{META} key, rather than a @key{CTRL}
17254@w{@kbd{C-c w}}. (If you were binding a @key{META} key, such as 17254key, you would write @w{@code{M-c}} in your @file{.emacs} file.
17255@kbd{M-c}, rather than a @key{CTRL} key, you would write 17255@xref{Init Rebinding, , Rebinding Keys in Your Init File, emacs, The GNU
17256@w{@code{\M-c}} in your @file{.emacs} file. @xref{Init Rebinding, , 17256Emacs Manual}, for details.)
17257Rebinding Keys in Your Init File, emacs, The GNU Emacs Manual}, for
17258details.)
17259 17257
17260The command invoked by the keys is @code{compare-windows}. Note that 17258The command invoked by the keys is @code{compare-windows}. Note that
17261@code{compare-windows} is preceded by a single-quote; otherwise, Emacs 17259@code{compare-windows} is preceded by a single-quote; otherwise, Emacs
@@ -17284,7 +17282,7 @@ Here is another key binding, with a comment:
17284@group 17282@group
17285;;; Key binding for 'occur' 17283;;; Key binding for 'occur'
17286; I use occur a lot, so let's bind it to a key: 17284; I use occur a lot, so let's bind it to a key:
17287(global-set-key "\C-co" 'occur) 17285(keymap-global-set "C-c o" 'occur)
17288@end group 17286@end group
17289@end smallexample 17287@end smallexample
17290 17288
@@ -17296,7 +17294,7 @@ uses the entire buffer.
17296Matching lines are shown in a buffer called @file{*Occur*}. 17294Matching lines are shown in a buffer called @file{*Occur*}.
17297That buffer serves as a menu to jump to occurrences. 17295That buffer serves as a menu to jump to occurrences.
17298 17296
17299@findex global-unset-key 17297@findex keymap-global-unset
17300@cindex Unbinding key 17298@cindex Unbinding key
17301@cindex Key unbinding 17299@cindex Key unbinding
17302@need 1250 17300@need 1250
@@ -17306,7 +17304,7 @@ work:
17306@smallexample 17304@smallexample
17307@group 17305@group
17308;;; Unbind 'C-x f' 17306;;; Unbind 'C-x f'
17309(global-unset-key "\C-xf") 17307(keymap-global-unset "C-x f")
17310@end group 17308@end group
17311@end smallexample 17309@end smallexample
17312 17310
@@ -17324,7 +17322,7 @@ The following rebinds an existing key:
17324@smallexample 17322@smallexample
17325@group 17323@group
17326;;; Rebind 'C-x C-b' for 'buffer-menu' 17324;;; Rebind 'C-x C-b' for 'buffer-menu'
17327(global-set-key "\C-x\C-b" 'buffer-menu) 17325(keymap-global-set "C-x C-b" 'buffer-menu)
17328@end group 17326@end group
17329@end smallexample 17327@end smallexample
17330 17328
@@ -17336,33 +17334,80 @@ window, I prefer the @code{buffer-menu}
17336command, which not only lists the buffers, 17334command, which not only lists the buffers,
17337but moves point into that window. 17335but moves point into that window.
17338 17336
17337@subsection Legacy Global Key Binding Commands
17338
17339@findex global-set-key
17340@cindex Global set key
17341Historically, keys are bound globally using a lower-level function,
17342@code{global-set-key}, which is now considered legacy. While you are
17343encouraged to use @code{keymap-global-set}, you likely would encounter
17344@code{global-set-key} in various places. The first example in this
17345section can be rewritten using @code{global-set-key} as:
17346
17347@smallexample
17348@group
17349(global-set-key "\C-cw" 'compare-windows)
17350@end group
17351@end smallexample
17352
17353It is very similar to @code{keymap-global-set}, with the keybinding
17354following a slightly different format. Control-C is represented by
17355@code{\C-c}, instead of @code{C-c}. There is no space between key
17356strokes, like @code{\C-c} and @code{w} in this example. Despite the
17357difference, in documentation, this is still written as @w{@kbd{C-c w}}
17358for readability.
17359
17360@findex global-unset-key
17361Historically, keys are unbound globally using a lower-function,
17362@code{global-unset-key}, which is now considered legacy. Its key
17363binding format follows that of @code{global-set-key}. The key unbinding
17364example in this section can be rewritten as:
17365
17366@smallexample
17367@group
17368;;; Unbind 'C-x f'
17369(global-unset-key "\C-xf")
17370@end group
17371@end smallexample
17372
17339@node Keymaps 17373@node Keymaps
17340@section Keymaps 17374@section Keymaps
17341@cindex Keymaps 17375@cindex Keymaps
17342@cindex Rebinding keys 17376@cindex Rebinding keys
17343 17377
17344Emacs uses @dfn{keymaps} to record which keys call which commands. 17378Emacs uses @dfn{keymaps} to record which keys call which commands.
17345When you use @code{global-set-key} to set the key binding for a single 17379When you use @code{keymap-global-set} to set the key binding for a
17346command in all parts of Emacs, you are specifying the key binding in 17380single command in all parts of Emacs, you are specifying the key binding
17347@code{current-global-map}. 17381in @code{current-global-map}.
17348 17382
17349Specific modes, such as C mode or Text mode, have their own keymaps; 17383Specific modes, such as C mode or Text mode, have their own keymaps;
17350the mode-specific keymaps override the global map that is shared by 17384the mode-specific keymaps override the global map that is shared by
17351all buffers. 17385all buffers.
17352 17386
17353The @code{global-set-key} function binds, or rebinds, the global 17387The @code{keymap-global-set} function binds, or rebinds, the global
17354keymap. For example, the following binds the key @kbd{C-x C-b} to the 17388keymap. For example, the following binds the key @kbd{C-x C-b} to the
17355function @code{buffer-menu}: 17389function @code{buffer-menu}:
17356 17390
17357@smallexample 17391@smallexample
17358(global-set-key "\C-x\C-b" 'buffer-menu) 17392(keymap-global-set "C-x C-b" 'buffer-menu)
17359@end smallexample 17393@end smallexample
17360 17394
17361Mode-specific keymaps are bound using the @code{define-key} function, 17395Mode-specific keymaps are bound using the @code{keymap-set} function,
17362which takes a specific keymap as an argument, as well as the key and 17396which takes a specific keymap as an argument, as well as the key and
17363the command. For example, my @file{.emacs} file contains the 17397the command. For example, the following expression binds the
17364following expression to bind the @code{texinfo-insert-@@group} command 17398@code{texinfo-insert-@@group} command to @kbd{C-c C-c g}:
17365to @kbd{C-c C-c g}: 17399
17400@smallexample
17401@group
17402(keymap-set texinfo-mode-map "C-c C-c g" 'texinfo-insert-@@group)
17403@end group
17404@end smallexample
17405
17406Historically, keymaps are bound using a lower-level function,
17407@code{define-key}, which is now considered legacy. While you are
17408encouraged to use @code{keymap-set}, you likely would encounter
17409@code{define-key} in various places. The above key binding can be
17410rewritten using @code{define-key} as:
17366 17411
17367@smallexample 17412@smallexample
17368@group 17413@group
@@ -17396,9 +17441,9 @@ Here is the @code{texinfo-insert-@@group} function definition:
17396write a function to insert a word; but I prefer key strokes consistent 17441write a function to insert a word; but I prefer key strokes consistent
17397with other Texinfo mode key bindings.) 17442with other Texinfo mode key bindings.)
17398 17443
17399You will see numerous @code{define-key} expressions in 17444You will see numerous @code{keymap-set} and @code{define-key}
17400@file{loaddefs.el} as well as in the various mode libraries, such as 17445expressions in @file{loaddefs.el} as well as in the various mode
17401@file{cc-mode.el} and @file{lisp-mode.el}. 17446libraries, such as @file{cc-mode.el} and @file{lisp-mode.el}.
17402 17447
17403@xref{Key Bindings, , Customizing Key Bindings, emacs, The GNU Emacs 17448@xref{Key Bindings, , Customizing Key Bindings, emacs, The GNU Emacs
17404Manual}, and @ref{Keymaps, , Keymaps, elisp, The GNU Emacs Lisp 17449Manual}, and @ref{Keymaps, , Keymaps, elisp, The GNU Emacs Lisp
@@ -17440,13 +17485,12 @@ window.
17440 17485
17441@need 1250 17486@need 1250
17442To replace the key binding for the default 17487To replace the key binding for the default
17443@code{split-window-vertically}, you must also unset that key and bind 17488@code{split-window-vertically}, you must bind the keys to
17444the keys to @code{split-window-quietly}, like this: 17489@code{split-window-quietly}, like this:
17445 17490
17446@smallexample 17491@smallexample
17447@group 17492@group
17448(global-unset-key "\C-x2") 17493(keymap-global-set "C-x 2" 'split-window-quietly)
17449(global-set-key "\C-x2" 'split-window-quietly)
17450@end group 17494@end group
17451@end smallexample 17495@end smallexample
17452 17496
@@ -17608,7 +17652,7 @@ I bind @code{line-to-top-of-window} to my @key{F6} function key like
17608this: 17652this:
17609 17653
17610@smallexample 17654@smallexample
17611(global-set-key [f6] 'line-to-top-of-window) 17655(keymap-global-set "<f6>" 'line-to-top-of-window)
17612@end smallexample 17656@end smallexample
17613 17657
17614For more information, see @ref{Init Rebinding, , Rebinding Keys in 17658For more information, see @ref{Init Rebinding, , Rebinding Keys in
@@ -18791,7 +18835,7 @@ Here is the @code{the-the} function, as I include it in my
18791 18835
18792@group 18836@group
18793;; Bind 'the-the' to C-c \ 18837;; Bind 'the-the' to C-c \
18794(global-set-key "\C-c\\" 'the-the) 18838(keymap-global-set "C-c \\" 'the-the)
18795@end group 18839@end group
18796@end smallexample 18840@end smallexample
18797 18841
diff --git a/etc/NEWS.30 b/etc/NEWS.30
index 408b2bc9f7c..6b2831e3809 100644
--- a/etc/NEWS.30
+++ b/etc/NEWS.30
@@ -196,6 +196,13 @@ removed, as it was considered more dangerous than useful. RFC 9110
196To send an email address in the header of individual HTTP requests, 196To send an email address in the header of individual HTTP requests,
197see the variable 'url-request-extra-headers'. 197see the variable 'url-request-extra-headers'.
198 198
199---
200** 'pixel-scroll-precision-mode' sets 'make-cursor-line-fully-visible'.
201'pixel-scroll-precision-mode' sets 'make-cursor-line-fully-visible' to a
202nil value globally, since the usual requirement of the Emacs display to
203make the cursor line fully visible contradicts the smooth scrolling
204expectations.
205
199 206
200* Changes in Emacs 30.1 207* Changes in Emacs 30.1
201 208
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index b4a33db1a77..9e62f0a5c0d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2651,16 +2651,23 @@ argument, don't ask for confirmation to install packages."
2651 2651
2652(defun package-isolate (packages &optional temp-init) 2652(defun package-isolate (packages &optional temp-init)
2653 "Start an uncustomized Emacs and only load a set of PACKAGES. 2653 "Start an uncustomized Emacs and only load a set of PACKAGES.
2654Interactively, prompt for PACKAGES to load, which should be specified
2655separated by commas.
2656If called from Lisp, PACKAGES should be a list of packages to load.
2654If TEMP-INIT is non-nil, or when invoked with a prefix argument, 2657If TEMP-INIT is non-nil, or when invoked with a prefix argument,
2655the Emacs user directory is set to a temporary directory." 2658the Emacs user directory is set to a temporary directory.
2659This command is intended for testing Emacs and/or the packages
2660in a clean environment."
2656 (interactive 2661 (interactive
2657 (cl-loop for p in (cl-loop for p in (package--alist) append (cdr p)) 2662 (cl-loop for p in (cl-loop for p in (package--alist) append (cdr p))
2658 unless (package-built-in-p p) 2663 unless (package-built-in-p p)
2659 collect (cons (package-desc-full-name p) p) into table 2664 collect (cons (package-desc-full-name p) p) into table
2660 finally return 2665 finally return
2661 (list (cl-loop for c in (completing-read-multiple 2666 (list
2662 "Isolate packages: " table 2667 (cl-loop for c in
2663 nil t) 2668 (completing-read-multiple
2669 "Packages to isolate, as comma-separated list: " table
2670 nil t)
2664 collect (alist-get c table nil nil #'string=)) 2671 collect (alist-get c table nil nil #'string=))
2665 current-prefix-arg))) 2672 current-prefix-arg)))
2666 (let* ((name (concat "package-isolate-" 2673 (let* ((name (concat "package-isolate-"
diff --git a/lisp/man.el b/lisp/man.el
index 54ca8cbae9f..ed97606f7e2 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1673,9 +1673,8 @@ commands from `Man-mode'. Used by `woman'.
1673(define-derived-mode Man-mode man-common "Man" 1673(define-derived-mode Man-mode man-common "Man"
1674 "A mode for browsing Un*x manual pages. 1674 "A mode for browsing Un*x manual pages.
1675 1675
1676The following man commands are available in the buffer. Try 1676The following man commands are available in the buffer:
1677\"\\[describe-key] <key> RET\" for more information: 1677\\<Man-mode-map>
1678
1679\\[man] Prompt to retrieve a new manpage. 1678\\[man] Prompt to retrieve a new manpage.
1680\\[Man-follow-manual-reference] Retrieve reference in SEE ALSO section. 1679\\[Man-follow-manual-reference] Retrieve reference in SEE ALSO section.
1681\\[Man-next-manpage] Jump to next manpage in circular list. 1680\\[Man-next-manpage] Jump to next manpage in circular list.
@@ -1683,13 +1682,12 @@ The following man commands are available in the buffer. Try
1683\\[Man-next-section] Jump to next manpage section. 1682\\[Man-next-section] Jump to next manpage section.
1684\\[Man-previous-section] Jump to previous manpage section. 1683\\[Man-previous-section] Jump to previous manpage section.
1685\\[Man-goto-section] Go to a manpage section. 1684\\[Man-goto-section] Go to a manpage section.
1686\\[Man-goto-see-also-section] Jumps to the SEE ALSO manpage section. 1685\\[Man-goto-see-also-section] Jump to the SEE ALSO manpage section.
1687\\[quit-window] Deletes the manpage window, bury its buffer. 1686\\[quit-window] Delete the manpage window, bury its buffer.
1688\\[Man-kill] Deletes the manpage window, kill its buffer. 1687\\[Man-kill] Delete the manpage window, kill its buffer.
1689\\[describe-mode] Prints this help text. 1688\\[describe-mode] Print this help text.
1690 1689
1691The following variables may be of some use. Try 1690The following variables may be of some use:
1692\"\\[describe-variable] <variable-name> RET\" for more information:
1693 1691
1694`Man-notify-method' What happens when manpage is ready to display. 1692`Man-notify-method' What happens when manpage is ready to display.
1695`Man-downcase-section-letters-flag' Force section letters to lower case. 1693`Man-downcase-section-letters-flag' Force section letters to lower case.
diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el
index fbef233a2aa..65aaa0d488d 100644
--- a/lisp/progmodes/heex-ts-mode.el
+++ b/lisp/progmodes/heex-ts-mode.el
@@ -59,7 +59,7 @@
59(defconst heex-ts--sexp-regexp 59(defconst heex-ts--sexp-regexp
60 (rx bol 60 (rx bol
61 (or "directive" "tag" "component" "slot" 61 (or "directive" "tag" "component" "slot"
62 "attribute" "attribute_value" "quoted_attribute_value") 62 "attribute" "attribute_value" "quoted_attribute_value" "expression")
63 eol)) 63 eol))
64 64
65;; There seems to be no parent directive block for tree-sitter-heex, 65;; There seems to be no parent directive block for tree-sitter-heex,
@@ -86,6 +86,7 @@
86 ((node-is "end_slot") parent-bol 0) 86 ((node-is "end_slot") parent-bol 0)
87 ((node-is "/>") parent-bol 0) 87 ((node-is "/>") parent-bol 0)
88 ((node-is ">") parent-bol 0) 88 ((node-is ">") parent-bol 0)
89 ((node-is "}") parent-bol 0)
89 ((parent-is "comment") prev-adaptive-prefix 0) 90 ((parent-is "comment") prev-adaptive-prefix 0)
90 ((parent-is "component") parent-bol ,offset) 91 ((parent-is "component") parent-bol ,offset)
91 ((parent-is "tag") parent-bol ,offset) 92 ((parent-is "tag") parent-bol ,offset)
@@ -117,7 +118,7 @@
117 `((special_attribute_name) @font-lock-keyword-face) 118 `((special_attribute_name) @font-lock-keyword-face)
118 :language 'heex 119 :language 'heex
119 :feature 'heex-string 120 :feature 'heex-string
120 `([(attribute_value) (quoted_attribute_value)] @font-lock-constant-face) 121 `([(attribute_value) (quoted_attribute_value)] @font-lock-string-face)
121 :language 'heex 122 :language 'heex
122 :feature 'heex-component 123 :feature 'heex-component
123 `([ 124 `([
diff --git a/lisp/treesit.el b/lisp/treesit.el
index f3c553fdb8f..d45acb00188 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -4094,7 +4094,7 @@ window."
4094 ;; Turn off explore mode. 4094 ;; Turn off explore mode.
4095 (remove-hook 'post-command-hook 4095 (remove-hook 'post-command-hook
4096 #'treesit--explorer-post-command t) 4096 #'treesit--explorer-post-command t)
4097 (remove-hook 'post-command-hook 4097 (remove-hook 'kill-buffer-hook
4098 #'treesit--explorer-kill-explorer-buffer t) 4098 #'treesit--explorer-kill-explorer-buffer t)
4099 (treesit--explorer-kill-explorer-buffer))) 4099 (treesit--explorer-kill-explorer-buffer)))
4100 4100
diff --git a/src/editfns.c b/src/editfns.c
index 581bd03798e..8a5fb673fe7 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1363,8 +1363,8 @@ to unibyte for insertion (see `string-make-unibyte').
1363 1363
1364When operating on binary data, it may be necessary to preserve the 1364When operating on binary data, it may be necessary to preserve the
1365original bytes of a unibyte string when inserting it into a multibyte 1365original bytes of a unibyte string when inserting it into a multibyte
1366buffer; to accomplish this, apply `string-as-multibyte' to the string 1366buffer; to accomplish this, apply `decode-coding-string' with the
1367and insert the result. 1367`no-conversion' coding system to the string and insert the result.
1368 1368
1369usage: (insert &rest ARGS) */) 1369usage: (insert &rest ARGS) */)
1370 (ptrdiff_t nargs, Lisp_Object *args) 1370 (ptrdiff_t nargs, Lisp_Object *args)
diff --git a/test/lisp/progmodes/heex-ts-mode-resources/indent.erts b/test/lisp/progmodes/heex-ts-mode-resources/indent.erts
index 500ddb2b536..7fef6571933 100644
--- a/test/lisp/progmodes/heex-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/heex-ts-mode-resources/indent.erts
@@ -45,3 +45,19 @@ Name: Slots
45 </:bar> 45 </:bar>
46</Foo> 46</Foo>
47=-=-= 47=-=-=
48
49Name: Expression
50
51=-=
52<div>
53{
54@bar
55}
56</div>
57=-=
58<div>
59 {
60 @bar
61 }
62</div>
63=-=-=