diff options
-rw-r--r-- | doc/lispref/help.texi | 8 | ||||
-rw-r--r-- | doc/lispref/windows.texi | 12 | ||||
-rw-r--r-- | etc/NEWS.28 | 14 | ||||
-rw-r--r-- | lisp/calendar/calendar.el | 3 | ||||
-rw-r--r-- | lisp/help.el | 35 | ||||
-rw-r--r-- | lisp/international/titdic-cnv.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/grep.el | 2 | ||||
-rw-r--r-- | src/xdisp.c | 9 |
8 files changed, 50 insertions, 35 deletions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 71017a4d3db..e7b6406fd8c 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -379,11 +379,15 @@ quotes. You can customize it freely according to your personal preference. @end defopt -@defun substitute-command-keys string +@defun substitute-command-keys string &optional no-face +@vindex help-key-binding@r{ (face)} This function scans @var{string} for the above special sequences and replaces them by what they stand for, returning the result as a string. This permits display of documentation that refers accurately to the -user's own customized key bindings. +user's own customized key bindings. By default, the key bindings are +given a special face @code{help-key-binding}, but if the optional +argument @var{no-face} is non-@code{nil}, the function doesn't add +this face to the produced string. @cindex advertised binding If a command has multiple bindings, this function normally uses the diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index f8dcca72cc0..395b88ed92c 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4306,12 +4306,12 @@ deleted unconditionally. Otherwise, the fate of the frame is determined by calling @code{frame-auto-hide-function} (see below) with that frame as sole argument. -If the third element of the @code{quit-restore} parameter is a list of -buffer, window start (@pxref{Window Start and End}), and point -(@pxref{Window Point}), and that buffer is still live, the buffer will -be displayed, and start and point set accordingly. If, in addition, -@var{window}'s buffer was temporarily resized, this function will also -try to restore the original height of @var{window}. +If the second element of the @code{quit-restore} parameter is a list +of a buffer, a window start (@pxref{Window Start and End}) and a +window point (@pxref{Window Point}), and that buffer is still live, +the buffer will be displayed, and start and point set accordingly. +If, in addition, @var{window}'s buffer was temporarily resized, this +function will also try to restore the original height of @var{window}. Otherwise, if @var{window} was previously used for displaying other buffers (@pxref{Window History}), the most recent buffer in that diff --git a/etc/NEWS.28 b/etc/NEWS.28 index 8e38c3690c1..eb65213ac2f 100644 --- a/etc/NEWS.28 +++ b/etc/NEWS.28 @@ -635,7 +635,9 @@ This works like 'C-u M-x apropos-command' but is more discoverable. *** Keybindings in 'help-mode' use the new 'help-key-binding' face. This face is added by 'substitute-command-keys' to any "\[command]" substitution. The return value of that function should consequently -be assumed to be a propertized string. +be assumed to be a propertized string. To prevent the function from +adding the 'help-key-binding' face, call 'substitute-command-keys' +with the new optional argument NO-FACE non-nil. Note that the new face will also be used in tooltips. When using the GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t. @@ -3273,11 +3275,11 @@ The user option 'repeat-exit-timeout' (default nil, which means forever) specifies the number of seconds of idle time after which to break the repetition chain automatically. -When user option 'repeat-keep-prefix' is non-nil (the default), the -prefix arg of the previous command is kept. This can be used to -e.g. reverse the window navigation direction with 'C-x o M-- o o' or -to set a new step with 'C-x { C-5 { { {', which will set the window -resizing step to 5 columns. +When user option 'repeat-keep-prefix' is non-nil, the prefix arg of +the previous command is kept. This can be used to e.g. reverse the +window navigation direction with 'C-x o M-- o o' or to set a new step +with 'C-x { C-5 { { {', which will set the window resizing step to 5 +columns. 'M-x describe-repeat-maps' will display a buffer showing which commands are repeatable in 'repeat-mode'. diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index ebce2ae3ddb..e06239a5c87 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1723,7 +1723,8 @@ COMMAND is a command to run, ECHO is the help-echo text, KEY is COMMAND's keybinding, STRING describes the binding." (propertize (or key (substitute-command-keys - (format "\\<calendar-mode-map>\\[%s] %s" command string))) + (format "\\<calendar-mode-map>\\[%s] %s" command string) + 'hands-off-my-face)) 'help-echo (format "mouse-1: %s" echo) 'mouse-face 'mode-line-highlight 'keymap (make-mode-line-mouse-map 'mouse-1 command))) diff --git a/lisp/help.el b/lisp/help.el index eb0a7822272..5114ddefba1 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1076,11 +1076,12 @@ strings done by `substitute-command-keys'." :version "29.1" :group 'help) -(defun substitute-command-keys (string) +(defun substitute-command-keys (string &optional no-face) "Substitute key descriptions for command names in STRING. Each substring of the form \\\\=[COMMAND] is replaced by either a keystroke sequence that invokes COMMAND, or \"M-x COMMAND\" if COMMAND -is not on any keys. Keybindings will use the face `help-key-binding'. +is not on any keys. Keybindings will use the face `help-key-binding', +unless the optional argument NO-FACE is non-nil. Each substring of the form \\\\=`KEYBINDING' will be replaced by KEYBINDING and use the `help-key-binding' face. @@ -1177,21 +1178,27 @@ Otherwise, return a new string." (let ((op (point))) (insert "M-x ") (goto-char (+ end-point 3)) - (add-text-properties op (point) - '( face help-key-binding - font-lock-face help-key-binding)) + (or no-face + (add-text-properties + op (point) + '( face help-key-binding + font-lock-face help-key-binding))) (delete-char 1)) ;; Function is on a key. (delete-char (- end-point (point))) - (let ((key (help--key-description-fontified key))) - (insert (if (and help-link-key-to-documentation - help-buffer-under-preparation - (functionp fun)) - ;; The `fboundp' fixes bootstrap. - (if (fboundp 'help-mode--add-function-link) - (help-mode--add-function-link key fun) - key) - key)))))) + + (insert + (if no-face + (key-description key) + (let ((key (help--key-description-fontified key))) + (if (and help-link-key-to-documentation + help-buffer-under-preparation + (functionp fun)) + ;; The `fboundp' fixes bootstrap. + (if (fboundp 'help-mode--add-function-link) + (help-mode--add-function-link key fun) + key) + key))))))) ;; 1D. \{foo} is replaced with a summary of the keymap ;; (symbol-value foo). ;; \<foo> just sets the keymap used for \[cmd]. diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index dfd4e5b8291..4ac0100746e 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -748,7 +748,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." [Q 手] [W 田] [E 水] [R 口] [T 廿] [Y 卜] [U 山] [I 戈] [O 人] [P 心] - [A 日] [S 尸] [D 木] [F 火] [G 土] [H 竹] [J 十] [L 中] + [A 日] [S 尸] [D 木] [F 火] [G 土] [H 竹] [J 十] [K 大] [L 中] [Z ] [X 難] [C 金] [V 女] [B 月] [N 弓] [M 一] diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 001989e39ad..70c55c01dd7 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -203,7 +203,7 @@ by `grep-compute-defaults'; to change the default value, use :version "22.1") (defcustom grep-files-aliases - '(("all" . "* .[!.]* ..?*") ;; Don't match `..'. See bug#22577 + '(("all" . "* .*") ("el" . "*.el") ("ch" . "*.[ch]") ("c" . "*.c") diff --git a/src/xdisp.c b/src/xdisp.c index 0ff6286af74..813858422d4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18082,10 +18082,11 @@ compute_window_start_on_continuation_line (struct window *w) row, DEFAULT_FACE_ID); reseat_at_previous_visible_line_start (&it); - /* If the line start is "too far" away from the window start, - say it takes too much time to compute a new window start. - Also, give up if the line start is after point, as in that - case point will not be visible with any window start we + /* Give up (by not using the code in the block below) and say it + takes too much time to compute a new window start, if the + line start is "too far" away from the window start. Also, + give up if the line start is after point, as in that case + point will not be visible with any window start we compute. */ if (IT_CHARPOS (it) <= PT || (CHARPOS (start_pos) - IT_CHARPOS (it) |