Fixup svg screenshot function

This commit is contained in:
Antoine Martin 2022-05-05 14:46:15 +02:00
parent 2010974593
commit 6c250b3259

View file

@ -85,11 +85,11 @@ Since Emacs 27, we can take SVG screenshots! Emacs needs to be built with
=cairo= to support this. =cairo= to support this.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun screenshot-svg () (defun my/screenshot-svg ()
"Save a screenshot of the current frame as an SVG image. "Save a screenshot of the current frame as an SVG image.
Saves to a temp file and puts the filename in the kill ring." Saves to a temp file and puts the filename in the kill ring."
(interactive) (interactive)
(let* ((filename (make-temp-file "Emacs" nil ".svg")) (let ((filename (make-temp-file "Emacs" nil ".svg"))
(data (x-export-frames nil 'svg))) (data (x-export-frames nil 'svg)))
(with-temp-file filename (with-temp-file filename
(insert data)) (insert data))