From 6d5976a00a6bfa3d37a022323f1698c96538fd66 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 2 Mar 2019 10:55:13 +0100 Subject: [PATCH] =?UTF-8?q?[Utils]=20Make=20main=20custom=20variables=20fo?= =?UTF-8?q?r=20=E2=80=98db/helm-shortcuts=E2=80=99=20Helm-agnostic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.el | 20 ++++++++++++++++++++ site-lisp/db-utils.el | 28 +--------------------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/init.el b/init.el index 117452a..11fd0d2 100644 --- a/init.el +++ b/init.el @@ -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 diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 69e8edf..bbeb4d3 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -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