News for hackers. Stuff that matters.
Re:Org-mode 9.4 is out. Can you help? by proxygeek on Monday September 14, 2020 @01:47PM (#24472954)
If you use it on Windows and have Itfanview installed, here's is how you can do it to copy paste images from clipboard using C-c-s

(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." (interactive) (setq screenshot_dir ".\\images\\") (setq tilde-buffer-filename (replace-regexp-in-string "/" "\\" (buffer-name) t t)) (setq filename (concat (make-temp-name (concat screenshot_dir tilde-buffer-filename ;; attempt to make irfanview approach work "_" (format-time-string "%Y%m%d_%H%M%S_")) ) ".png")) (insert (concat "[[file:" filename "]]")) (org-display-inline-images))

(global-set-key "\C-cs" 'my-org-screenshot)

Re:Org-mode 9.4 is out. Can you help? by boogies on Monday September 14, 2020 @02:15PM (#24473282)
Could you indent your Lisp by four spaces for formatting?

    (Like this)
Re:Org-mode 9.4 is out. Can you help? by dan-robertson on Monday September 14, 2020 @02:49PM (#24473643)
On HN you only indent two spaces to turn on monospace.

Here is the lisp with formatting:

  (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."
    (interactive)
    (setq screenshot_dir ".\\images\\")
    (setq tilde-buffer-filename
          (replace-regexp-in-string "/" "\\" (buffer-name) t t))
    (setq filename
          (concat
            (make-temp-name
              (concat screenshot_dir
                      tilde-buffer-filename ;; attempt to make irfanview approach work
                      "_"
                      (format-time-string "%Y%m%d_%H%M%S_")))
            ".png"))
    (insert (concat "[[file:" filename "]]"))
    (org-display-inline-images))
Re:Org-mode 9.4 is out. Can you help? by vz8 on Monday September 14, 2020 @02:38PM (#24473525)
Did you mean Irfanview?

Thanks for the tip. Mostly emacsing via X, but good to know.