emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/corfu 218315a12a 1/2: popupinfo: Remap beg/end-other-wi


From: ELPA Syncer
Subject: [elpa] externals/corfu 218315a12a 1/2: popupinfo: Remap beg/end-other-window (#270)
Date: Sun, 4 Dec 2022 14:57:25 -0500 (EST)

branch: externals/corfu
commit 218315a12ad3e01545a52784785457140af54934
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    popupinfo: Remap beg/end-other-window (#270)
---
 extensions/corfu-popupinfo.el | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index c55ea1f700..264d5bb122 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -119,6 +119,8 @@ popup can be requested manually via 
`corfu-popupinfo-toggle',
     (define-key map "\M-t" #'corfu-popupinfo-toggle)
     (define-key map [remap scroll-other-window] #'corfu-popupinfo-scroll-up)
     (define-key map [remap scroll-other-window-down] 
#'corfu-popupinfo-scroll-down)
+    (define-key map [remap end-of-buffer-other-window] 
#'corfu-popupinfo-end-of-buffer)
+    (define-key map [remap beginning-of-buffer-other-window] 
#'corfu-popupinfo-beginning-of-buffer)
     map)
   "Additional keymap activated in popupinfo mode.")
 
@@ -378,11 +380,31 @@ form (X Y WIDTH HEIGHT DIR)."
   "Clear the info popup buffer content and hide it."
   (corfu--hide-frame corfu-popupinfo--frame))
 
+(defun corfu-popupinfo-end-of-buffer (&optional n)
+  "Scroll text of info popup window to its end.
+
+If arg N is omitted or nil, scroll to end.  If a numerical value,
+put point N/10 of the way from the end.  If the info popup is not
+visible, the other window is moved to beginning or end."
+  (interactive "P")
+  (if (corfu-popupinfo--visible-p)
+      (with-selected-frame corfu-popupinfo--frame
+        (with-current-buffer " *corfu-popupinfo*"
+          (end-of-buffer n)))
+    (end-of-buffer-other-window n)))
+
+(defun corfu-popupinfo-beginning-of-buffer (&optional n)
+  "Scroll text of info popup window to beginning of buffer.
+
+See `corfu-popupinfo-end-of-buffer' for more details."
+  (interactive "P")
+  (corfu-popupinfo-end-of-buffer (- 10 (if (numberp n) n 0))))
+
 (defun corfu-popupinfo-scroll-up (&optional n)
   "Scroll text of info popup window upward N lines.
 
 If ARG is omitted or nil, scroll upward by a near full screen.
-See `scroll-up' for details. If the info popup is not visible,
+See `scroll-up' for details.  If the info popup is not visible,
 the other window is scrolled."
   (interactive "p")
   (if (corfu-popupinfo--visible-p)



reply via email to

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