unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Thierry Volpiatto <thievol@posteo.net>
Cc: 57781@debbugs.gnu.org, Felix <felix.dick@web.de>,
	Sean Whitton <spwhitton@spwhitton.name>
Subject: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 14:34:50 -0400	[thread overview]
Message-ID: <CADwFkmkOxQV2i9k2RgZXwsCgfiN4fKZG20ip1K1Ax60u6_u_5w@mail.gmail.com> (raw)
In-Reply-To: <87tu56zfn3.fsf@posteo.net>

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	other threads:[~2022-09-17 18:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 20:20 bug#57781: missing wallpaper command Felix
2022-09-14  5:41 ` Stefan Kangas
2022-09-14 17:00   ` Sean Whitton
2022-09-14 22:51     ` Stefan Kangas
2022-09-14 22:51       ` Felix
2022-09-14 23:22         ` Stefan Kangas
2022-09-15  9:47           ` Felix
2022-09-16 21:09             ` Stefan Kangas
2022-09-17 12:00               ` Felix
2022-09-17 17:48                 ` Stefan Kangas
2022-09-18 11:16                   ` Felix
2022-09-19  9:40                     ` Stefan Kangas
2022-09-18 22:19                   ` Felix
2022-09-19  9:40                     ` Stefan Kangas
2022-09-19 17:19                       ` Felix
2022-09-19 19:16                         ` Stefan Kangas
2022-09-19 19:26                           ` Felix
2022-09-19 20:07                             ` Stefan Kangas
2022-09-19 21:04                               ` Felix
2022-09-15 10:37           ` Felix
2022-09-16 21:09             ` Stefan Kangas
2022-09-16 15:50           ` Thierry Volpiatto
2022-09-16 20:52             ` Stefan Kangas
2022-09-17  6:14               ` Thierry Volpiatto
2022-09-17 18:34                 ` Stefan Kangas [this message]
2022-09-18  3:33                   ` Thierry Volpiatto
2022-10-04  5:58         ` Stefan Kangas
     [not found]           ` <87v8owv8lc.fsf@web.de>
2022-10-07  9:08             ` Stefan Kangas
2022-10-07 19:55               ` Felix
2022-10-07 20:16                 ` Stefan Kangas
2022-09-14 23:25       ` Sean Whitton
2022-09-14 13:50 ` bug#57781: wbg " Felix
2022-09-14 16:27   ` Stefan Kangas
2022-09-14 20:01     ` Felix
2022-09-14 23:06       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmkOxQV2i9k2RgZXwsCgfiN4fKZG20ip1K1Ax60u6_u_5w@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=57781@debbugs.gnu.org \
    --cc=felix.dick@web.de \
    --cc=spwhitton@spwhitton.name \
    --cc=thievol@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).