From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#57781: missing wallpaper command Date: Sun, 18 Sep 2022 03:33:09 +0000 Message-ID: <87bkrds5z5.fsf@posteo.net> References: <87fsgvc938.fsf@web.de> <87illpubzu.fsf@melete.silentflame.com> <87a671h861.fsf@web.de> <87mtaz8gin.fsf@posteo.net> <87tu56zfn3.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34844"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57781@debbugs.gnu.org, Felix , Sean Whitton To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 18 05:44:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oZlE8-0008tY-PO for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Sep 2022 05:44:16 +0200 Original-Received: from localhost ([::1]:42278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZlE7-0001mq-1h for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 23:44:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZlDu-0001me-Cb for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 23:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZlDu-0006Mf-2G for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 23:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZlDt-0001g9-NP for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 23:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Sep 2022 03:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57781 X-GNU-PR-Package: emacs Original-Received: via spool by 57781-submit@debbugs.gnu.org id=B57781.16634725896383 (code B ref 57781); Sun, 18 Sep 2022 03:44:01 +0000 Original-Received: (at 57781) by debbugs.gnu.org; 18 Sep 2022 03:43:09 +0000 Original-Received: from localhost ([127.0.0.1]:47490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZlD3-0001et-Ai for submit@debbugs.gnu.org; Sat, 17 Sep 2022 23:43:09 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:59687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZlD0-0001eR-QF for 57781@debbugs.gnu.org; Sat, 17 Sep 2022 23:43:08 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E1B98240103 for <57781@debbugs.gnu.org>; Sun, 18 Sep 2022 05:42:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663472580; bh=CsCrgZ/HayJmemAgeqZYLURmUZR40MGN0JRD/OMdAdc=; h=From:To:Cc:Subject:Date:Autocrypt:OpenPGP:From; b=m9QGdnWMECX+1D6GDs0vQ4Ey16L2f7mpFqc0J6YrnSr+STqZvgztff3XFQVyW4bK1 MluxxyJA6+grTF7+1RA5Fx0ii1MZ9rTO1Anr7cU7HXhAa8GSLy+fuaMh/OpLl+OoHS WxKaM5HVE2lvmX3PV0gHTI3LaPBkcYd2NCIpd+OzeFstyUjFYVNg706oHHRihLLcro uZveubbrvZLDUrjVg+AxnTV3gNBehqnZLeI51NrsylI1w00RcnyOf9sAXtgYViFdgu UK5FFf48OB6I9/+BphzG0RHG9GHjE/dtqH49v/WPwLb18xeWJEjohhgThk+atiaDty In2du1+ts8Myg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVYYD4zXWz9rxF; Sun, 18 Sep 2022 05:42:56 +0200 (CEST) In-reply-to: Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata= mQGNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA AbQSdGhpZXZvbEBwb3N0ZW8ubmV0iQHOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQa OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242915 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Kangas writes: > Thierry Volpiatto 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) This assume you have an image at point, if not when cycling with M-n in defaults the first M-n hit will show a non filename i.e. your current buffer-file-name. >> 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-us= ed)))) >> + wallpaper-last-used t nil >> (lambda (fn) >> (or (file-directory-p fn) >> (string-match (image-file-na= me-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) =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmMmk74THHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk6TPC/9cJd6B3tQhQQJiMLxa2J6uHMfJTlHP P/hcLQ/sUTiT567arHZ0vogGp2E2k1/K2ZybUBzmdUzNwjYuFLwmAyVUhy3hpyRy 5TSOy7nC65X65udAL4d6T2qpPnkRsHou83Fm4+BMbnfpwmwaJfFGnm4TMK6I+vD4 8Z35droMuwx/ZcVhZYSMoBfG347wzQholn/mOPDcrbZDLv/1aNFD6hZxGtNrND5u AQmW2QVkCWdkRRDt+Pk0sGu7gYCoOKAutVgdc2dNBcD1cpXPXA1tQRFhFkoKmXfS pPkgx+FL7osQltUn7oVHBh8J07npD6mp3FDgtXbmHDFAZhTogOqllPw3MGP0IVUj 0XLa/vBN7R4sVuMnADB5dvHcq7Ud1k0/OlzeUrMyJyCufsHRsQ9qrBDCRA2EO+wy Hib14SuPIiEaHsmGdtcHs7LquWW9jGsGYq9t9MaOwcdhKozJ3B3OwH6Y34NFF1ET z8Doc7E85EduXnmP0l/3vvRIhUJ3ermfcYg= =ekiN -----END PGP SIGNATURE----- --=-=-=--