Paste an image on clipboard to Emacs Org mode file without saving it

The exact functionality you want isn’t currently implemented, but I would be skeptical of saving lots of images into a research log if your opinion is that you “definitely don’t want to save them.”

Anyways, the functionality you desire has been expressed in the org-mode mailing list a couple of times in recent years – check

The first link includes some code to launch a screenshot utility (via ImageMagick) to [uniquely] save the file and insert an inline link in your org-mode buffer.

As stated in that thread, the code was improved upon and added to org-mode hacks page – which has lots of useful gems:

(defun my-org-screenshot ()
  "Take a screenshot into a time stamped unique-named file in the
same directory as the org-buffer and insert a link to this file."
  (setq filename
          (concat (buffer-file-name)
                  (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
  (call-process "import" nil nil nil filename)
  (insert (concat "[[" filename "]]"))

Leave a Comment