]> git.eshelyaron.com Git - emacs.git/commitdiff
image-mode: Make parameters buffer-local
authorBenjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
Sat, 12 Jan 2019 14:36:24 +0000 (15:36 +0100)
committerEli Zaretskii <eliz@gnu.org>
Fri, 25 Jan 2019 08:26:37 +0000 (10:26 +0200)
Image parameters were treated as image specific, but because they
actually were global variables, their behaviour transfered to new
images.
* lisp/image-mode.el (image-transform-resize, image-transform-scale)
(image-transform-rotation): Declare with defvar-local.  (Bug#33990)

lisp/image-mode.el

index 3570c7cba4ba1962053c7d6d002fc9126db51119..3be515d9143129cfc01025ae707c0fff0d54b69a 100644 (file)
@@ -53,7 +53,7 @@ See `image-mode-winprops'.")
 It is called with one argument, the initial WINPROPS.")
 
 ;; FIXME this doesn't seem mature yet. Document in manual when it is.
-(defvar image-transform-resize nil
+(defvar-local image-transform-resize nil
   "The image resize operation.
 Its value should be one of the following:
  - nil, meaning no resizing.
@@ -61,10 +61,10 @@ Its value should be one of the following:
  - `fit-width', meaning to fit the image to the window width.
  - A number, which is a scale factor (the default size is 1).")
 
-(defvar image-transform-scale 1.0
+(defvar-local image-transform-scale 1.0
   "The scale factor of the image being displayed.")
 
-(defvar image-transform-rotation 0.0
+(defvar-local image-transform-rotation 0.0
   "Rotation angle for the image in the current Image mode buffer.")
 
 (defvar image-transform-right-angle-fudge 0.0001