branch: elpa/helm
commit 8ac4579c47facebf73230504d760ec28ff25ee40
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Provide helm-quit-and-find-file in helm-core
    
    When using helm-core package only helm-utils is not loaded and
    helm-quit-and-find-file is not provided.
    
    Rename helm-quit-and-find-file to helm-quit-and-find-file-1 in
    helm-utils and move helm-quit-and-find-file to helm-core.
---
 helm-core.el  | 9 ++++++++-
 helm-utils.el | 4 +---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index f7ee0a27474..7009cccb5c1 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -43,7 +43,7 @@
 
 (declare-function helm-comp-read "helm-mode.el")
 (declare-function custom-unlispify-tag-name "cus-edit.el")
-(declare-function helm-quit-and-find-file "helm-utils.el")
+(declare-function helm-quit-and-find-file-1 "helm-utils.el")
 (declare-function linum-mode "linum.el")
 (declare-function minibuffer-depth-setup "mb-depth.el")
 (declare-function transient--delete-window "ext:transient" ())
@@ -2657,6 +2657,13 @@ i.e. functions called with RET."
                                                              
'helm--last-frame-parameters nil))))
   (helm-exit-minibuffer))
 
+(defun helm-quit-and-find-file ()
+  (interactive)
+  (if (fboundp 'helm-quit-and-find-file-1)
+      (helm-quit-and-find-file-1)
+    (error "No rules to find file, please install helm package for this")))
+(put 'helm-quit-and-find-file 'helm-only t)
+
 (defun helm--get-frame-parameters (&optional frame)
   (cl-loop with params = (frame-parameters frame)
            for p in helm--frame-default-attributes
diff --git a/helm-utils.el b/helm-utils.el
index 8ffdda3fdd3..78d385b947b 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -600,11 +600,10 @@ after running winner-undo/redo."
   (cl-pushnew helm-buffer winner-boring-buffers :test 'equal))
 (add-hook 'helm-cleanup-hook #'helm-handle-winner-boring-buffers)
 
-(defun helm-quit-and-find-file ()
+(defun helm-quit-and-find-file-1 ()
   "Drop into `helm-find-files' from `helm'.
 If current selection is a buffer or a file, `helm-find-files'
 from its directory."
-  (interactive)
   (with-helm-alive-p
     (require 'helm-grep)
     (require 'helm-elisp)
@@ -625,7 +624,6 @@ from its directory."
                                          (helm-basename f) f))))
              (helm-find-files-1 f))))
        (helm--quit-and-find-file-default-file src)))))
-(put 'helm-quit-and-find-file 'helm-only t)
 
 (defun helm--quit-and-find-file-default-file (source)
   (let ((target-fn (or (helm-get-attr 'find-file-target source)

Reply via email to