diff options
-rw-r--r-- | shoshimacs.el | 11 | ||||
-rw-r--r-- | shoshimacs.org | 15 |
2 files changed, 26 insertions, 0 deletions
diff --git a/shoshimacs.el b/shoshimacs.el index 4a0cdba..3d5659c 100644 --- a/shoshimacs.el +++ b/shoshimacs.el @@ -276,4 +276,15 @@ (package-install 'autothemer) +(defun screenshot-svg () + "Save a screenshot of the current frame as an SVG image. +Saves to a temp file and puts the filename in the kill ring." + (interactive) + (let* ((filename (make-temp-file "Emacs" nil ".svg")) + (data (x-export-frames nil 'svg))) + (with-temp-file filename + (insert data)) + (kill-new filename) + (message filename))) + (package-install 'windresize) diff --git a/shoshimacs.org b/shoshimacs.org index cc1529e..d58220a 100644 --- a/shoshimacs.org +++ b/shoshimacs.org @@ -1031,6 +1031,21 @@ for theme development. (package-install 'autothemer) #+end_src +** SVG Screenshot + +#+begin_src emacs-lisp +(defun screenshot-svg () + "Save a screenshot of the current frame as an SVG image. +Saves to a temp file and puts the filename in the kill ring." + (interactive) + (let* ((filename (make-temp-file "Emacs" nil ".svg")) + (data (x-export-frames nil 'svg))) + (with-temp-file filename + (insert data)) + (kill-new filename) + (message filename))) +#+end_src + ** windresize #+begin_src emacs-lisp |