From: Don Armstrong Date: Thu, 28 May 2015 16:33:35 +0000 (-0700) Subject: add insert screenshot command X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ba0cec6d41b9f8c431c0780b656dcb2a33f42dc2;p=lib.git add insert screenshot command --- diff --git a/emacs_el/configuration/org-mode-configuration.el b/emacs_el/configuration/org-mode-configuration.el index 4d8e1ab..552b08e 100644 --- a/emacs_el/configuration/org-mode-configuration.el +++ b/emacs_el/configuration/org-mode-configuration.el @@ -965,3 +965,22 @@ A prefix arg forces clock in of the default task." (setcar org-emphasis-regexp-components "​ [:space:] \t('\"{") (setcar (nthcdr 1 org-emphasis-regexp-components) "​ [:space:]- \t.,:!?;'\")}\\") (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components) + +;; support inserting screen shots +(defun my/org-insert-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) + (defvar filename) + (setq filename + (read-file-name + "Screenshot to insert: " + nil + (concat (buffer-file-name) "_" (format-time-string "%Y%m%d_%H%M%S") ".png") + nil + nil + ) + ) + (call-process "import" nil nil nil filename) + (insert (concat "[[" filename "]]")) + (org-display-inline-images))