[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/popper 096078acea 040/102: Add `perspective`-based grou
From: |
ELPA Syncer |
Subject: |
[elpa] externals/popper 096078acea 040/102: Add `perspective`-based grouping function (#5) |
Date: |
Fri, 8 Sep 2023 15:58:52 -0400 (EDT) |
branch: externals/popper
commit 096078acea59df6109906641e9dd44893ed4f6a2
Author: Walheimat <krister.schuchardt@gmail.com>
Commit: GitHub <noreply@github.com>
Add `perspective`-based grouping function (#5)
* add function to group using perspective
* update readme
* space indent
Co-authored-by: Walheimat <krister.schuchardt@theventury.com>
---
README.org | 3 ++-
popper.el | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index 7261931b77..3ba03c4fb5 100644
--- a/README.org
+++ b/README.org
@@ -104,7 +104,7 @@ To get started, customize this variable:
** Grouping popups by context
Popper can group popups by "context", so that the popups available for display
are limited to those that are relevant to the context in which
=popper-toggle-latest= or =popper-cycle= is called. For example, when cycling
popups from a project buffer, you may only want to see the popups (REPLs, help
buffers and compilation output, say) that were spawned from buffers in that
project. This is intended to approximate DWIM behavior, so that the most
relevant popup in any context is never more [...]
-Built in contexts include projects as defined in Emacs' built in =project.el=
and =projectile=, as well as the default directory of a buffer. To set this,
customize =popper-group-function= or use one of
+Built in contexts include projects as defined in Emacs' built in =project.el=
and =projectile=, using =perspective= names, as well as the default directory
of a buffer. To set this, customize =popper-group-function= or use one of
#+BEGIN_SRC emacs-lisp
(setq popper-group-function #'popper-group-by-project) ; project.el projects
@@ -115,6 +115,7 @@ Built in contexts include projects as defined in Emacs'
built in =project.el= an
; project root, with
; fall back to
; default-directory
+ (setq popper-group-function #'popper-group-by-perspective) ; group by
perspective
#+END_SRC
You can also provide a custom function that takes no arguments, is executed in
the context of a popup buffer and returns a string or symbol that represents
the group/context it belongs to. This function will group all popups under the
symbol =my-popup-group=:
diff --git a/popper.el b/popper.el
index 27d26db399..d9a5048c22 100644
--- a/popper.el
+++ b/popper.el
@@ -73,6 +73,7 @@
(declare-function project-root "project")
(declare-function project-current "project")
(declare-function projectile-project-root "projectile")
+(declare-function persp-current-name "perspective")
(defvar popper-mode)
@@ -151,12 +152,14 @@ Built-in choices include
`popper-group-by-directory': Return project root or default directory.
`popper-group-by-project': Return project root using project.el.
-`popper-group-by-projectile': Return project root using projectile."
+`popper-group-by-projectile': Return project root using projectile.
+`popper-group-by-perspective': Return perspective name."
:group 'popper
:type '(choice
(const :tag "Don't group popups" nil)
(const :tag "Group by project (project.el)" popper-group-by-project)
(const :tag "Group by project (projectile)"
popper-group-by-projectile)
+ (const :tag "Group by perspective" popper-group-by-perspective)
(const :tag "Group by directory" popper-group-by-directory)
(function :tag "Custom function")))
@@ -243,6 +246,16 @@ This returns the project root found using the projectile
package."
`popper-group-function'"))
(projectile-project-root))
+(defun popper-group-by-perspective ()
+ "Return an identifier to group popups.
+
+This returns the name of the perspective."
+ (unless (fboundp 'persp-current-name)
+ (user-error "Cannot find perspective name to group popups.
+ Please install `perspective' or customize
+ `popper-group-function'"))
+ (persp-current-name))
+
(defun popper-find-popups (test-buffer-list)
"Return an alist corresponding to popups in TEST-BUFFER-LIST.
- [elpa] externals/popper 7afd502b3b 068/102: Fixed popper-echo display when the group is a symbol, (continued)
- [elpa] externals/popper 7afd502b3b 068/102: Fixed popper-echo display when the group is a symbol, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 667dcdd063 069/102: Added badge, ELPA Syncer, 2023/09/08
- [elpa] externals/popper 4d58a6dbba 076/102: Handle unbound dispatch keys in popper-echo, ELPA Syncer, 2023/09/08
- [elpa] externals/popper d5ab9b2c41 077/102: Popup without selecting (#17), ELPA Syncer, 2023/09/08
- [elpa] externals/popper a93ff38ab6 098/102: popper: Assign copyright to FSF, ELPA Syncer, 2023/09/08
- [elpa] externals/popper fd39948875 024/102: Removed redundant info from documentation, ELPA Syncer, 2023/09/08
- [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 <=
- [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, 2023/09/08
- [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