[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bufferlo 3b8a134f10 131/192: Support define-ibuffer-op
From: |
ELPA Syncer |
Subject: |
[elpa] externals/bufferlo 3b8a134f10 131/192: Support define-ibuffer-op opstring prompt functions |
Date: |
Sat, 19 Apr 2025 15:58:14 -0400 (EDT) |
branch: externals/bufferlo
commit 3b8a134f10fe7a156da3653572879fbf464dcd0f
Author: shipmints <shipmints@gmail.com>
Commit: shipmints <shipmints@gmail.com>
Support define-ibuffer-op opstring prompt functions
For Emacs < 31, use static strings.
For Emacs > 30, use context-sensitive prompt functions.
---
bufferlo.el | 52 +++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 39 insertions(+), 13 deletions(-)
diff --git a/bufferlo.el b/bufferlo.el
index b620a57e5b..7d14364f7b 100644
--- a/bufferlo.el
+++ b/bufferlo.el
@@ -1887,19 +1887,45 @@ The parameters OTHER-WINDOW-P NOSELECT SHRINK are
passed to `ibuffer'."
(ibuffer other-window-p name '((bufferlo-orphan-buffers . nil))
noselect shrink)))
-(define-ibuffer-op ibuffer-do-bufferlo-remove ()
- "Remove marked buffers from bufferlo's local buffer list."
- (
- :active-opstring "remove from bufferlo locals" ; prompt
- :opstring "removed from bufferlo locals:" ; success
- :modifier-p t
- :dangerous t
- :complex t
- :after (ibuffer-update nil t)
- )
- (when bufferlo-mode
- (bufferlo-remove buf)
- t))
+(eval-when-compile
+ (if (< emacs-major-version 31)
+ (define-ibuffer-op ibuffer-do-bufferlo-remove ()
+ "Remove marked buffers from bufferlo's local buffer list."
+ (
+ :active-opstring "remove from bufferlo locals" ; prompt
+ :opstring "removed from bufferlo locals:" ; success
+ :modifier-p t
+ :dangerous t
+ :complex t
+ :after (ibuffer-update nil t)
+ )
+ (when bufferlo-mode
+ (bufferlo-remove buf)
+ t))
+
+ (defun bufferlo--ibuffer-do-bufferlo-remove-prompt (op)
+ "`ibuffer' prompt helper for OP."
+ (let ((bookmark-name (bufferlo--current-bookmark-name)))
+ (format "%s from %slocals:" op
+ (if bookmark-name
+ (format "bufferlo bookmark \"%s\" " bookmark-name)
+ ""))))
+
+ (define-ibuffer-op ibuffer-do-bufferlo-remove ()
+ "Remove marked buffers from bufferlo\'s local buffer list."
+ (
+ :active-opstring (lambda ()
+ (bufferlo--ibuffer-do-bufferlo-remove-prompt "remove"))
+ :opstring (lambda ()
+ (bufferlo--ibuffer-do-bufferlo-remove-prompt "removed"))
+ :modifier-p t
+ :dangerous t
+ :complex t
+ :after (ibuffer-update nil t)
+ )
+ (when bufferlo-mode
+ (bufferlo-remove buf)
+ t))))
(when bufferlo-ibuffer-bind-keys
(define-key ibuffer-mode-map "-" #'ibuffer-do-bufferlo-remove))
- [elpa] externals/bufferlo 1aaac07568 068/192: Refine session frameset-restore and frame geometry handling, (continued)
- [elpa] externals/bufferlo 1aaac07568 068/192: Refine session frameset-restore and frame geometry handling, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo e416f21e4f 089/192: Address bufferlo--bookmark-get-duplicate-policy flymake missing docstring, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 325e7d3477 088/192: Improve messages to include relevant bookmark name, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 65d0cdedd5 103/192: Remove unused variable. Move things to silence the compiler., ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 09702d8e79 097/192: Make the auto-save timer an idle timer, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo f8f269035f 102/192: Add bufferlo-set-list-interactive and docs, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 4e8ff83370 109/192: Remove vestigial message in set handler, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo e6e9b3a030 114/192: Change default value for bufferlo-kill-modified-buffers-policy, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo dcb2643afc 117/192: Rename bufferlo-bookmark-{save, load, close}-curr, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo f2e3d2d2a0 122/192: Clarify docstrings saying if rather than when, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 3b8a134f10 131/192: Support define-ibuffer-op opstring prompt functions,
ELPA Syncer <=
- [elpa] externals/bufferlo 43aecf49d5 132/192: Support inhibiting bookmark-insert, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 73c3d1df91 139/192: Improve 'bufferlo-mode-line' and mode on/off behavior, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo f897ace31c 140/192: Mention bookmark list type column width, and shell-mode bookmarks, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 6254d49b67 151/192: Usability improvements to bufferlo-set-list-interactive, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 8228953344 157/192: Ignore tab-bar--tab advice on Emacs 31, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 82d79b1786 170/192: Fix buffer renaming during restoration, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo cb215f5e98 179/192: Add bufferlo-bookmark-tab-failed-buffer-policy, ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo 362de728ab 003/192: WIP., ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo c13fc1094e 022/192: bufferlo-prefer-local-buffers 'tabs sets switch-to-prev-buffer-skip., ELPA Syncer, 2025/04/19
- [elpa] externals/bufferlo b626c89127 017/192: Rely only on tab numbers or names, not references to ephemeral tab objects. Cures a couple of issues with saving/closing., ELPA Syncer, 2025/04/19