emacs-devel
[Top][All Lists]
Advanced

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

Re: New library wallpaper.el pushed to master


From: Eli Zaretskii
Subject: Re: New library wallpaper.el pushed to master
Date: Tue, 13 Sep 2022 20:22:08 +0300

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Tue, 13 Sep 2022 13:09:48 -0400
> Cc: emacs-devel@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:

I though that would be considered unclean, given that you deployed the
cl-defgeneric machinery there.  At the very least, it would mean w32
users will not be able to use external programs to do the job, even if
they do have such a program.  Is that acceptable?

> -  (when (display-graphic-p)
> +  (cond
> +   (w32-use-native-image-API (w32-wallpaper-set file))
> +   ((display-graphic-p)

Btw, w32-use-native-image-API has nothing to do with this feature.

Also, the display-graphic-p requirement is IMO a gratuitous
restriction, since one can invoke these external programs from an
Emacs running in a terminal emulator as well, I presume.  The reason
you needed display-graphic-p is that you rely on display-pixel-height,
but is that really such an important requirement? why not let people
specify the height manually?

> > 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.

I actually thought about computing the value of the defcustom
dynamically at run time, trying each candidate until one is found.
The template for the command's arguments doesn't need to be in the
value, you can use a separate default template for each executable.
Then all users will have to do is to specify a name of a program, and
perhaps a few optional command-line switches.



reply via email to

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