From 336ee9d7c40047d0c4f241b41a4c7b8ed7224fc4 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 26 Jun 2020 21:53:05 +0200 Subject: [PATCH] Incorporate some suggestions from the byte compiler --- site-lisp/db-customize.el | 3 ++- site-lisp/db-hydras.el | 2 ++ site-lisp/db-org.el | 8 +++++++- site-lisp/db-projects.el | 12 +++++++++--- site-lisp/db-utils.el | 3 ++- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/site-lisp/db-customize.el b/site-lisp/db-customize.el index 21a322c..f9f4180 100644 --- a/site-lisp/db-customize.el +++ b/site-lisp/db-customize.el @@ -4,6 +4,8 @@ ;;; Code: +(require 'gnutls) + (defgroup personal-settings nil "A bunch of functions and variables for personalizing emacs." :prefix "db/" @@ -38,7 +40,6 @@ search commands like `db/helm-shortcuts’." Assumes that NEW-VALUE points to a directory, and certificates are assumed to be of the form *.crt." (set symbol new-value) - (require 'gnutls) (when (file-directory-p new-value) (dolist (cert-file (directory-files new-value t ".crt$")) (add-to-list 'gnutls-trustfiles cert-file)))) diff --git a/site-lisp/db-hydras.el b/site-lisp/db-hydras.el index 4e63350..7a6d13b 100644 --- a/site-lisp/db-hydras.el +++ b/site-lisp/db-hydras.el @@ -4,6 +4,8 @@ ;;; Code: +(declare-function rectangle-exchange-point-and-mark "rect") + (require 'hydra) (defhydra hydra-toggle (:color blue) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 745ec9f..6d8a348 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -8,8 +8,14 @@ ;;; Code: +(require 'org) +(require 'org-agenda) +(require 'hydra) (require 'db-customize) +(declare-function counsel-org-goto-all "counsel") +(declare-function which-function "which-func") + ;;; Agenda Customization @@ -117,7 +123,7 @@ If OTHERS is true, skip all entries that do not correspond to TAG." If a is before b, return -1. If a is after b, return 1. If they are equal return nil." - (lexical-let ((prop prop)) + (let ((prop prop)) #'(lambda (a b) (let* ((a-pos (get-text-property 0 'org-marker a)) (b-pos (get-text-property 0 'org-marker b)) diff --git a/site-lisp/db-projects.el b/site-lisp/db-projects.el index d782e02..53957bd 100644 --- a/site-lisp/db-projects.el +++ b/site-lisp/db-projects.el @@ -6,9 +6,13 @@ ;;; Code: +(declare-function projectile-add-known-project "projectile") +(declare-function projectile-cleanup-known-projects "projectile") + (require 'subr-x) (require 'cl-lib) (require 'dash) +(require 'bookmark) (defgroup projects nil "Simple directory-based project management" @@ -17,11 +21,13 @@ (defcustom projects-main-project-directory "~/Documents/projects/" "Main directory to host projects." - :group 'projects) + :group 'projects + :type 'directory) -(defcustom projects-archive-directory "~/Documents/projects/.archive" +(defcustom projects-archive-directory "~/Documents/projects/.archive/" "Directory to archive projects into" - :group 'projects) + :group 'projects + :type 'directory) (defun projects-project-exists-p (short-name) "Check whether a project named SHORT-NAME already exists" diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 48ef0b3..cb601b1 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -12,6 +12,7 @@ (require 'cl-lib) (require 'dash) (require 'db-customize) +(require 'bookmark) ;;; Application Shortcuts @@ -422,7 +423,7 @@ drawers, will be copied to point." (org-element-at-point)))) (unless (string-equal (org-element-property :title template-element) "Template") - (assert "Template must be first headline in periodic task.")) + (user-error "Template must be first headline in periodic task.")) ;; XXX: trying to get the contents of the current item, without any ;; drawers, by going to the end of the template item and marking the ;; element at point, which, incidentally, seems to be the content we are