[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ac696cd 6/8: Fix search directly from *ack* but in differe
From: |
João Távora |
Subject: |
[elpa] master ac696cd 6/8: Fix search directly from *ack* but in different dir |
Date: |
Fri, 15 Mar 2019 18:33:11 -0400 (EDT) |
branch: master
commit ac696cd960a7237c07deabb325f2fdb4187971f4
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Fix search directly from *ack* but in different dir
C-u C-u ack allows us to choose a directory. If we happen to do that
from an *ack* buffer, the resulting *ack* buffer which replaces the
previous one, didn't have a correct value for default-directory,
preventing the hyperlinks from working (and further searches from
having a suitable default).
* ack.el (ack): Correctly set default-directory in the
*ack* buffer.
---
ack.el | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/ack.el b/ack.el
index e226e05..8f9101d 100644
--- a/ack.el
+++ b/ack.el
@@ -405,8 +405,8 @@ minibuffer:
\\{ack-minibuffer-local-map}"
(interactive
(let ((ack--project-root (or (funcall ack-default-directory-function
- current-prefix-arg)
- default-directory))
+ current-prefix-arg)
+ default-directory))
;; Disable completion cycling; see http://debbugs.gnu.org/12221
(completion-cycle-threshold nil))
(list (minibuffer-with-setup-hook 'ack-minibuffer-setup-function
@@ -415,13 +415,19 @@ minibuffer:
ack-minibuffer-local-map
nil 'ack-history))
ack--project-root)))
- (let ((default-directory (expand-file-name
- (or directory default-directory))))
- ;; Change to the compilation buffer so that `ack-buffer-name-function' can
- ;; make use of `compilation-arguments'.
- (with-current-buffer (compilation-start command-args 'ack-mode)
+ (let* ((lexical-default-directory
+ (expand-file-name
+ (or directory default-directory))))
+ ;; Change to the compilation to ensure a correct
+ ;; `default-directory' there and to ensure
+ ;; `ack-buffer-name-function' can make use of
+ ;; `compilation-arguments'.
+ (with-current-buffer
+ (let ((default-directory lexical-default-directory))
+ (compilation-start command-args 'ack-mode))
(when ack-buffer-name-function
(rename-buffer (funcall ack-buffer-name-function "ack")))
+ (setq default-directory lexical-default-directory)
(current-buffer))))
(provide 'ack)
- [elpa] master updated (dd10f4a -> 5c25a7d), João Távora, 2019/03/15
- [elpa] master 5c25a7d 8/8: Update packages/ack from upstream, João Távora, 2019/03/15
- [elpa] master ac696cd 6/8: Fix search directly from *ack* but in different dir,
João Távora <=
- [elpa] master bc671ba 7/8: * ack.el (Version): Bump to 1.6, João Távora, 2019/03/15
- [elpa] master 6c65a62 5/8: * README.rst (Usage): fix rst formatting, João Távora, 2019/03/15
- [elpa] master a8857c1 4/8: * README.rst (Usage): Mention ack-minibuffer-setup-hook., João Távora, 2019/03/15
- [elpa] master 47a417d 3/8: Make myself the maintainer of this project, João Távora, 2019/03/15
- [elpa] master c84b434 1/8: Nicer behaviour from ack-skel-vc-grep when used in setup hook, João Távora, 2019/03/15
- [elpa] master 382109a 2/8: ack-skel-vc-grep recalls previously inserted symbol, if any, João Távora, 2019/03/15