Created
November 25, 2024 20:30
-
-
Save shapr/51e046aaf4cca0c9423bc02977ace469 to your computer and use it in GitHub Desktop.
emacs can write out an SVG of the current frame, but requires X11 !
This file contains 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
(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))) | |
(define-key global-map [(super s)] 'screenshot-svg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment