[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer
From: |
Oleh Krehel |
Subject: |
[elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes |
Date: |
Wed, 16 Oct 2019 13:14:43 -0400 (EDT) |
branch: master
commit 6928beb21d7adbfbbe9e63628aff40355d1e34ba
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes
---
ivy-test.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index b65add4..c217c23 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -43,10 +43,15 @@
(defvar ivy-result nil
"Holds the eval result of `ivy-expr' by `ivy-eval'.")
+(defvar ivy-eval-dir nil
+ "Hold the `default-directory' value to be used by `ivy-eval'.
+Since `execute-kbd-macro' doesn't pick up a let-bound `default-directory'.")
+
(defun ivy-eval ()
"Evaluate `ivy-expr'."
(interactive)
- (setq ivy-result (eval ivy-expr)))
+ (let ((default-directory (or ivy-eval-dir default-directory)))
+ (setq ivy-result (eval ivy-expr))))
(global-set-key (kbd "C-c e") 'ivy-eval)
@@ -58,9 +63,9 @@
(save-window-excursion
(unwind-protect
(progn
- ;; `execute-kbd-macro' doesn't pick up `default-directory'
(when dir
- (dired (expand-file-name dir (counsel-locate-git-root))))
+ (setq dir (expand-file-name dir (counsel-locate-git-root))))
+ (setq ivy-eval-dir dir)
(execute-kbd-macro
(vconcat (kbd "C-c e")
(kbd keys))))
@@ -931,7 +936,7 @@ will bring the behavior in line with the newer Emacsen."
'(read-directory-name "cd: " "/tmp")
"RET")))
(should
- (equal "/tmp/"
+ (equal "/tmp"
(ivy-with
'(read-directory-name "cd: ")
"C-M-j"
@@ -981,14 +986,8 @@ will bring the behavior in line with the newer Emacsen."
(ert-deftest ivy-read-file-name-in-buffer-visiting-file ()
"Test `ivy-immediate-done' command in `read-file-name' without any editing in
a buffer visiting a file."
- :expected-result :failed
(let ((ivy-mode-reset-arg (if ivy-mode 1 0)))
(ivy-mode 1)
- ;; `ivy-read' returns "~/dummy-dir/dummy-file" (same object, not a copy).
- ;;
- ;; `read-file-name-default' will then return "" in order for
- ;; `set-visited-file-name' to detect that the user typed RET with
- ;; the minibuffer empty.
(should
(equal (ivy-with
'(let ((insert-default-directory t))
@@ -997,7 +996,7 @@ a buffer visiting a file."
(read-file-name "Load file: " nil nil 'lambda)))
;; No editing, just command ivy-immediate-done
"C-M-j")
- ""))
+ "~/dummy-dir/dummy-file"))
(should
(equal (ivy-state-current ivy-last) "~/dummy-dir/dummy-file"))
(ivy-mode ivy-mode-reset-arg)))
- [elpa] master 42fedf5 116/184: counsel.el (counsel-file-stale-p): Extract, (continued)
- [elpa] master 42fedf5 116/184: counsel.el (counsel-file-stale-p): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 0895c1a 113/184: Add key binding to allow switching directory in counsel-git-grep, Oleh Krehel, 2019/10/16
- [elpa] master d27eb38 119/184: counsel.el (counsel-git-grep): Change args order so counsel-cd works, Oleh Krehel, 2019/10/16
- [elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't store line number as a string, Oleh Krehel, 2019/10/16
- [elpa] master 4a44c9e 018/184: counsel.el (counsel--async-last-error-string): Add for ease of debugging, Oleh Krehel, 2019/10/16
- [elpa] master 5e79f16 020/184: ivy.el (ivy--input): Fix point moving in TRAMP sessions, Oleh Krehel, 2019/10/16
- [elpa] master f30c6e1 022/184: swiper.el: Fix overlay faces using regex-ignore-order, Oleh Krehel, 2019/10/16
- [elpa] master 9c4cdb7 025/184: swiper.el (swiper-isearch-action): Fix for ivy-occur, Oleh Krehel, 2019/10/16
- [elpa] master ed1ba4e 028/184: Makefile (deps): Add target, Oleh Krehel, 2019/10/16
- [elpa] master b5e869e 026/184: swiper.el (swiper--occur-cands): Fix wgrep, Oleh Krehel, 2019/10/16
- [elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes,
Oleh Krehel <=
- [elpa] master 35415e3 027/184: ivy-test.el (ivy-swiper-wgrep): Add test, Oleh Krehel, 2019/10/16
- [elpa] master fb78c3f 045/184: swiper.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on RET, Oleh Krehel, 2019/10/16
- [elpa] master c4e0b0b 032/184: ivy-test.el (ivy-read-file-name-make-directory): Add, Oleh Krehel, 2019/10/16
- [elpa] master fdd2178 042/184: ivy.el (ivy--magic-tilde-directory): Use "~~" to move to local home, Oleh Krehel, 2019/10/16
- [elpa] master a9196a2 035/184: counsel.el (counsel-file-jump-args): Is now a list, Oleh Krehel, 2019/10/16
- [elpa] master e58231e 033/184: ivy.el (ivy-immediate-done): Fix for when "C-j" changed cwd, Oleh Krehel, 2019/10/16
- [elpa] master 0132ced 044/184: counsel.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master c4842ec 043/184: Fix typo: 'beggining', Oleh Krehel, 2019/10/16
- [elpa] master 28e9416 052/184: ivy.el (ivy--input): Fix for ediff, Oleh Krehel, 2019/10/16