summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar AntolĂ­n Camarena <omar.antolin@gmail.com>2025-05-30 13:48:42 -0600
committerGitHub <noreply@github.com>2025-05-30 13:48:42 -0600
commit2941f2ea36d61c1a84c3f79ebe47d604c9a92b5d (patch)
treecbdd1cd4c6d96471a623015ee4760fbcc601cb10
parent923d0ec52e2e3e0ae44e497c31c7888e87d08a8f (diff)
parent926f1028dff0ca0dc4adcc24436124f579fc0ec3 (diff)
Merge pull request #757 from minad/buffer-at-point
Add embark-target-buffer-at-point
-rw-r--r--embark.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/embark.el b/embark.el
index 913f8bd..61350d6 100644
--- a/embark.el
+++ b/embark.el
@@ -176,6 +176,7 @@ or a list of such symbols."
embark-target-email-at-point
embark-target-url-at-point
embark-target-file-at-point
+ embark-target-buffer-at-point
embark-target-custom-variable-at-point
embark-target-identifier-at-point
embark-target-guess-file-at-point
@@ -756,6 +757,14 @@ following exceptions:
(when file
`(file ,(abbreviate-file-name (expand-file-name file)) ,@bounds))))
+(defun embark-target-buffer-at-point ()
+ "Target buffer at point in Ibuffer or the buffer menu."
+ (when-let ((bol (pos-bol))
+ (buf (or (car (get-text-property bol 'ibuffer-properties))
+ (get-text-property bol 'tabulated-list-id)))
+ ((buffer-live-p buf)))
+ `(buffer ,(buffer-name buf) ,bol . ,(pos-eol))))
+
(defun embark-target-package-at-point ()
"Target the package on the current line in a packages buffer."
(when (derived-mode-p 'package-menu-mode)