all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: New library wallpaper.el pushed to master
Date: Tue, 13 Sep 2022 13:09:48 -0400	[thread overview]
Message-ID: <CADwFkmkb+sK1mC_X67wXG9KMD4-MfB3OV8FSSX7xbHptuPFBiw@mail.gmail.com> (raw)
In-Reply-To: <837d2743lt.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

> From casual reading, the code seems to be heavily biased towards the
> assumption that setting a wallpaper requires invoking an external
> program.  What about systems where this can be done by calling an API
> (i.e., via a special-purpose Emacs primitive)?  Would you please amend
> the code to make the feature more easily extended to use such methods?

I'm assuming you mean something like this

    (w32-wallpaper-set file)

?

If so, besides documentation changes, I imagine that all we would need
is something like:

diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index 4c90559183..acc2f11420 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -115,7 +115,9 @@ wallpaper-set
     (error "No such file: %s" file))
   (unless (file-readable-p file)
     (error "File is not readable: %s" file))
-  (when (display-graphic-p)
+  (cond
+   (w32-use-native-image-API (w32-wallpaper-set file))
+   ((display-graphic-p)
     (let* ((command (wallpaper--find-command))
            (fmt-spec `((?f . ,(expand-file-name file))
                        (?h . ,(display-pixel-height))
@@ -141,7 +143,7 @@ wallpaper-set
                                (string-clean-whitespace (buffer-string)))))
                 (ignore-errors
                   (kill-buffer (process-buffer process))))))
-      process)))
+      process))))

 (provide 'wallpaper)

> In addition, are you sure it is a good idea to have a defcustom whose
> value is list of lists of strings?  Users who wish to customize this
> will have hard time, unless they are very proficient ion Emacs Lisp.
> Can we come up with a defcustom that is easier to customize?

I was actually going back and forth on this.

Could we change it into a list of strings, thereby assuming that you
won't need to specify any command line arguments containing spaces?
If so, I think that would be more user friendly.

Thanks for reviewing!



  reply	other threads:[~2022-09-13 17:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 16:41 desktop-background.el as a new library? Stefan Kangas
2021-10-27 19:02 ` Tassilo Horn
2021-10-27 19:51   ` Stefan Kangas
2021-10-28  2:36     ` Po Lu
2021-10-29 17:26 ` Arthur Miller
2021-10-29 17:44   ` Stefan Kangas
2021-11-15 20:51     ` Arthur Miller
2022-09-13 16:28 ` New library wallpaper.el pushed to master Stefan Kangas
2022-09-13 16:54   ` Eli Zaretskii
2022-09-13 17:09     ` Stefan Kangas [this message]
2022-09-13 17:22       ` Eli Zaretskii
2022-09-14  7:13         ` Stefan Kangas
2022-09-14  7:36           ` Stefan Kangas
2022-09-14  7:36           ` Po Lu
2022-09-14 11:10           ` Stefan Kangas
2022-09-14 11:44           ` Eli Zaretskii
2022-09-14 12:01             ` Stefan Kangas
2022-09-15 16:48               ` Stefan Kangas
2022-09-15 11:59           ` Eli Zaretskii
2022-09-15 13:39             ` Po Lu
2022-09-15 13:44               ` Eli Zaretskii
2022-09-15 13:49                 ` Po Lu
2022-09-14  2:46   ` Po Lu
2022-09-14  6:39     ` Po Lu
2022-09-14  7:04       ` Stefan Kangas
2022-09-14  7:33         ` Po Lu
2022-09-14 11:53           ` Stefan Kangas
2022-09-14 12:30             ` Stefan Kangas
2022-09-14 13:42             ` Po Lu
2022-09-14 16:58           ` Sean Whitton
2022-09-15  7:28             ` Stefan Kangas
2022-09-15 16:19               ` Sean Whitton
2022-09-16  1:27                 ` Po Lu
2022-09-14 11:39       ` Eli Zaretskii
2022-09-14 11:52         ` Stefan Kangas
2022-09-14 12:01           ` Eli Zaretskii
2022-09-14 12:07             ` Stefan Kangas
2022-09-14 12:24             ` Po Lu
2022-09-14 12:41               ` 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

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

  git send-email \
    --in-reply-to=CADwFkmkb+sK1mC_X67wXG9KMD4-MfB3OV8FSSX7xbHptuPFBiw@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.