branch: externals/embark commit 2941f2ea36d61c1a84c3f79ebe47d604c9a92b5d Merge: 923d0ec52e 926f1028df Author: Omar AntolĂn Camarena <omar.anto...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #757 from minad/buffer-at-point Add embark-target-buffer-at-point --- embark.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/embark.el b/embark.el index 913f8bdd5c..61350d68cf 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)