Add SVG screenshot function
This commit is contained in:
parent
ecff140c8d
commit
04c85f3386
19
config.org
19
config.org
|
@ -3,6 +3,7 @@
|
|||
- [[#misc][Misc]]
|
||||
- [[#lexical-bindings][Lexical bindings]]
|
||||
- [[#dir-local-variables][Dir local variables]]
|
||||
- [[#taking-svg-screenshots][Taking SVG screenshots]]
|
||||
- [[#theme][Theme]]
|
||||
- [[#main-theme][Main theme]]
|
||||
- [[#dark-theme-toggle][Dark theme toggle]]
|
||||
|
@ -57,6 +58,24 @@ some projects.
|
|||
(setq enable-dir-local-variables nil)
|
||||
#+END_SRC
|
||||
|
||||
** Taking SVG screenshots
|
||||
|
||||
Since Emacs 27, we can take SVG screenshots! Emacs needs to be built with
|
||||
=cairo= to support this.
|
||||
|
||||
#+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
|
||||
|
||||
* Theme
|
||||
|
||||
** Main theme
|
||||
|
|
Loading…
Reference in a new issue