Skip to content

Commit

Permalink
Correct org-crypt configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Sep 15, 2024
1 parent 28e4693 commit 247af06
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -939,35 +939,34 @@ see: https://karl-voit.at/2019/11/03/org-projects/"
(define-key my-keyboard-map (kbd "P") #'my/org-mark-as-project)

;;;;; Org Links

;; Alist of link abbreviations to link certain kind of data.
(setq org-link-abbrev-alist
(setopt org-link-abbrev-alist
;; `org-contacts-link-open' from `org-contacts' has very unusual and not
;; acceptable behavior for me. Maybe I will write a bug report or submit
;; a patch at some point, but as a temporary solution - I am using
;; "contact:" instead of "org-contact:" provided by `org-contacts'.
`(("contact" . ,(concat (expand-file-name "contacts.org" org-directory)
"::"))))
;;;;; Org Crypt
;; Check if GPG is available, then require `org-crypt'.
;; Otherwise, display a warning.
(if my-gpg-program
(require 'org-crypt)
(warn "GPG is not available. `org-crypt' could not be loaded."))

;; Set my encrypt key from `epa-file-encrypt-to' (see above).
(setq org-crypt-key epa-file-encrypt-to)
(setopt org-crypt-key epg-user-id)

;; Do not ask for disabling `auto-save-mode'.
(setq org-crypt-disable-auto-save nil)
(setopt org-crypt-disable-auto-save nil)

;; Encrypt all entries before saving.
(org-crypt-use-before-save-magic)
;; Check if GPG is available, then require `org-crypt'.
;; Otherwise, display a warning.
(if my-gpg-program
(progn
(require 'org-crypt)
;; Encrypt all entries before saving.
(org-crypt-use-before-save-magic))
(warn "GPG is not available. `org-crypt' could not be loaded."))

;; Projects are tagged with :project: and :crypt: is used to mark headings
;; to be encrypted. I don't want all subitems to pop up in the corresponding
;; agenda view.
(setq org-tags-exclude-from-inheritance '("project" "crypt"))
(setopt org-tags-exclude-from-inheritance '("project" "crypt"))

;;;;; Org Contib
(with-eval-after-load 'org
Expand Down

0 comments on commit 247af06

Please sign in to comment.