Hi all,
sorry for the delay.
here is a step-by-step recipe:
start emacs: emacs -Q -l the-following-el
------
(setq tr/org-attachments-directory (concat (file-name-as-directory
org-directory) "attachments/"))
(setq-default org-attach-id-dir tr/org-attachments-directory)
(setq org-id-method 'ts)
(setq org-id-ts-format "%Y%m%dT%H%M%S")
(defun tr/org-attach-id-ts-folder-format (id)
"Translate an ID based on a timestamp to a folder-path.
Useful way of translation if ID is generated based on ISO8601
timestamp. Splits the attachment folder hierarchy into
year-month, the rest."
(and (< 4 (length id))
(format "%s/%s"
(substring id 0 4)
(substring id 4))))
(setq org-attach-id-to-path-function-list
'(tr/org-attach-id-ts-folder-format
org-attach-id-ts-folder-format
org-attach-id-uuid-folder-format))
(defun tr/org-yank-image-autogen-filename ()
"Autogenerate filename for image in clipboard."
(format-time-string "%Y%m%dT%H%M%S"))
(when (>= emacs-major-version 30)
(setq org-yank-dnd-method 'attach)
(setq org-yank-image-file-name-function
'tr/org-yank-image-autogen-filename)
(setq org-yank-dnd-default-attach-method 'cp)
(setq org-yank-image-save-method tr/org-attachments-directory))
------
- Then in the scratch-buffer in org-mode, drag and drop a
previously not attached image.
-> Everything works fine; link to image in attachments folder is
created.
- Drag and drop the same image again.
-> Error: (file-already-exists File already exists
/<org-directory>/attachments/<file-name>)
I hope this helps!
Best
Tom
-------- Original Message ---------
From: visuwe...@gmail.com
To: yanta...@posteo.net
Cc: thomas.ramsa...@posteo.de, 78...@debbugs.gnu.org,
emacs-orgmode@gnu.org
Subject: Re: bug#78037: 30.1; Insert link when using org-yank
regardless if file already exists
[ஞாயிறு ஜூன் 08, 2025] Ihor Radchenko wrote:
Ihor Radchenko <yanta...@posteo.net> writes:
Visuwesh <visuwe...@gmail.com> writes:
Visuwesh, could you take a look?
I have multiple deadlines to meet. Once I'm relatively free,
I can take
a closer look at this.
Sure. There is no rush.
It has been over a month, so a gentle ping :)
Hi, sorry for the general lack of activity.
I forgot what made sense to me about the bug, and re-reading the
report
does not seem to help. It would be nice if Thomas could provide
a
step-by-step reproduction recipe from emacs -Q, especially with
[1] in
the mix (which I am not sure how to handle either).
1.
https://yhetil.org/orgmode/CAL1eYuJ0=kvzUPQK80+3g=fc6ovyexbdwga5av0nr02myib...@mail.gmail.com/