浏览代码

org-capture.el: Add declarations and check is `org-crypt' is loaded (Fix commit ac6409fe)

* org-capture.el (org-at-encrypted-entry-p)
(org-encrypt-entry, org-decrypt-entry): Declare.
(org-capture-set-target-location): Check whether `org-crypt'
has been loaded.

Thanks to Mike McLean for reporting this.
Bastien Guerry 12 年之前
父节点
当前提交
0b65064961
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      lisp/org-capture.el

+ 4 - 1
lisp/org-capture.el

@@ -58,6 +58,9 @@
 (declare-function org-table-goto-line "org-table" (N))
 (declare-function org-pop-to-buffer-same-window "org-compat"
 		  (&optional buffer-or-name norecord label))
+(declare-function org-at-encrypted-entry-p "org-crypt" ())
+(declare-function org-encrypt-entry "org-crypt" ())
+(declare-function org-decrypt-entry "org-crypt" ())
 
 (defvar org-remember-default-headline)
 (defvar org-remember-templates)
@@ -928,7 +931,7 @@ Store them in the capture property list."
 
        (t (error "Invalid capture target specification")))
 
-      (when (org-at-encrypted-entry-p)
+      (when (and (featurep 'org-crypt) (org-at-encrypted-entry-p))
 	(org-decrypt-entry)
 	(setq decrypted-hl-pos
 	      (save-excursion (and (org-back-to-heading t) (point)))))