emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773


From: Visuwesh
Subject: Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]
Date: Sun, 08 Oct 2023 16:51:11 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

[ஞாயிறு அக்டோபர் 08, 2023] Ihor Radchenko wrote:

> Visuwesh <visuweshm@gmail.com> writes:
>
>> This was far easier than I initially thought.  Patch attached.
>
> Thanks!
> I tried to install the patch and I have two more comments.
>
>> +(defun org-yank-image-autogen-filename ()
>> +  "Autogenerate filename for image in clipboard."
>> +  (format-time-string "clipboard-%Y-%m-%d-%H:%M"))
>
> This is too coarse - no more than a single unique image name per minute.
> What about the default value of `org-id-ts-format' - "%Y%m%dT%H%M%S.%6N"?
> This is guaranteed to be unique.

OK, now done.

>> +(defun org--image-yank-media-handler (mimetype data)
>> +  "Save image DATA of mime-type MIMETYPE and insert link at point.
>> +It is saved as per `org-yank-image-save-type'.  The name for the
>> +image is prompted and the extension is automatically added to the
>> +end."
>> ...
>> +    (if (null (eq org-yank-image-save-type 'attach))
>> +        (setq link (org-link-make-string
>> +                    (concat "file:" (file-relative-name absname))
>> +                    filename))
>
> I do not like that the inserted image link is with description. Images
> with description cannot be previewed by default. I think that no
> description would be more handy as one could then M-x yank-media
> followed by M-x org-display-inline-images to see the inserted image
> immediately.

I didn't know about this.  Now adjusted in the attached patch.

Attachment: 0001-Add-support-for-yank-media-and-DND.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]