From b71241742ca825c23063c22dcb205e95ac0fd710 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Sep 2022 20:09:01 +0200 Subject: [PATCH] Prompt for wallpaper width/height only when needed * lisp/image/wallpaper.el (wallpaper--format-arg): Don't prompt for width and height unless the values are actually used. --- lisp/image/wallpaper.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el index 0a891f9012a..3b32c5a4156 100644 --- a/lisp/image/wallpaper.el +++ b/lisp/image/wallpaper.el @@ -405,14 +405,16 @@ FILE is the image file name." (?F . ,(mapconcat #'url-hexify-string (file-name-split file) "/")) - (?h . ,(wallpaper--get-height-or-width - "height" - #'display-pixel-height - wallpaper-default-height)) - (?w . ,(wallpaper--get-height-or-width - "width" - #'display-pixel-width - wallpaper-default-width)) + (?h . ,(lambda () + (wallpaper--get-height-or-width + "height" + #'display-pixel-height + wallpaper-default-height))) + (?w . ,(lambda () + (wallpaper--get-height-or-width + "width" + #'display-pixel-width + wallpaper-default-width))) ;; screen number (?S . ,(let ((display (frame-parameter (selected-frame) 'display))) (if (and display -- 2.39.2