[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 400d56f 319/399: counsel.el (counsel-open-buffer-file-exte
From: |
Oleh Krehel |
Subject: |
[elpa] master 400d56f 319/399: counsel.el (counsel-open-buffer-file-externally): New function |
Date: |
Sat, 20 Jul 2019 14:57:48 -0400 (EDT) |
branch: master
commit 400d56f3caf7e747cbbb6789929ecbbf2a3380bd
Author: Damien Cassou <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-open-buffer-file-externally): New function
Bind "x" when switching buffers to open associated file externally.
Fixes #2108
---
counsel.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/counsel.el b/counsel.el
index df0777d..d01bb5b 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5305,6 +5305,22 @@ in the current window."
:unwind #'counsel--switch-buffer-unwind
:update-fn 'counsel--switch-buffer-update-fn))
+(defun counsel-open-buffer-file-externally (buffer)
+ "Open the file associated with BUFFER with an external program."
+ (when (zerop (length buffer))
+ (user-error "Can't open that"))
+ (let* ((virtual (assoc buffer ivy--virtual-buffers))
+ (filename (if virtual
+ buffer
+ (buffer-file-name (get-buffer buffer)))))
+ (unless filename
+ (user-error "Can't open `%s' externally" buffer))
+ (counsel-locate-action-extern (expand-file-name filename))))
+
+(ivy-add-actions
+ 'ivy-switch-buffer
+ '(("x" counsel-open-buffer-file-externally "open externally")))
+
;;** `counsel-compile'
(defvar counsel-compile-history nil
"History for `counsel-compile'.
- [elpa] master 7d46450 311/399: Add more information about the collection argument in `ivy-read`., (continued)
- [elpa] master 7d46450 311/399: Add more information about the collection argument in `ivy-read`., Oleh Krehel, 2019/07/20
- [elpa] master 676a8ee 318/399: swiper.el (swiper-isearch-current-match): Remove unused face, Oleh Krehel, 2019/07/20
- [elpa] master ba626e7 317/399: ivy.el (ivy-next-history-element): Use minibuffer-default for dired-dwim-target, Oleh Krehel, 2019/07/20
- [elpa] master 51e765e 316/399: ivy.el (ivy-partial): Return nil when comletion was not updated, Oleh Krehel, 2019/07/20
- [elpa] master 16d2268 320/399: Fix ivy-push/switch-view windows layout, Oleh Krehel, 2019/07/20
- [elpa] master d260c48 322/399: swiper.el: Obey search-invisible, Oleh Krehel, 2019/07/20
- [elpa] master de8842e 323/399: Add ivy-switch-buffer-map to counsel-switch-buffer, Oleh Krehel, 2019/07/20
- [elpa] master 0d87297 326/399: counsel.el (counsel-open-buffer-file-externally): Cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 7defba2 327/399: ivy.el (ivy-avy): Fix when there's a scroll, Oleh Krehel, 2019/07/20
- [elpa] master 07c65b3 325/399: ivy.el (ivy--set-index-dynamic-collection): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 400d56f 319/399: counsel.el (counsel-open-buffer-file-externally): New function,
Oleh Krehel <=
- [elpa] master 704b1de 328/399: ivy.el (ivy-avy): Allow to scroll with "C-v" and "M-v", Oleh Krehel, 2019/07/20
- [elpa] master 7183491 332/399: ivy.el (ivy--minibuffer-setup): Avoid extra call to ivy--exhibit, Oleh Krehel, 2019/07/20
- [elpa] master a249d15 329/399: ivy-test.el (ivy-avy): Only run if avy is installed, Oleh Krehel, 2019/07/20
- [elpa] master 15f8e10 330/399: .travis.yml: Add emacs-25.3 and emacs-26.2, Oleh Krehel, 2019/07/20
- [elpa] master d752db5 333/399: counsel.el (counsel-find-file-extern-extensions): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master cfb8d49 335/399: counsel.el (counsel-find-file-ignore-regexp): Add lockfiles to dotfiles, Oleh Krehel, 2019/07/20
- [elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when window config changed, Oleh Krehel, 2019/07/20
- [elpa] master 8db9cc1 349/399: swiper.el (swiper--add-cursor-overlay): Avoid a very wide cursor on tab chars, Oleh Krehel, 2019/07/20
- [elpa] master 40d8114 338/399: counsel.el (counsel-shell-command-history): Remove obsolete command, Oleh Krehel, 2019/07/20
- [elpa] master f0a2341 337/399: counsel.el (counsel-rhythmbox): Add :require-match, Oleh Krehel, 2019/07/20