]> git.donarmstrong.com Git - lib.git/commitdiff
add insert screenshot command
authorDon Armstrong <don@donarmstrong.com>
Thu, 28 May 2015 16:33:35 +0000 (09:33 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 28 May 2015 16:33:35 +0000 (09:33 -0700)
emacs_el/configuration/org-mode-configuration.el

index 4d8e1ab63cd211676f2bab10c07c20a1f094ded3..552b08ec5012f73139f05d1278d4f07f476c9667 100644 (file)
@@ -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))