]> git.eshelyaron.com Git - emacs.git/commitdiff
Use wallpaper-set in thumbs.el
authorStefan Kangas <stefankangas@gmail.com>
Tue, 13 Sep 2022 16:02:21 +0000 (18:02 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Tue, 13 Sep 2022 16:25:21 +0000 (18:25 +0200)
* lisp/thumbs.el (wallpaper): Require.
(thumbs-setroot-command): Make defcustom obsolete.
(thumbs-call-setroot-command): Make obsolete in favor of
wallpaper-set.
(thumbs-set-image-at-point-to-root-window, thumbs-set-root)
(thumbs-dired-setroot): Use wallpaper-set instead of
thumbs-call-setroot-command.
(thumbs-before-setroot-hook, thumbs-after-setroot-hook): Make
obsolete.

lisp/thumbs.el

index 0b3d36d6e312286c2012cdbaacfd4e196525a1f5..0c5307f8de3b6460eff40704d8302d5e5468ba6c 100644 (file)
@@ -54,6 +54,7 @@
 ;;; Code:
 
 (require 'dired)
+(require 'wallpaper)
 (require 'cl-lib)                      ; for cl-gensym
 
 ;; CUSTOMIZATIONS
@@ -99,6 +100,8 @@ This must be the ImageMagick \"convert\" utility."
   :type 'string
   :version "28.1")
 
+(make-obsolete-variable 'thumbs-setroot-command
+                        'wallpaper-commands-alist "29.1")
 (defcustom thumbs-setroot-command
   "xloadimage -onroot -fullscreen *"
   "Command to set the root window."
@@ -425,6 +428,7 @@ Open another window."
 
 (defun thumbs-call-setroot-command (img)
   "Call the setroot program for IMG."
+  (declare (obsolete wallpaper-set "29.1"))
   (run-hooks 'thumbs-before-setroot-hook)
   (shell-command (string-replace
                  "*"
@@ -435,15 +439,13 @@ Open another window."
 (defun thumbs-set-image-at-point-to-root-window ()
   "Set the image at point as the desktop wallpaper."
   (interactive)
-  (thumbs-call-setroot-command
-   (thumbs-current-image)))
+  (wallpaper-set (thumbs-current-image)))
 
 (defun thumbs-set-root ()
   "Set the current image as root."
   (interactive)
-  (thumbs-call-setroot-command
-   (or thumbs-current-tmp-filename
-       thumbs-current-image-filename)))
+  (wallpaper-set (or thumbs-current-tmp-filename
+                     thumbs-current-image-filename)))
 
 (defun thumbs-file-alist ()
   "Make an alist of elements (POS . FILENAME) for all images in thumb buffer."
@@ -756,13 +758,16 @@ ACTION and ARG should be a valid convert command."
 (defun thumbs-dired-setroot ()
   "In dired, call the setroot program on the image at point."
   (interactive)
-  (thumbs-call-setroot-command (dired-get-filename)))
+  (wallpaper-set (dired-get-filename)))
 
 ;; Modif to dired mode map
 (define-key dired-mode-map "\C-ta" 'thumbs-dired-show)
 (define-key dired-mode-map "\C-tm" 'thumbs-dired-show-marked)
 (define-key dired-mode-map "\C-tw" 'thumbs-dired-setroot)
 
+(make-obsolete-variable 'thumbs-before-setroot-hook nil "29.1")
+(make-obsolete-variable 'thumbs-after-setroot-hook nil "29.1")
+
 (define-obsolete-function-alias 'thumbs-image-type
   #'image-supported-file-p "29.1")