[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 49647d3f54 03/13: Add dummy source for read-file-name
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 49647d3f54 03/13: Add dummy source for read-file-name as well |
Date: |
Sat, 18 May 2024 13:00:18 -0400 (EDT) |
branch: elpa/helm
commit 49647d3f5417894bca76cf89e3bfb41d20901dc8
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Add dummy source for read-file-name as well
---
helm-files.el | 4 ++--
helm-mode.el | 14 ++++++++++----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/helm-files.el b/helm-files.el
index 7a82e588a3..1869d369b7 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -3516,7 +3516,7 @@ debugging purpose."
;; Return PATTERN unchanged.
(t pattern))))
-(defun helm-find-files-get-candidates (&optional require-match)
+(defun helm-find-files-get-candidates ()
"Create candidate list for `helm-source-find-files'."
(let* ((path (helm-ff-set-pattern helm-pattern))
(dir-p (file-accessible-directory-p path))
@@ -5595,7 +5595,7 @@ Use it for non-interactive calls of `helm-find-files'."
(defvar helm-find-files-dummy-source
(helm-build-dummy-source "New file or dir"
:filtered-candidate-transformer
- (lambda (candidates _source)
+ (lambda (_candidates _source)
(unless (file-exists-p helm-pattern)
(list (helm-ff-filter-candidate-one-by-one helm-pattern nil t))))
:action #'helm-find-file-or-marked))
diff --git a/helm-mode.el b/helm-mode.el
index 5bf41b3d26..b248504d75 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -2009,7 +2009,14 @@ Keys description:
:must-match must-match
:nomark nomark
:action action-fn)
- ;; Other source.
+ ;; Non existing file or dir source.
+ (unless must-match
+ (helm-build-dummy-source "New file or dir"
+ :filtered-candidate-transformer
+ (lambda (_candidates _source)
+ (unless (file-exists-p helm-pattern)
+ (list (helm-ff-filter-candidate-one-by-one helm-pattern nil
t))))))
+ ;; List files source.
(helm-build-sync-source name
:header-name (lambda (name)
(concat name (substitute-command-keys
@@ -2033,12 +2040,11 @@ Keys description:
(cl-loop with hn = (helm-ff--tramp-hostnames)
;; helm-find-files-get-candidates is
;; returning a list of cons cells.
- for (d . r) in
(helm-find-files-get-candidates
- must-match)
+ for (d . r) in
(helm-find-files-get-candidates)
when (or (member r hn) ; A tramp host
(funcall test r)) ; Test ok
collect (cons d r)))
- (helm-find-files-get-candidates must-match)))
+ (helm-find-files-get-candidates)))
:update (lambda ()
(remhash helm-ff-default-directory
helm-ff--list-directory-cache))
- [nongnu] elpa/helm updated (08cfc12278 -> ba2eb55235), ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm aec87449bc 10/13: Make :must-match working in read-file-name dummy source, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm 4e841d9c1c 11/13: Remove helm-read-file-dummy-map, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm a4ac705b1c 07/13: Ensure lynx style map is used in new HFF dummy source, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm 4cb0f2e5c3 06/13: Allow using C-l in new HFF dummy source, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm c71be6c5b1 12/13: Bind missing keys to helm-find-files-dummy-map, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm ba2eb55235 13/13: Fix dummy sources name, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm 49647d3f54 03/13: Add dummy source for read-file-name as well,
ELPA Syncer <=
- [nongnu] elpa/helm e48f65bc7e 09/13: Move helm-read-file-dummy-map to helm-files to avoid errors, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm a779dd2607 01/13: Use `truncate-string-ellipsis` as default for helm-buffers-end-truncated-string, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm 0d928a6c31 05/13: Add missing actions to helm-find-files-dummy-source, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm f54356fc27 04/13: Get rid of helm-ff-move-to-first-real-candidate, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm 996e2cab6d 08/13: Move dummy map on top, ELPA Syncer, 2024/05/18
- [nongnu] elpa/helm 3c390b99f5 02/13: Use a dummy source for not existing files in HFF, ELPA Syncer, 2024/05/18