]> git.eshelyaron.com Git - emacs.git/commitdiff
Prompt for wallpaper width/height only when needed
authorStefan Kangas <stefankangas@gmail.com>
Tue, 27 Sep 2022 18:09:01 +0000 (20:09 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Thu, 29 Sep 2022 13:39:58 +0000 (15:39 +0200)
* lisp/image/wallpaper.el (wallpaper--format-arg): Don't prompt for
width and height unless the values are actually used.

lisp/image/wallpaper.el

index 0a891f9012ac044baeec68e3219a040b5c749a11..3b32c5a41565ada4d984e3fc2ac7ad9ae2ea85b0 100644 (file)
@@ -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