Don't rely on defun returning function symbol

This is undocumented behaviour.
This commit is contained in:
TEC 2023-01-20 19:23:33 +08:00
parent 6df63e7616
commit e08e342fe4
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 5 additions and 2 deletions

View File

@ -399,13 +399,16 @@ More specifically, this function will:
(defcustom screenshot-post-process-hook
(when (executable-find "pngquant")
(list (defun screenshot--compress-file (file)
(call-process "pngquant" nil nil nil "-f" "-o" file file))))
(list #'screenshot--compress-file))
"Functions to be called on the output file after processing.
Must take a single argument, the file name, and operate in-place."
:type 'function
:group 'screenshot)
(defun screenshot--compress-file (file)
"Compress FILE with pngquant."
(call-process "pngquant" nil nil nil "--force" "--skip-if-larger" "--output" file file))
(defun screenshot--post-process (file)
"Apply any image post-processing to FILE."
(when (or (> screenshot-radius 0)