emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

25.1.50; image-increase-size: Non-interactive call fails if N is an inte


From: Tino Calancha
Subject: 25.1.50; image-increase-size: Non-interactive call fails if N is an integer
Date: Fri, 2 Sep 2016 13:41:51 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)


emacs -Q:
;; Visit an image file, FILE, and
;; increase its size 80%.
(progn
  (find-file FILE)
  (image-increase-size 8))
;; The picture doesn't change.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From d749004f7825a8571a6a46fdff1b908d1d3f3a1f Mon Sep 17 00:00:00 2001
From: Tino Calancha <address@hidden>
Date: Fri, 2 Sep 2016 13:32:51 +0900
Subject: [PATCH] image-increase-size: Fix non-interactive calls

* lisp/image.el (image-increase-size, image-decrease-size):
Compute a float point number division (Bug#24352).
---
 lisp/image.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/image.el b/lisp/image.el
index 272cee5..791a902 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -957,7 +957,7 @@ image-increase-size
 default is 20%."
   (interactive "P")
   (image--change-size (if n
-                          (1+ (/ n 10))
+                          (1+ (/ n 10.0))
                         1.2)))

 (defun image-decrease-size (n)
@@ -966,7 +966,7 @@ image-decrease-size
 default is 20%."
   (interactive "P")
   (image--change-size (if n
-                          (- 1 (/ n 10))
+                          (- 1 (/ n 10.0))
                         0.8)))

 (defun image--get-image ()
--
2.9.3


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.9)
 of 2016-09-02
Repository revision: dda2d6a311fd2a7096176e240e4e81b423eaa8e2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]