[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/popper 032e75bf08 063/102: Added feature to show popups
From: |
ELPA Syncer |
Subject: |
[elpa] externals/popper 032e75bf08 063/102: Added feature to show popups in echo area when cycling. |
Date: |
Fri, 8 Sep 2023 15:58:54 -0400 (EDT) |
branch: externals/popper
commit 032e75bf086b08cde408e032ee1565e01e45eee1
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Added feature to show popups in echo area when cycling.
---
popper.el | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 60 insertions(+), 4 deletions(-)
diff --git a/popper.el b/popper.el
index 4daa43eb4b..70570f0379 100644
--- a/popper.el
+++ b/popper.el
@@ -197,6 +197,33 @@ the frame height.
:type '(choice (integer :tag "Height in chars")
(function :tag "Height function")))
+(defcustom popper-open-popup-hook nil
+ "Hook run when a popup is opened.
+
+Each function in the hook is called with the opened popup-buffer
+as current."
+ :type 'hook
+ :group 'popper)
+
+(defcustom popper-message-transform-function nil
+ "Function to transform buffer names.
+
+This is called on buffer-names displayed by `popper-echo-names'.
+
+This function should accept a
+ string (the buffer name) and return a transformed string."
+ :type 'function
+ :group 'popper)
+
+(defface popper-echo-area
+ '((t :inverse-video t
+ :weight bold))
+ "Echo area face for opened popup.")
+
+(defface popper-echo-area-buried
+ '((t :inherit shadow))
+ "Echo area face for buried popups.")
+
(defvar popper--reference-names nil
"List of buffer names whose windows are treated as popups.")
@@ -344,7 +371,7 @@ Each element of the alist is a cons cell of the form
(window . buffer)."
(cl-set-difference popper-open-popup-alist
open-popups :key #'cdr))))
(setq popper-open-popup-alist (nreverse open-popups))
;; First remove all open popups that have been opened
- (cl-loop for (win . buf) in open-popups do
+ (cl-loop for (_ . buf) in open-popups do
(let* ((group-name (when popper-group-function
(with-current-buffer buf (funcall
popper-group-function))))
(group-popups (cdr (assoc group-name
popper-buried-popup-alist 'equal))))
@@ -425,9 +452,11 @@ a popup buffer to open."
(if-let* ((new-popup (pop (alist-get identifier popper-buried-popup-alist
nil 'remove 'equal)))
(buf (cdr new-popup)))
- (if (buffer-live-p buf)
- (display-buffer buf)
- (popper-open-latest))
+ (if (not (buffer-live-p buf))
+ (popper-open-latest)
+ (display-buffer buf)
+ (with-current-buffer buf
+ (run-hooks 'popper-open-popup-hook)))
(message no-popup-msg)))))
(defun popper--delete-popup (win)
@@ -629,6 +658,33 @@ If BUFFER is not specified act on the current buffer
instead."
(dolist (entry popper-reference-buffers nil)
(popper--insert-type entry)))
+;; Notify in echo area:
+(defun popper-echo-names ()
+ "Show popup list in echo area when cycling popups."
+ (let* ((group (when popper-group-function
+ (funcall popper-group-function)))
+ (buried-popups (thread-last (alist-get group
popper-buried-popup-alist nil nil 'equal)
+ (mapcar #'cdr)
+ (cl-remove-if-not #'buffer-live-p)
+ (mapcar #'buffer-name)))
+ (open-popup (buffer-name))
+ (popup-strings
+ (cl-reduce #'concat
+ (cons
+ (propertize
+ (funcall (or popper-message-transform-function
#'identity)
+ open-popup)
+ 'face 'popper-echo-area)
+ (mapcar (lambda (b) (propertize
+ (concat ", " (funcall (or
popper-message-transform-function
+ #'identity)
+ b))
+ 'face 'popper-echo-area-buried))
+ buried-popups)))))
+ (if group
+ (message "Group (%s): %s" group popup-strings)
+ (message "Popups: %s" popup-strings))))
+
;;;###autoload
(define-minor-mode popper-mode
"Toggle Popper mode. When enabled, treat certain buffer
- [elpa] externals/popper b32abcba49 030/102: Fixed popup display of newly created popup buffers, (continued)
- [elpa] externals/popper b32abcba49 030/102: Fixed popup display of newly created popup buffers, ELPA Syncer, 2023/09/08
- [elpa] externals/popper c465e0de24 007/102: Added technical notes to README, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 7f61e916ce 037/102: Child frame support for popper (ongoing), ELPA Syncer, 2023/09/08
- [elpa] externals/popper 767d4ffd0e 039/102: Modified README for clarity, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 096078acea 040/102: Add `perspective`-based grouping function (#5), ELPA Syncer, 2023/09/08
- [elpa] externals/popper 0e16eb9b86 050/102: Tweaks to readme, major-mode identification code, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 0127de7161 052/102: Updated Readme for readability + handle project-current when nil, ELPA Syncer, 2023/09/08
- [elpa] externals/popper a29c603acd 055/102: Merge branch 'feature' of github.com:karthink/popper into feature, ELPA Syncer, 2023/09/08
- [elpa] externals/popper b9673ae612 059/102: Fix popper-window-height usage, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 9b1cff1b57 061/102: Popups are updated correctly now, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 032e75bf08 063/102: Added feature to show popups in echo area when cycling.,
ELPA Syncer <=
- [elpa] externals/popper 8d2b664465 067/102: Popper-echo will use up to 2 minibuffer lines by default, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 9e368e1d20 072/102: Clarify: Does not support popups in new frames, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 6a2ddcb354 073/102: Added tip to match shell buffers, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 2650056e0e 075/102: Dispatch action control with popper-echo, ELPA Syncer, 2023/09/08
- [elpa] externals/popper a50edecacf 080/102: Fix popper-mode-line for simple-modeline, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 3212241316 083/102: Fix #29: Error while modifying mode line. (#30), ELPA Syncer, 2023/09/08
- [elpa] externals/popper 50568b8af2 090/102: popper.el: Fix child-frame resetting popups, ELPA Syncer, 2023/09/08
- [elpa] externals/popper cc48e01219 091/102: Sort open popups by display time., ELPA Syncer, 2023/09/08
- [elpa] externals/popper f0038228eb 093/102: Silence compiler warnings on Emacs 29 (#44), ELPA Syncer, 2023/09/08
- [elpa] externals/popper 44752c5121 020/102: Better test for removing from display-buffer-alist, ELPA Syncer, 2023/09/08