[Utils] Make main custom variables for ‘db/helm-shortcuts’ Helm-agnostic

This commit is contained in:
Daniel - 2019-03-02 10:55:13 +01:00
parent be8d5a3f0f
commit 6d5976a00a
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
2 changed files with 21 additions and 27 deletions

20
init.el
View File

@ -511,6 +511,26 @@
(use-package dash)
(defcustom db/frequently-used-features
'(("Mail" . db/gnus)
("Agenda" . db/org-agenda)
("Init File" . db/find-user-init-file)
("EMMS" . emms)
("Shell" . shell)
("EShell" . eshell)
("scratch" . db/scratch))
"Mapping of frequently used features to functions implementing
them. Can be used in application shortcuts such as
`db/helm-shortcuts."
:group 'personal-settings
:type '(alist :key-type string :value-type sexp))
(defcustom db/important-documents-path "~/Documents/library/"
"Path to look for documents that can be listed in extended
search commands like `db/helm-shortcuts."
:group 'personal-settings
:type 'string)
(use-package db-utils
:commands (endless/fill-or-unfill
db/delete-trailing-whitespace-maybe

View File

@ -319,39 +319,13 @@ If found, imports the certificate via gpgsm."
;;; helm configuration
(defcustom db/helm-frequently-used-features
'(("Mail" . db/gnus)
("Agenda" . db/org-agenda)
("Init File" . db/find-user-init-file)
("EMMS" . emms)
("Shell" . shell)
("EShell" . eshell)
("scratch" . db/scratch))
"Helm shortcuts for frequently used features."
:group 'personal-settings
:type '(alist :key-type string :value-type sexp))
(defvar db/helm-source-frequently-used-features
'((name . "Frequently Used")
(candidates . db/helm-frequently-used-features)
(candidates . db/frequently-used-features)
(action . (("Open" . funcall)))
(filtered-candidate-transformer . helm-adaptive-sort))
"Helm source for `db/helm-frequently-used-features.")
(defvar db/helm-source-frequently-visited-locations
'((name . "Locations")
(candidates . db/helm-frequently-visited-locations)
(action . (("Open" . (lambda (entry)
(if (consp entry)
(funcall (car entry) (cdr entry))
(find-file entry))))))
(filtered-candidate-transformer . helm-adaptive-sort)))
(defcustom db/important-documents-path "~/Documents/library/"
"Path of important documents."
:group 'personal-settings
:type 'string)
(defun db/important-documents ()
"Recursively return paths of all files found in `db/important-documents-path.
The result will be a list of cons cells, where the car is the