[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 eccb813a94: Fix "C-h k" in recursive minibuffers
From: |
Eli Zaretskii |
Subject: |
emacs-29 eccb813a94: Fix "C-h k" in recursive minibuffers |
Date: |
Fri, 23 Dec 2022 09:43:29 -0500 (EST) |
branch: emacs-29
commit eccb813a943f4b6898cbe241c636c2ba5e63d271
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
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 e142eaa810..a5e66de27d 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 eccb813a94: Fix "C-h k" in recursive minibuffers,
Eli Zaretskii <=