From ba0cec6d41b9f8c431c0780b656dcb2a33f42dc2 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 28 May 2015 09:33:35 -0700 Subject: [PATCH] add insert screenshot command --- .../configuration/org-mode-configuration.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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)) -- 2.39.5