bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57781: missing wallpaper command


From: Stefan Kangas
Subject: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 14:34:50 -0400

Thierry Volpiatto <thievol@posteo.net> writes:

> The xconf-query command is detected and working fine, thanks.
> Perhaps you can store last wallpapers used and use it as default for the
> read-file-name?
> Something like this:

Hmm, maybe.  But shouldn't the default rather be something like
`ffap-file-at-point'?  Or maybe even

    (cons (ffap-file-at-point) wallpaper-last-used)

?

> diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
> index 4572a8c0628..8426fc4b126 100644
> --- a/lisp/image/wallpaper.el
> +++ b/lisp/image/wallpaper.el
> @@ -227,6 +227,8 @@ See also `wallpaper-default-height'.")
>  This is only used when it can't be detected automatically.
>  See also `wallpaper-default-width'.")
>
> +(defvar wallpaper-last-used nil)
> +
>  (defun wallpaper--get-height-or-width (desc fun default)
>    (if (display-graphic-p)
>        (funcall fun)
> @@ -246,7 +248,10 @@ options `wallpaper-command' and `wallpaper-command-args'.
>  On MS-Windows and Haiku systems, no external command is needed,
>  so the value of `wallpaper-commands' is ignored."
>    (interactive (list (read-file-name "Set desktop background to: "
> -                                     default-directory nil t nil
> +                                     (and wallpaper-last-used
> +                                          (file-name-directory
> +                                           (car (last wallpaper-last-used))))
> +                                     wallpaper-last-used t nil
>                                       (lambda (fn)
>                                         (or (file-directory-p fn)
>                                             (string-match 
> (image-file-name-regexp) fn))))))
> @@ -257,6 +262,7 @@ so the value of `wallpaper-commands' is ignored."
>    (unless (file-readable-p file)
>      (error "File is not readable: %s" file))
>    (wallpaper-debug "Using image %S:" file)
> +  (push file wallpaper-last-used)
>    (cond ((eq system-type 'windows-nt)
>           (w32-set-wallpaper file))
>          ((featurep 'haiku)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]