From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: New library wallpaper.el pushed to master Date: Tue, 13 Sep 2022 20:22:08 +0300 Message-ID: <835yhr42bj.fsf@gnu.org> References: <837d2743lt.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 13 19:23:32 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oY9dB-0005i6-L2 for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Sep 2022 19:23:29 +0200 Original-Received: from localhost ([::1]:37956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY9dA-00078v-Ov for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Sep 2022 13:23:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY9c5-0006Oy-I6 for emacs-devel@gnu.org; Tue, 13 Sep 2022 13:22:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY9c5-0006Cz-9b; Tue, 13 Sep 2022 13:22:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EzaZ+0Dw2datcvZ2uUKrKQYnqIegOHGqoaEOEalzAj0=; b=d/x/3lcOD+/p sN+T3i6BQAc/oeWFFyESOWblPsHHaxjFupHTkalw0xPDSTDtqQ2IZt5joRdU8yKUmHLwZGclj2Oub 2pWDE6eR7Lou0cQt8fTORSoLcrneT6phouJ/jXuhGLNbS/kqrFgoHuz7NTKM8wwLxA+jUAn7E4CLR nkXfOxg7K5sE3++scEGfwwHeIESG80BGClklgbiqkQtmFnIJ/Sgmc5azE7pway244Rl0Xf6Vc23jI VBWToZZfzdRkduqVyMPyWVywKh5vcBUpho8i2NGJEhbHp15tNNqxIBza0wlBUtvUdvYOZtnIRnrdN xgAP0Omechp/RYNmd+2GeA==; Original-Received: from [87.69.77.57] (port=2660 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY9c4-0001xN-Ow; Tue, 13 Sep 2022 13:22:21 -0400 In-Reply-To: (message from Stefan Kangas on Tue, 13 Sep 2022 13:09:48 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295268 Archived-At: > From: Stefan Kangas > Date: Tue, 13 Sep 2022 13:09:48 -0400 > Cc: emacs-devel@gnu.org > > Eli Zaretskii 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.