Reverse treatment of universal argument for helm shortcut menu
Usually, when searching for important documents vie `db/helm-shortcuts`, I forget to include the universal argument, abort the current search and repeat it. This is annoying. Since listing documents is fast enough, including them by default should alleviate this issue. When retrieving the list of documents is too slow and should be disabled interactively, providing a universal argument excludes this listing now.
This commit is contained in:
parent
3bb5b4481d
commit
d6bd360593
13
init.el
13
init.el
|
@ -2356,10 +2356,15 @@ The password is assumed to be stored at the PASSWORD property."
|
|||
|
||||
(defun db/helm-shortcuts (arg)
|
||||
"Open helm completion on common locations.
|
||||
With given ARG, display files in `db/important-document-path’."
|
||||
(interactive "p")
|
||||
|
||||
With universal argument ARG, inhibit display of files in
|
||||
`db/important-document-path’. This might be helpful when loading
|
||||
is too slow (in this case, `db/important-document-path' should
|
||||
eventuelly be set to nil, however)."
|
||||
(interactive "P")
|
||||
(eval-when-compile
|
||||
(require 'helm-bookmark)
|
||||
(require 'helm-for-files) ; for helm-source-recentf
|
||||
(require 'helm-for-files)) ; for helm-source-recentf
|
||||
(helm :sources (list
|
||||
(helm-make-source "Frequently Used" 'helm-source-sync
|
||||
:candidates (mapcar #'(lambda (entry)
|
||||
|
@ -2376,7 +2381,7 @@ With given ARG, display files in `db/important-document-path’."
|
|||
|
||||
;; if prefix arg is given, extract files from
|
||||
;; `db/important-documents-path’ and list them as well
|
||||
(when (and (= arg 4)
|
||||
(when (and (not arg)
|
||||
(file-directory-p db/important-documents-path))
|
||||
(let ((search-path (expand-file-name db/important-documents-path)))
|
||||
(helm-make-source "Important files" 'helm-source-sync
|
||||
|
|
Loading…
Reference in New Issue