[ஞாயிறு அக்டோபர் 08, 2023] Ihor Radchenko wrote: > Visuwesh 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.