emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Colin Baxter <m43cap@yandex.com>
To: emacs-orgmode@gnu.org
Subject: encryption problems using org-mode
Date: Mon, 15 Feb 2021 13:38:42 +0000	[thread overview]
Message-ID: <8735xxxxgd.fsf@yandex.com> (raw)

Hello,

I have an encryption problem that has materialised only today. I
think it's an org-mode issue since that package is the only one I have
refreshed with a new 'pull' today

I have a symmetrically encrypted file data.org.gpg for which I have the
line:

# Local Variables:
# eval: (sensitive-mode t)
# End:

The sensitive-mode is defined as

#+begin_src elisp
(define-minor-mode sensitive-mode
  "For sensitive files like password lists and gpg file. It disables backup creation and auto saving. With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode."
  ;; the initial value
  nil
  ;; the indicator for the mode line
  " Sensitive"
  ;; the minor mode bindings
  nil
  (if (symbol-value sensitive-mode)
      (progn
        ;; disable backups
        (set (make-local-variable 'backup-inhibited) t)
        ;; disable auto-save
        (if auto-save-default
            (auto-save-mode -1)))
    ;; resort to default value of backup-inhibited
    (kill-local-variable 'backup-inhibited)
    ;; resort to default auto save setting
    (if auto-save-default
        (auto-save-mode 1))))
#+end_src

This has worked until today. Now if data.org.gpg is opened I get an
error.

Debugger entered--Lisp error: (void-variable minor-modes)
  (sensitive-mode t)
  (eval (sensitive-mode t))
  (hack-one-local-variable eval (sensitive-mode t))
  (hack-local-variables-apply)
  (#f(compiled-function (&optional handle-mode) "Parse and put into effect this buffer's local variables spec.\nFor buffers visiting files, also puts into effect directory-local\nvariables.\nUses `hack-local-variables-apply' to apply the variables.\n\nIf HANDLE-MODE is nil, we apply all the specified local\nvariables.  If HANDLE-MODE is neither nil nor t, we do the same,\nexcept that any settings of `mode' are ignored.\n\nIf HANDLE-MODE is t, all we do is check whether a \"mode:\"\nis specified, and return the corresponding mode symbol, or nil.\nIn this case, we try to ignore minor-modes, and return only a\nmajor-mode.\n\nIf `enable-local-variables' or `local-enable-local-variables' is nil,\nthis function does nothing.  If `inhibit-local-variables-regexps'\napplies to the file in question, the file is not scanned for\nlocal variables, but directory-local variables may still be applied." #<bytecode -0x1335cba3>) no-mode)
  (funcall #f(compiled-function (&optional handle-mode) "Parse and put into effect this buffer's local variables spec.\nFor buffers visiting files, also puts into effect directory-local\nvariables.\nUses `hack-local-variables-apply' to apply the variables.\n\nIf HANDLE-MODE is nil, we apply all the specified local\nvariables.  If HANDLE-MODE is neither nil nor t, we do the same,\nexcept that any settings of `mode' are ignored.\n\nIf HANDLE-MODE is t, all we do is check whether a \"mode:\"\nis specified, and return the corresponding mode symbol, or nil.\nIn this case, we try to ignore minor-modes, and return only a\nmajor-mode.\n\nIf `enable-local-variables' or `local-enable-local-variables' is nil,\nthis function does nothing.  If `inhibit-local-variables-regexps'\napplies to the file in question, the file is not scanned for\nlocal variables, but directory-local variables may still be applied." #<bytecode -0x1335cba3>) no-mode)
  (with-no-warnings (funcall ad--addoit-function handle-mode))
  (setq ad-return-value (with-no-warnings (funcall ad--addoit-function handle-mode)))
  (let (ad-return-value) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function handle-mode))) (when handle-mode (setq so-long-mode--inhibited ad-return-value)) ad-return-value)
  (ad-Advice-hack-local-variables #f(compiled-function (&optional handle-mode) "Parse and put into effect this buffer's local variables spec.\nFor buffers visiting files, also puts into effect directory-local\nvariables.\nUses `hack-local-variables-apply' to apply the variables.\n\nIf HANDLE-MODE is nil, we apply all the specified local\nvariables.  If HANDLE-MODE is neither nil nor t, we do the same,\nexcept that any settings of `mode' are ignored.\n\nIf HANDLE-MODE is t, all we do is check whether a \"mode:\"\nis specified, and return the corresponding mode symbol, or nil.\nIn this case, we try to ignore minor-modes, and return only a\nmajor-mode.\n\nIf `enable-local-variables' or `local-enable-local-variables' is nil,\nthis function does nothing.  If `inhibit-local-variables-regexps'\napplies to the file in question, the file is not scanned for\nlocal variables, but directory-local variables may still be applied." #<bytecode -0x1335cba3>) no-mode)
  (apply ad-Advice-hack-local-variables #f(compiled-function (&optional handle-mode) "Parse and put into effect this buffer's local variables spec.\nFor buffers visiting files, also puts into effect directory-local\nvariables.\nUses `hack-local-variables-apply' to apply the variables.\n\nIf HANDLE-MODE is nil, we apply all the specified local\nvariables.  If HANDLE-MODE is neither nil nor t, we do the same,\nexcept that any settings of `mode' are ignored.\n\nIf HANDLE-MODE is t, all we do is check whether a \"mode:\"\nis specified, and return the corresponding mode symbol, or nil.\nIn this case, we try to ignore minor-modes, and return only a\nmajor-mode.\n\nIf `enable-local-variables' or `local-enable-local-variables' is nil,\nthis function does nothing.  If `inhibit-local-variables-regexps'\napplies to the file in question, the file is not scanned for\nlocal variables, but directory-local variables may still be applied." #<bytecode -0x1335cba3>) no-mode)
  (hack-local-variables no-mode)
  (run-mode-hooks org-mode-hook)
  (org-mode)
  (set-auto-mode-0 org-mode nil)
  (#f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode -0x133408cd>) nil)
  (funcall #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode -0x133408cd>) nil)
  (with-no-warnings (funcall ad--addoit-function keep-mode-if-same))
  (setq ad-return-value (with-no-warnings (funcall ad--addoit-function keep-mode-if-same)))
  (progn (setq so-long-mode--inhibited nil) (when so-long-mode-enabled (so-long-check-header-modes)) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function keep-mode-if-same))) (when so-long-mode-enabled (unless so-long-mode--inhibited (when (and (apply 'derived-mode-p so-long-target-modes) (so-long-line-detected-p)) (setq so-long-original-mode major-mode) (so-long-mode)))))
  (let (ad-return-value) (progn (setq so-long-mode--inhibited nil) (when so-long-mode-enabled (so-long-check-header-modes)) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function keep-mode-if-same))) (when so-long-mode-enabled (unless so-long-mode--inhibited (when (and (apply 'derived-mode-p so-long-target-modes) (so-long-line-detected-p)) (setq so-long-original-mode major-mode) (so-long-mode))))) ad-return-value)
  (ad-Advice-set-auto-mode #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode -0x133408cd>))
  (apply ad-Advice-set-auto-mode #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode -0x133408cd>) nil)
  (set-auto-mode)
  (normal-mode t)
  (after-find-file nil t)
  (find-file-noselect-1 #<buffer data.org.gpg> "~/.emacs-files/secure/data.org.gpg" nil nil "~/.emacs-files/secure/data.org.gpg" (655687 2049))
  (find-file-noselect "~/.emacs-files/secure/data.org.gpg")
  (bookmark-default-handler ("data.org.gpg" (filename . "~/.emacs-files/secure/data.org.gpg") (front-context-string . "#+TITLE:     Dat") (rear-context-string) (position . 1) (annotation . "Author: Colin Baxter <redknight@bluestar>\nDate:   ...")))
  (bookmark-handle-bookmark "data.org.gpg")
  (bookmark--jump-via "data.org.gpg" pop-to-buffer-same-window)
  (bookmark-jump "data.org.gpg")
  (bookmark-bmenu-this-window)
  (funcall-interactively bookmark-bmenu-this-window)
  (call-interactively bookmark-bmenu-this-window nil nil)
  (command-execute bookmark-bmenu-this-window)


Best wishes,



             reply	other threads:[~2021-02-15 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 13:38 Colin Baxter [this message]
2021-02-15 14:01 ` encryption problems using org-mode Robert Pluim
2021-02-15 14:52   ` Colin Baxter
2021-02-15 15:07     ` Ihor Radchenko
2021-02-15 18:11       ` Colin Baxter
2021-02-15 14:08 ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735xxxxgd.fsf@yandex.com \
    --to=m43cap@yandex.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).