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".
This commit is contained in:
parent
37e1c896a0
commit
d3188196cc
2 changed files with 22 additions and 2 deletions
9
etc/NEWS
9
etc/NEWS
|
@ -1954,6 +1954,11 @@ up as necessary. Unlike 'image-transform-fit-both', this does not
|
||||||
only scale the image down, but up as well. It is bound to "s w" in
|
only scale the image down, but up as well. It is bound to "s w" in
|
||||||
Image Mode by default.
|
Image Mode by default.
|
||||||
|
|
||||||
|
---
|
||||||
|
*** New command 'image-mode-wallpaper-set'.
|
||||||
|
This command sets the desktop background to the current image. It is
|
||||||
|
bound to "W" by default.
|
||||||
|
|
||||||
+++
|
+++
|
||||||
*** 'image-transform-fit-to-(height|width)' are now obsolete.
|
*** 'image-transform-fit-to-(height|width)' are now obsolete.
|
||||||
Use the new command 'image-transform-fit-to-window' instead.
|
Use the new command 'image-transform-fit-to-window' instead.
|
||||||
|
@ -2048,8 +2053,8 @@ associated with Image-Dired.
|
||||||
|
|
||||||
---
|
---
|
||||||
*** New command 'image-dired-wallpaper-set'.
|
*** New command 'image-dired-wallpaper-set'.
|
||||||
This command sets the wallpaper to the image at point in the thumbnail
|
This command sets the desktop background to the image at point in the
|
||||||
buffer. It is bound to 'W' by default.
|
thumbnail buffer. It is bound to 'W' by default.
|
||||||
|
|
||||||
---
|
---
|
||||||
*** 'image-dired-slideshow-start' is now bound to 'S'.
|
*** 'image-dired-slideshow-start' is now bound to 'S'.
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
(require 'image)
|
(require 'image)
|
||||||
(require 'exif)
|
(require 'exif)
|
||||||
(require 'dired)
|
(require 'dired)
|
||||||
|
(require 'wallpaper)
|
||||||
(eval-when-compile (require 'cl-lib))
|
(eval-when-compile (require 'cl-lib))
|
||||||
|
|
||||||
;;; Image mode window-info management.
|
;;; Image mode window-info management.
|
||||||
|
@ -523,6 +524,9 @@ image as text, when opening such images in `image-mode'."
|
||||||
"S-SPC" #'image-scroll-down
|
"S-SPC" #'image-scroll-down
|
||||||
"DEL" #'image-scroll-down
|
"DEL" #'image-scroll-down
|
||||||
|
|
||||||
|
;; Misc
|
||||||
|
"W" #'image-mode-wallpaper-set
|
||||||
|
|
||||||
;; Remapped
|
;; Remapped
|
||||||
"<remap> <forward-char>" #'image-forward-hscroll
|
"<remap> <forward-char>" #'image-forward-hscroll
|
||||||
"<remap> <backward-char>" #'image-backward-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)
|
(prog1 (bookmark-default-handler bmk)
|
||||||
(when (not (string= image-type (bookmark-prop-get bmk 'image-type)))
|
(when (not (string= image-type (bookmark-prop-get bmk 'image-type)))
|
||||||
(image-toggle-display))))
|
(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)
|
(defsubst image-transform-width (width height)
|
||||||
"Return the bounding box width of a rotated WIDTH x HEIGHT rectangle.
|
"Return the bounding box width of a rotated WIDTH x HEIGHT rectangle.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue