Change/Fix: (helm-org-ql.el) Wrap in eval-and-compile

This avoids errors when Helm is not installed, and it seems to work
correctly when Helm is installed.  This should be an improvement until
this file is put in its own package.
This commit is contained in:
Adam Porter 2020-03-02 00:53:41 -06:00
parent 11a0466f92
commit 0648196076

View file

@ -28,15 +28,14 @@
;;; Code:
;;;; Requirements
(eval-and-compile
(eval-when-compile
;; Require these when compiling, but not necessarily on load.
(require 'org)
(require 'org-ql)
(require 'org-ql-search)
;; (require 'helm)
;; (require 'helm-org)
(require 'org-ql-search))
;;;; Compatibility
@ -53,13 +52,16 @@
(defvar helm-pattern)
(defvar helm-input-idle-delay)
(when (require 'helm nil 'noerror)
;; Requirements.
(require 'helm-org)
;;;; Variables
(defvar helm-org-ql-map
(let ((map (make-sparse-keymap))
(mappings '(
"C-x C-s" helm-org-ql-save
)))
(mappings '("C-x C-s" helm-org-ql-save)))
(cl-loop for (key fn) on mappings by #'cddr
do (define-key map (kbd key) fn))
(make-composed-keymap map helm-map))
@ -223,7 +225,7 @@ WINDOW-WIDTH should be the width of the Helm window."
(path (if helm-org-ql-reverse-paths
(concat heading "\\" (s-join "\\" (nreverse path)))
(concat (s-join "/" path) "/" heading))))
(cons (concat prefix path) (point-marker))))
(cons (concat prefix path) (point-marker))))))
;;;; Footer