emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8fcedd81ab 2/2: Merge from origin/emacs-29


From: Stefan Kangas
Subject: master 8fcedd81ab 2/2: Merge from origin/emacs-29
Date: Sat, 24 Dec 2022 00:47:00 -0500 (EST)

branch: master
commit 8fcedd81ab665a89f03d664a3c71308b5980604a
Merge: ed0414de60 9a3b08061f
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Merge from origin/emacs-29
    
    9a3b08061fe Fix ruby-mode.el local command injection vulnerability (b...
    4b44a395b3c ; * etc/NEWS: Fix typos.
    458e1752701 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
    eccb813a943 Fix "C-h k" in recursive minibuffers
    6dda2106ece ; Improve documentation of "C-x @"
    a0738e8ad13 ; * etc/NEWS: Announce the new behavior of 'C-h f'.  (Bug...
    86b11981b0d Update Tramp version (don't merge with master)
    
    # Conflicts:
    #       etc/NEWS
---
 doc/emacs/custom.texi       |  6 +++++-
 etc/NEWS.29                 | 10 ++++++++++
 lisp/progmodes/ruby-mode.el |  2 +-
 lisp/simple.el              |  2 ++
 lisp/subr.el                | 22 ++++++++++++----------
 src/window.c                |  3 ++-
 6 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index aaf41d2aef..f75512a00e 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/etc/NEWS.29 b/etc/NEWS.29
index 0e84459634..6f2f74fab4 100644
--- a/etc/NEWS.29
+++ b/etc/NEWS.29
@@ -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
 
 ---
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 1f3e9b6ae7..a4aa61905e 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1899,7 +1899,7 @@ or `gem' statement around point."
       (setq feature-name (read-string "Feature name: " init))))
   (let ((out
          (substring
-          (shell-command-to-string (concat "gem which " feature-name))
+          (shell-command-to-string (concat "gem which " (shell-quote-argument 
feature-name)))
           0 -1)))
     (if (string-match-p "\\`ERROR" out)
         (user-error "%s" out)
diff --git a/lisp/simple.el b/lisp/simple.el
index f85428ca74..4551b749d5 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)
diff --git a/lisp/subr.el b/lisp/subr.el
index 4fa63a1f3c..fff4c88ccf 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 90fa6ac2df..cd43919a7d 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]