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

    Move helm-turn-on-recentf to helm-files
---
 helm-files.el     | 10 ++++++++--
 helm-for-files.el |  5 -----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index c90440ace7c..01b4ce6c17c 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -968,6 +968,11 @@ Setting this with `setq' may have no effect on this 
variable, use
          ;; Force rebuilding the source to pass diacritics fn to diacritics
          ;; slot.
          (setq helm-source-find-files nil)))
+
+(defcustom helm-turn-on-recentf t
+  "Automatically turn on `recentf-mode' when non-nil."
+  :group 'helm-files
+  :type 'boolean)
 
 ;;; Faces
 ;;
@@ -6863,12 +6868,13 @@ be existing directories."
 (defun helm-ff-file-name-history ()
   "Switch to `recentf' without quitting `helm-find-files'."
   (interactive)
-  (recentf-mode 1)
+  (when helm-turn-on-recentf (recentf-mode 1))
   (let ((src (helm-build-sync-source "File name history"
                :candidate-number-limit
                (helm-aand
                 (or
-                 recentf-max-saved-items
+                 (and (boundp 'recentf-max-saved-items)
+                      recentf-max-saved-items)
                  (get 'file-name-history 'history-length)
                  history-length)
                 (and (numberp it) it))
diff --git a/helm-for-files.el b/helm-for-files.el
index 70b38d15827..4868f6cd863 100644
--- a/helm-for-files.el
+++ b/helm-for-files.el
@@ -112,11 +112,6 @@ Be aware that a nil value will make tramp display very 
slow."
         (t (setq helm-recentf--basename-flag nil)
            pattern))))
 
-(defcustom helm-turn-on-recentf t
-  "Automatically turn on `recentf-mode' when non-nil."
-  :group 'helm-files
-  :type 'boolean)
-
 (defclass helm-recentf-source (helm-source-sync helm-type-file)
   ((init :initform (lambda ()
                      (require 'recentf)

Reply via email to