Created
February 25, 2021 19:10
-
-
Save shapr/71e1019f2fcf722e57e8672fd725d0e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; useful trick from https://www.reddit.com/r/emacs/comments/idz35e/emacs_27_can_take_svg_screenshots_of_itself/ | |
(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))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment