emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Christopher M. Miles" <numbchild@gmail.com>
To: Org mode mailing list <emacs-orgmode@gnu.org>
Subject: [PATCH] put `org-attach-after-change-hook` at the end of org-attach
Date: Thu, 29 Aug 2024 11:36:28 +0800	[thread overview]
Message-ID: <66d5608d.170a0220.998ef.c484@mx.google.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 147 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-org-attach.el-put-org-attach-after-change-hook-at-th.patch --]
[-- Type: text/x-patch, Size: 1584 bytes --]

From f21ef819ab6670f1ed64a731d5d7b5fb29119f33 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Thu, 29 Aug 2024 11:31:53 +0800
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.
---
 lisp/org-attach.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 7a03d170e..d43cbc74c 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -615,8 +615,6 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from
             (url-copy-file file attach-file)
           (error "The remote resource %S is considered unsafe, and will not be downloaded"
                  file))))
-      (run-hook-with-args 'org-attach-after-change-hook attach-dir)
-      (org-attach-tag)
       (cond ((eq org-attach-store-link-p 'attached)
 	     (push (list (concat "attachment:" (file-name-nondirectory attach-file))
 			 (file-name-nondirectory attach-file))
@@ -629,6 +627,8 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from
 	     (push (list (concat "file:" attach-file)
 			 (file-name-nondirectory attach-file))
 		   org-stored-links)))
+      (run-hook-with-args 'org-attach-after-change-hook attach-dir)
+      (org-attach-tag)
       (if visit-dir
           (dired attach-dir)
         (message "File %S is now an attachment" basename)))))
-- 
2.39.3 (Apple Git-146)


[-- Attachment #1.3: Type: text/plain, Size: 267 bytes --]


-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

                 reply	other threads:[~2024-09-02  6:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=66d5608d.170a0220.998ef.c484@mx.google.com \
    --to=numbchild@gmail.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).