Permalink
Browse files

* helm-files.el (helm-files-save-file-name-history): Don't call helm-…

…get-selection on empty sources.
  • Loading branch information...
1 parent 1f661c6 commit 4bfab70b2e183e8a6a7ac647bf0329363230f947 @thierryvolpiatto thierryvolpiatto committed Nov 24, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 helm-files.el
View
@@ -1448,14 +1448,14 @@ Store the selected file-name in the `file-name-history'."
(add-hook 'helm-cleanup-hook 'helm-ff-save-history)
(defun helm-files-save-file-name-history ()
- (let ((sel (helm-get-selection))
- (history-delete-duplicates t))
- (when (and (helm-file-completion-source-p)
- (file-exists-p sel))
- ;; we use `abbreviate-file-name' here because other parts of Emacs seems to,
- ;; and we don't want to introduce duplicates.
- (add-to-history 'file-name-history
- (abbreviate-file-name (helm-get-selection))))))
+ (when (helm-file-completion-source-p)
+ (let ((sel (helm-get-selection))
+ (history-delete-duplicates t))
+ (when (file-exists-p sel)
+ ;; we use `abbreviate-file-name' here because other parts of Emacs seems to,
+ ;; and we don't want to introduce duplicates.
+ (add-to-history 'file-name-history
+ (abbreviate-file-name (helm-get-selection)))))))
(add-hook 'helm-after-action-hook 'helm-files-save-file-name-history)
(defun helm-ff-valid-symlink-p (file)

0 comments on commit 4bfab70

Please sign in to comment.