[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] put `org-attach-after-change-hook` at the end of org-attach
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] put `org-attach-after-change-hook` at the end of org-attach |
Date: |
Sun, 22 Sep 2024 16:27:21 +0000 |
"Christopher M. Miles" <numbchild@gmail.com> writes:
> Subject: [PATCH] org-attach.el: put org-attach-after-change-hook at the end
>
> lisp/org-attach.el (org-attach-attach): Put org-attach-after-change-hook
> at the end to make sure user can access attach link in org-store-links.
I have no problem with the change, but I'd like to point out that link
may or may not be present in the list of stored links depending on
`org-attach-store-link-p'. So, checking stored links from the hook is
unreliable.
And remember that `org-attach-after-change-hook' may be called in other
scenarios; not necessarily when a new file is attached.
Instead, it might make more sense to pass the information about file
changes (if available) to the hook itself directly.
For example, we may obsolete `org-attach-after-change-hook' and introduce
`org-attach-after-change-functions'. Then, we pass attachment dir +
list of changed files to that new abnormal hook.
WDYT?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>