[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8201f36 224/272: ivy.el (ivy-occur-revert-buffer): Improve
From: |
Oleh Krehel |
Subject: |
[elpa] master 8201f36 224/272: ivy.el (ivy-occur-revert-buffer): Improve for counsel-git-grep |
Date: |
Mon, 25 Apr 2016 10:13:27 +0000 |
branch: master
commit 8201f36c1137a8eee78cfc0ecdea629c10200b78
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-occur-revert-buffer): Improve for counsel-git-grep
* counsel.el (counsel-git-grep-occur): Avoid calling
`ivy-occur-grep-mode', since it erases all local variables.
---
counsel.el | 8 +++++---
ivy.el | 18 +++++++++++-------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/counsel.el b/counsel.el
index c4f6c3c..16cc297 100644
--- a/counsel.el
+++ b/counsel.el
@@ -963,9 +963,11 @@ When NO-ASYNC is non-nil, do it synchronously."
(ivy--exhibit)))))))))
(defun counsel-git-grep-occur ()
- "Generate a custom occur buffer for `counsel-git-grep'."
- (ivy-occur-grep-mode)
- (setq default-directory counsel--git-grep-dir)
+ "Generate a custom occur buffer for `counsel-git-grep'.
+When REVERT is non-nil, regenerate the current *ivy-occur* buffer."
+ (unless (eq major-mode 'ivy-occur-grep-mode)
+ (ivy-occur-grep-mode)
+ (setq default-directory counsel--git-grep-dir))
(let ((cands (split-string
(shell-command-to-string
(format counsel-git-grep-cmd
diff --git a/ivy.el b/ivy.el
index 000d68e..5b23a4e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2846,13 +2846,17 @@ updated original buffer."
(interactive)
(let ((caller (ivy-state-caller ivy-occur-last))
(ivy-last ivy-occur-last))
- (when (eq caller 'swiper)
- (let ((buffer (ivy-state-buffer ivy-occur-last)))
- (unless (buffer-live-p buffer)
- (error "buffer was killed"))
- (let ((inhibit-read-only t))
- (erase-buffer)
- (funcall (plist-get ivy--occurs-list caller) t))))))
+ (cond ((eq caller 'swiper)
+ (let ((buffer (ivy-state-buffer ivy-occur-last)))
+ (unless (buffer-live-p buffer)
+ (error "buffer was killed"))
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (funcall (plist-get ivy--occurs-list caller) t))))
+ ((memq caller '(counsel-git-grep counsel-grep))
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (funcall (plist-get ivy--occurs-list caller)))))))
(declare-function wgrep-change-to-wgrep-mode "ext:wgrep")
- [elpa] master e92d282 195/272: Make ivy-ignore-buffers similar to ido-ignore-buffers., (continued)
- [elpa] master e92d282 195/272: Make ivy-ignore-buffers similar to ido-ignore-buffers., Oleh Krehel, 2016/04/25
- [elpa] master 4235ffc 092/272: colir.el (colir-blend-face-background): Improve, Oleh Krehel, 2016/04/25
- [elpa] master 9aee83a 105/272: ivy.el (ivy-completion-in-region): Bind completion-ignore-case, Oleh Krehel, 2016/04/25
- [elpa] master 2a1ef54 148/272: ivy-dispatching-done should not permanently modify default action index, Oleh Krehel, 2016/04/25
- [elpa] master 5eaf787 078/272: doc/ivy.org: Improve the Texinfo/HTML export structure, Oleh Krehel, 2016/04/25
- [elpa] master b7c40d3 152/272: ivy.el (ivy-resume): Add a guard against null :action, Oleh Krehel, 2016/04/25
- [elpa] master 2ab9c54 197/272: ivy.el (ivy--switch-buffer-matcher): Fix, Oleh Krehel, 2016/04/25
- [elpa] master db00518 270/272: Bump version to 0.8.0, Oleh Krehel, 2016/04/25
- [elpa] master 96828c2 100/272: ivy.el (ivy-read): Identify extra-actions by caller as well, Oleh Krehel, 2016/04/25
- [elpa] master d425392 178/272: Correctly expand the file name at point, Oleh Krehel, 2016/04/25
- [elpa] master 8201f36 224/272: ivy.el (ivy-occur-revert-buffer): Improve for counsel-git-grep,
Oleh Krehel <=
- [elpa] master 20f11b7 159/272: New command ivy-occur-revert-buffer bound to "g", Oleh Krehel, 2016/04/25
- [elpa] master d8da9c4 188/272: counsel.el (counsel-mode): Allow use of describe-prefix-bindings, Oleh Krehel, 2016/04/25
- [elpa] master ab795d0 265/272: Don't highlight that match in the file name part, Oleh Krehel, 2016/04/25
- [elpa] master 255457a 177/272: Fixed counsel-list-processes-action-switch to use correct buffer., Oleh Krehel, 2016/04/25
- [elpa] master 48b5638 129/272: ivy.el (ivy-next-history-element): Don't add symbol bounds for file names, Oleh Krehel, 2016/04/25
- [elpa] master 41dfae6 194/272: ivy.el (ivy--format-function-generic): Fix doc, Oleh Krehel, 2016/04/25
- [elpa] master f0de338 198/272: ivy.el (ivy--directory-done): Fix when ivy-text is a dir, Oleh Krehel, 2016/04/25
- [elpa] master 67224c0 171/272: counsel.el (counsel-prompt-function): New defcustom, Oleh Krehel, 2016/04/25
- [elpa] master 0c5f68c 183/272: counsel.el (counsel-pt): Add, Oleh Krehel, 2016/04/25
- [elpa] master 692002d 184/272: counsel.el (counsel-pt): Remove unused args, Oleh Krehel, 2016/04/25