Ensure org-password-manager only checks for properties when in Org

This surpresses warnings like

> Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode)

among others.
This commit is contained in:
Daniel Borchmann 2024-06-19 16:45:01 +02:00
parent f196d6e808
commit e84b4fb825
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625

View File

@ -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)))