all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
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)	[thread overview]
Message-ID: <alpine.DEB.2.20.1609021339450.7524@calancha-pc> (raw)


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 <tino.calancha@gmail.com>
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	other threads:[~2016-09-02  4:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  4:41 Tino Calancha [this message]
2016-09-02  4:46 ` 25.1.50; image-increase-size: Non-interactive call fails if N is an integer Tino Calancha
2016-09-02 12:57 ` Lars Ingebrigtsen
2016-09-02 13:58   ` Tino Calancha
2016-09-04  2:03   ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1609021339450.7524@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.