diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2022-09-14 15:01:58 +0200 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2022-09-14 15:01:58 +0200 |
commit | d3188196cca68f79a18a6d8a331fd98d4b18c22c (patch) | |
tree | 8b7bb07fdb729779bf5c1222889967d6a782ac03 /lisp | |
parent | 37e1c896a02995c4a8ddc431bf14bf3fe5846390 (diff) | |
download | emacs-d3188196cca68f79a18a6d8a331fd98d4b18c22c.tar.gz emacs-d3188196cca68f79a18a6d8a331fd98d4b18c22c.tar.bz2 emacs-d3188196cca68f79a18a6d8a331fd98d4b18c22c.zip |
Add new command image-mode-wallpaper-set
* lisp/image-mode.el (wallpaper): Require.
(image-mode-wallpaper-set): New command.
(image-mode-map): Bind above new command to "W".
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/image-mode.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index d27462ff0a2..f2ffbd89447 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -45,6 +45,7 @@ (require 'image) (require 'exif) (require 'dired) +(require 'wallpaper) (eval-when-compile (require 'cl-lib)) ;;; Image mode window-info management. @@ -523,6 +524,9 @@ image as text, when opening such images in `image-mode'." "S-SPC" #'image-scroll-down "DEL" #'image-scroll-down + ;; Misc + "W" #'image-mode-wallpaper-set + ;; Remapped "<remap> <forward-char>" #'image-forward-hscroll "<remap> <backward-char>" #'image-backward-hscroll @@ -1387,7 +1391,18 @@ If no such buffer exists, it will be opened." (prog1 (bookmark-default-handler bmk) (when (not (string= image-type (bookmark-prop-get bmk 'image-type))) (image-toggle-display)))) + + +;;; Setting the wallpaper + +(defun image-mode-wallpaper-set () + "Set the desktop background to the current image. +This uses `wallpaper-set' (which see)." + (interactive nil image-mode) + (wallpaper-set buffer-file-name)) + +;;; Image transformation (defsubst image-transform-width (width height) "Return the bounding box width of a rotated WIDTH x HEIGHT rectangle. |