From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#57781: missing wallpaper command Date: Sat, 17 Sep 2022 14:34:50 -0400 Message-ID: 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: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36071"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57781@debbugs.gnu.org, Felix , Sean Whitton To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 17 20:35:15 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 1oZcep-0009Es-0E for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 20:35:15 +0200 Original-Received: from localhost ([::1]:33600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZceo-000709-4K for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 14:35:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZcec-000701-2T for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 14:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZceb-0003Yk-QC for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 14:35:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZceb-0000jy-Kt for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 14:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 18:35: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.16634396992834 (code B ref 57781); Sat, 17 Sep 2022 18:35:01 +0000 Original-Received: (at 57781) by debbugs.gnu.org; 17 Sep 2022 18:34:59 +0000 Original-Received: from localhost ([127.0.0.1]:47197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZceY-0000je-Ms for submit@debbugs.gnu.org; Sat, 17 Sep 2022 14:34:59 -0400 Original-Received: from mail-oa1-f53.google.com ([209.85.160.53]:41922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZceX-0000jQ-0B for 57781@debbugs.gnu.org; Sat, 17 Sep 2022 14:34:57 -0400 Original-Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-12803ac8113so56577804fac.8 for <57781@debbugs.gnu.org>; Sat, 17 Sep 2022 11:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date; bh=v8SgKxB5kG5/jRu0n60CV0Jl9pYLCLDqKHIWNdP5LEs=; b=MlJp4LdCX8/3kN8Zdl9ow5ro2BrHXgvDUZOXUoxYYwD/M8V4PSSmrKl7rLd2fB5Uru RVjN2gaPKZkd+Yfo3ANBtvpNMRo1OhdEBxaV3pTUxxXRWrJxKEvKXWJKmQDro1DrYyjd q/f8lQ1JzBOCZOJOA43JVLegnFCkdJYN0SmhcLi9Mz1G5kg//G0Vtmu/wfqMRIR9pceB vw1Ub8LyT6qyTxPXmF9tj8ZNhlsATFVlP1cw810QvuRDIgyKnT6U2wUtO6/+xvgpEA/m JqfyKpX66TIcO5bf/5SEmtXgO/d/lIVM47P/uYn80VQ5kPeO5Z+iVpYL3/1Ta4IOjqnA 6UfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date; bh=v8SgKxB5kG5/jRu0n60CV0Jl9pYLCLDqKHIWNdP5LEs=; b=qK29XjSXIarOmxLSc9lQt7GhS+KpHKscbLoqOYlEnIGpK5AxT5YBu+rQ4XrWSNdDGT MRr+ZIxAa/TSJuZESTGtYBzJao9XXlIDT72coU62DU8JOH57KiFFTRRktjkhhZSRe0pe 0mR2DtLYP+sds8qPiiNN5IhS3/lvAwaoNFV0wbJMn26LHGlwmBhbC/vYsvPl11Wb5zax FsNQ402SbGEar/xWdYkPzX5322sHsTuMb7U4wJx5gUwCenm8WbMtAWs5U6lZv1z9YvGM 3dia6lEeaP9E5ojvfIO9tmFCkoTDNZFuh2Fft6q0coaqTHlxazx9fh1Gdnuv8aEQ5mlt CFNA== X-Gm-Message-State: ACgBeo2ylQ17CmCWkB/kAMm6tPR0jWYtrzl6xu/WnI48X1vAZFF+SZbv AD6MDDY8oDRagiNXz3AO7nn42TiUdvSng2xTmZ0= X-Google-Smtp-Source: AA6agR4QzmR6qdoqCm7TGcAnT7u2ST0GtKupqgM0q0c6k7QEaWyO1I0Jj85sYMR6KPQD5et9m9+Kj+BPylr4EmLNIEg= X-Received: by 2002:a05:6870:5581:b0:11e:300:8189 with SMTP id n1-20020a056870558100b0011e03008189mr11680228oao.199.1663439691283; Sat, 17 Sep 2022 11:34:51 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 17 Sep 2022 14:34:50 -0400 In-Reply-To: <87tu56zfn3.fsf@posteo.net> X-Hashcash: 1:20:220917:spwhitton@spwhitton.name::K5jwRWunCQTe5/XQ:5Y35 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:242906 Archived-At: 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) ? > 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)