From e84b4fb82599d187605adb2602c6d04b2c70cdc5 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 19 Jun 2024 16:45:01 +0200 Subject: [PATCH] Ensure `org-password-manager` only checks for properties when in Org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This surpresses warnings like > Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer # (org-agenda-mode) among others. --- site-lisp/org-password-manager.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site-lisp/org-password-manager.el b/site-lisp/org-password-manager.el index 3ddffa7..32b2389 100644 --- a/site-lisp/org-password-manager.el +++ b/site-lisp/org-password-manager.el @@ -169,7 +169,8 @@ the `agenda' scope searches through all agenda files." If ASK-FOR-INPUT? is t, will ask for input even if point is on a heading that contains the property." (let ((display-property-name (capitalize property-name)) - (property (org-entry-get (point) property-name t)) + (property (when (derived-mode-p 'org-mode) + (org-entry-get (point) property-name t))) output-message heading) (if (and property (not ask-for-input?)) (setq heading (org-link-display-format (org-get-heading t t)))