From: Ihor Radchenko <yantar92@posteo.net>
To: "Christopher M. Miles" <numbchild@gmail.com>
Cc: Org mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] put `org-attach-after-change-hook` at the end of org-attach
Date: Sun, 22 Sep 2024 16:27:21 +0000 [thread overview]
Message-ID: <87zfnzpsba.fsf@localhost> (raw)
In-Reply-To: <66d5608d.170a0220.998ef.c484@mx.google.com>
"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>
prev parent reply other threads:[~2024-09-22 16:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 3:36 [PATCH] put `org-attach-after-change-hook` at the end of org-attach Christopher M. Miles
2024-09-22 16:27 ` Ihor Radchenko [this message]
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=87zfnzpsba.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=numbchild@gmail.com \
/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).