From 88f2b35e3fadfa948a59a97e8e83768fda4c48d3 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 13 Aug 2024 15:27:02 -0700 Subject: [PATCH] Nifty ability to encrypt sections of an org file Plus, let's get some formatting for Telega messages. --- ha-aux-apps.org | 5 ++++- ha-config.org | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ha-aux-apps.org b/ha-aux-apps.org index 0c355ad..376763f 100644 --- a/ha-aux-apps.org +++ b/ha-aux-apps.org @@ -152,7 +152,10 @@ I'm thinking the [[https://zevlg.github.io/telega.el/][Telega package]] would be :config (setq telega-user-use-avatars nil telega-use-tracking-for nil ; '(any pin unread) - telega-chat-use-markdown-formatting t + ;; Use org formatting for normal messages. + ;; Want to send the org markup without formatting? + ;; The `nil' sets that with `C-u' then Return: + telega-chat-input-markups '("org" nil) telega-emoji-use-images t ; telega-completing-read-function #'ivy-completing-read telega-msg-rainbow-title nil) diff --git a/ha-config.org b/ha-config.org index cd920d4..46e8647 100644 --- a/ha-config.org +++ b/ha-config.org @@ -967,8 +967,25 @@ Need to make sure that Emacs will handle the prompts, and turn it on: :config (setenv "GPG_AGENT_INFO" nil) (epa-file-enable)) - #+end_src + +Since I already (at this point in my file) have Org installed and running, the following code configures the encryption of certain header sections (see [[https://orgmode.org/worg/org-tutorials/encrypting-files.html][this tutorial]]). Headers with a =:crypt:tag (see =org-crypt-tag-matcher= to change it) will be encrypted. + +To temporarily read an encrypted part, and call =M-x org-decrypt-entry= when the cursor is inside that section. Saving the file, will re-encrypt it. + + +#+begin_src emacs-lisp + (use-package org + :config + (require 'org-crypt) + + (org-crypt-use-before-save-magic) + (setq org-tags-exclude-from-inheritance (quote ("crypt"))) + ;; GPG key to use for encryption + ;; Either the Key ID or set to nil to use symmetric encryption. + (setq org-crypt-key nil)) +#+end_src + * Technical Artifacts :noexport: Let's provide a name so we can =require= this file: #+begin_src emacs-lisp :exports none