[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fb486d8 024/184: ivy.el (ivy-immediate-done): Add copy-seq
From: |
Oleh Krehel |
Subject: |
[elpa] master fb486d8 024/184: ivy.el (ivy-immediate-done): Add copy-sequence to fix read-directory-name |
Date: |
Wed, 16 Oct 2019 13:14:42 -0400 (EDT) |
branch: master
commit fb486d87424d3161aa059eed957e2fefef356d4d
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-immediate-done): Add copy-sequence to fix read-directory-name
`read-directory-name' returns "" when the completion function passes
it back the DEF argument. This is a highly questionable behavior that
some old functions depend on.
Looks like it's better to break those old functions, rather than break
the more important functions that have no idea why
`read-directory-name' returns "".
* ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Now fails.
(ivy-read-directory-name): Add test.
Fixes #2165
Fixes #2149
Re #1170
---
ivy-test.el | 9 ++++++++-
ivy.el | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index 1d5d9d6..4dd854b 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -929,7 +929,13 @@ will bring the behavior in line with the newer Emacsen."
(equal "/tmp/"
(ivy-with
'(read-directory-name "cd: " "/tmp")
- "RET"))))
+ "RET")))
+ (should
+ (equal "/tmp/"
+ (ivy-with
+ '(read-directory-name "cd: ")
+ "C-M-j"
+ :dir "/tmp"))))
(ert-deftest ivy-partial-files ()
(when (file-exists-p "/tmp/ivy-partial-test")
@@ -975,6 +981,7 @@ 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).
diff --git a/ivy.el b/ivy.el
index b25c0b4..c24bcd7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1125,7 +1125,7 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
((and (string= ivy-text "")
(eq (ivy-state-collection ivy-last)
#'read-file-name-internal))
- (or (ivy-state-def ivy-last)
+ (or (copy-sequence (ivy-state-def ivy-last))
ivy--directory))
(t
(expand-file-name ivy-text ivy--directory))))
- [elpa] master dc7f5e0 012/184: swiper.el (swiper--isearch-function): Works for ivy--regex-ignore-order, (continued)
- [elpa] master dc7f5e0 012/184: swiper.el (swiper--isearch-function): Works for ivy--regex-ignore-order, Oleh Krehel, 2019/10/16
- [elpa] master 50ead7e 013/184: ivy-test.el (swiper-thing-at-point): Add and fix test, Oleh Krehel, 2019/10/16
- [elpa] master ec3e062 034/184: counsel (counsel-file-jump): Use temp buffer instead of split-string, Oleh Krehel, 2019/10/16
- [elpa] master 13be8ab 004/184: ivy.el (ivy--reset-state): Fix ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master 039353d 007/184: ivy.el (ivy--preselect-index): Fix ivy-resume for swiper-isearch, Oleh Krehel, 2019/10/16
- [elpa] master c7ffd06 016/184: swiper.el (swiper-isearch-action): Make ivy-previous-line-or-history work, Oleh Krehel, 2019/10/16
- [elpa] master b4c4a7f 011/184: swiper.el (swiper--isearch-next-item): Extract, Oleh Krehel, 2019/10/16
- [elpa] master b9f3e3b 017/184: swiper.el (swiper-isearch-action): Simplify, Oleh Krehel, 2019/10/16
- [elpa] master 38b5d83 015/184: swiper.el (swiper--isearch-filter-ignore-order): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 5f99723 019/184: counsel.el (counsel--async-last-command): Add for ease of debugging, Oleh Krehel, 2019/10/16
- [elpa] master fb486d8 024/184: ivy.el (ivy-immediate-done): Add copy-sequence to fix read-directory-name,
Oleh Krehel <=
- [elpa] master f71f89a 029/184: ivy-test.el (ivy-swiper-wgrep): Expect fail on <=24.3, Oleh Krehel, 2019/10/16
- [elpa] master 230137b 047/184: ivy.el (ivy-restrict-to-matches): Work for dynamic collection, Oleh Krehel, 2019/10/16
- [elpa] master c3bd60c 041/184: ivy.el (ivy--occur-press-update-window): Don't error if buffer was killed, Oleh Krehel, 2019/10/16
- [elpa] master 6bf2cba 053/184: ivy.el (ivy-read-action-ivy): Don't recur, Oleh Krehel, 2019/10/16
- [elpa] master 1a4ebda 048/184: Allow virtual-buffers customization, Oleh Krehel, 2019/10/16
- [elpa] master b4af1a6 040/184: swiper.el (swiper-recenter-top-bottom): Works for swiper-isearch, Oleh Krehel, 2019/10/16
- [elpa] master 327dbd6 058/184: counsel.el (counsel-rg-base-command): Don't include directory on non-Windows, Oleh Krehel, 2019/10/16
- [elpa] master 5140127 046/184: ivy.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master 2ecbd7d 054/184: ivy.el (ivy-read-action-ivy): Show the selected item in the prompt, Oleh Krehel, 2019/10/16
- [elpa] master ae70443 060/184: counsel.el (counsel-major): Add, Oleh Krehel, 2019/10/16