From 0754173c923a1888a1b18b4c6c5d1dc72e6cc6af Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Thu, 22 Dec 2022 18:23:34 +0100 Subject: [PATCH 1/6] ; Fix docstring * lisp/textmodes/reftex-vars.el (reftex-allow-detached-macro-args): Fix macro name in docstring. --- lisp/textmodes/reftex-vars.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index ee94cc5d693..51dedddf3a5 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -2096,8 +2096,8 @@ may require a restart of Emacs in order to become effective." (defcustom reftex-allow-detached-macro-args nil "Non-nil means, allow arguments of macros to be detached by whitespace. -When this is t, `aaa' will be considered as argument of \\bb in the following -construct: \\bbb [xxx] {aaa}." +When this is t, `aaa' will be considered as argument of \\bbb in +the following construct: \\bbb [xxx] {aaa}." :group 'reftex-miscellaneous-configurations :type 'boolean) From baaa9f42e574aa5eceeb4b9354a42ccb8ff1969a Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 20 Dec 2022 15:53:19 -0700 Subject: [PATCH 2/6] vc-git-checkin: Don't try to apply an empty patch * lisp/vc/vc-git.el (vc-git-checkin): Don't try to apply an empty patch to the index, because in that case 'git apply' fails. (cherry picked from commit 1424342225ef5b18c630364dd88e004f4ebb1c7f) --- lisp/vc/vc-git.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b5959d535c0..afaaa44e908 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1041,12 +1041,13 @@ It is based on `log-edit-mode', and has Git-specific extensions." (string-replace file-diff "" vc-git-patch-string)) (user-error "Index not empty")) (setq pos (point)))))) - (let ((patch-file (make-nearby-temp-file "git-patch"))) - (with-temp-file patch-file - (insert vc-git-patch-string)) - (unwind-protect - (vc-git-command nil 0 patch-file "apply" "--cached") - (delete-file patch-file)))) + (unless (string-empty-p vc-git-patch-string) + (let ((patch-file (make-nearby-temp-file "git-patch"))) + (with-temp-file patch-file + (insert vc-git-patch-string)) + (unwind-protect + (vc-git-command nil 0 patch-file "apply" "--cached") + (delete-file patch-file))))) (cl-flet ((boolean-arg-fn (argument) (lambda (value) (when (equal value "yes") (list argument))))) From 5a34e7c86ca1bfd5bc6ae362ae25c02d21ec0315 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 22 Dec 2022 13:38:48 -0700 Subject: [PATCH 3/6] ; * admin/notes/git-workflow: Adding "Backport:" is optional. --- admin/notes/git-workflow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index 265a106bad5..717fc550776 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -70,7 +70,7 @@ commit 958b768a6534ae6e77a8547a56fc31b46b63710b cd ~/emacs/emacs-28 git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b -and add "Backport:" to the commit string. Then +and optionally add "Backport:" to the commit string. Then git push From a0738e8ad1384e40c8eebca41b16a0b5125d625b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Dec 2022 13:32:18 +0200 Subject: [PATCH 4/6] ; * etc/NEWS: Announce the new behavior of 'C-h f'. (Bug#60252) --- etc/NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 0e844596347..5ce3e21e8bf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -265,6 +265,16 @@ controlled by the internal Emacs machinery led to low-contrast faces in common default setups. Emacs now uses the same 'region' face on Gtk and non-Gtk setups. +--- +** 'C-h f' and 'C-h x' may now require confirmation when you press RET. +If the text in the minibuffer cannot be completed to a single function +or command, typing RET will not automatically complete to the shortest +candidate, but will instead ask for confirmation. Typing TAB will +complete as much as possible, and another TAB will show all the +possible completions. This allows you to insist on the functions name +even if Help doesn't appear to know about it, by confirming with a +second RET. + ** Dired --- From 6dda2106ece7c307ed5c0a6cb892e736516effeb Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Dec 2022 14:37:04 +0200 Subject: [PATCH 5/6] ; Improve documentation of "C-x @" * doc/emacs/custom.texi (Modifier Keys): Document how to enter Shift, Control, and Meta using "C-x @". * lisp/simple.el (function-key-map): Add commentary to "C-x @" bindings to make them easier to discover. --- doc/emacs/custom.texi | 6 +++++- lisp/simple.el | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index aaf41d2aef1..f75512a00e9 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1990,13 +1990,17 @@ to assign meanings to key bindings that use these modifiers. The modifier bits are labeled as @samp{s-}, @samp{H-} and @samp{A-} respectively. +@cindex modifier keys unsupported by keyboard Even if your keyboard lacks these additional modifier keys, you can -enter it using @kbd{C-x @@}: @kbd{C-x @@ h} adds the Hyper flag to +enter them using @kbd{C-x @@}: @kbd{C-x @@ h} adds the Hyper flag to the next character, @kbd{C-x @@ s} adds the Super flag, and @kbd{C-x @@ a} adds the Alt flag. For instance, @kbd{C-x @@ h C-a} is a way to enter @kbd{Hyper-Control-a}. (Unfortunately, there is no way to add two modifiers by using @kbd{C-x @@} twice for the same character, because the first one goes to work on the @kbd{C-x}.) +You can similarly enter the Shift, Control, and Meta modifiers by +using @kbd{C-x @ S}, @kbd{C-x @ c}, and @kbd{C-x @ m}, respectively, +although this is rarely needed. @node Function Keys @subsection Rebinding Function Keys diff --git a/lisp/simple.el b/lisp/simple.el index f85428ca740..4551b749d56 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -10053,6 +10053,8 @@ PREFIX is the string that represents this modifier in an event type symbol." event-type (cons event-type (cdr event))))))) +;; This is what makes "C-x @" followed by [hsmaSc] work even though +;; you won't find any (define-key ctl-x-map "@" ...) binding. (define-key function-key-map [?\C-x ?@ ?h] 'event-apply-hyper-modifier) (define-key function-key-map [?\C-x ?@ ?s] 'event-apply-super-modifier) (define-key function-key-map [?\C-x ?@ ?m] 'event-apply-meta-modifier) From eccb813a943f4b6898cbe241c636c2ba5e63d271 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Dec 2022 16:41:08 +0200 Subject: [PATCH 6/6] Fix "C-h k" in recursive minibuffers * lisp/subr.el (event--posn-at-point): Leave POSN alone if it doesn't have at least 6 members. This follows more faithfully what 'event-start' and 'event-end' did before they started using this function, see commit c1cead89f5f. Call posn-at-point with the minibuffer-window when in the minibuffer. (Bug#60252) --- lisp/subr.el | 22 ++++++++++++---------- src/window.c | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index e142eaa8104..a5e66de27de 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1576,16 +1576,18 @@ in the current Emacs session, then this function may return nil." ;; Use `window-point' for the case when the current buffer ;; is temporarily switched to some other buffer (bug#50256) (let* ((pos (window-point)) - (posn (posn-at-point pos))) - (if (null posn) ;; `pos' is "out of sight". - (list (selected-window) pos '(0 . 0) 0) - ;; If `pos' is inside a chunk of text hidden by an `invisible' - ;; or `display' property, `posn-at-point' returns the position - ;; that *is* visible, whereas `event--posn-at-point' is used - ;; when we have a keyboard event, whose position is `point' even - ;; if that position is invisible. - (setf (nth 5 posn) pos) - posn))) + (posn (posn-at-point pos (if (minibufferp (current-buffer)) + (minibuffer-window))))) + (cond ((null posn) ;; `pos' is "out of sight". + (setq posn (list (selected-window) pos '(0 . 0) 0))) + ;; If `pos' is inside a chunk of text hidden by an `invisible' + ;; or `display' property, `posn-at-point' returns the position + ;; that *is* visible, whereas `event--posn-at-point' is used + ;; when we have a keyboard event, whose position is `point' even + ;; if that position is invisible. + ((> (length posn) 5) + (setf (nth 5 posn) pos))) + posn)) (defun event-start (event) "Return the starting position of EVENT. diff --git a/src/window.c b/src/window.c index 90fa6ac2dfe..cd43919a7d8 100644 --- a/src/window.c +++ b/src/window.c @@ -1649,7 +1649,8 @@ check_window_containing (struct window *w, void *user_data) set *PART to the id of that element. If there is no window under X, Y return nil and leave *PART - unmodified. TOOL_BAR_P means detect tool-bar windows. + unmodified. TOOL_BAR_P means detect tool-bar windows, and + TAB_BAR_P means detect tab-bar windows. This function was previously implemented with a loop cycling over windows with Fnext_window, and starting with the frame's selected