From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: image-rotate: Accept angle as an argument Date: Mon, 05 Sep 2016 14:36:29 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473079431 12932 195.159.176.226 (5 Sep 2016 12:43:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Sep 2016 12:43:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 05 14:43:46 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgtFW-0002iT-RB for ged-emacs-devel@m.gmane.org; Mon, 05 Sep 2016 14:43:42 +0200 Original-Received: from localhost ([::1]:54496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgtFU-0006iX-Cq for ged-emacs-devel@m.gmane.org; Mon, 05 Sep 2016 08:43:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgtDB-0006Vj-FM for emacs-devel@gnu.org; Mon, 05 Sep 2016 08:43:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgt9n-0002ac-R9 for emacs-devel@gnu.org; Mon, 05 Sep 2016 08:41:16 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:52616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgt9n-0002a9-I7 for emacs-devel@gnu.org; Mon, 05 Sep 2016 08:37:47 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bgt9j-0004xr-Di; Mon, 05 Sep 2016 14:37:45 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEUgDwNBKgSykS2AYBNk RwoUREFxAAACWElEQVQ4jVWTi3HjMAxEwVgFEBYaCKgCLIIFhAL6r+kWlJ2709jjsR7x3SUVsTG6 WmvWn6o/oWY6bFARH3HdQFulza69HwOAD2M3783aLP1FTz28DSVm8bmbNe2TiIQ21daiUZhHleim jQGokmqWpBndhcPMXqUCxJkRl9KJNGbhw2pBSLnUQRxg7m4NIQNvCwMQeuxKwQAhaDorUNH+eqhp pzHDbTLba4HHiZSqiIsxPAAiwUazVKauvZFEuJ9vULgW0BUhki2x2E9myr6kdn0iFULMTo4FSpa5 gcTwFsFc6f18CWoobXHuI6Ly/IDpC8jkfaBfbPN+X7ZYYKBVGZlJ3sm2MFUl/X5ozlGL3MnKPnyB V7kOFEfEql+gmmIn1I8Naug5pdxgxwaxYUyZXWg7rx9KQfbWmzZEtIa28RzXd6UdiuMQBFLykIwF OLjuPwl6g9AUMwI1FpB4+d8InjzhqAX05ekuN+iJEbi62jdWzP0lpumx0bCJYJTExozZz3LnmhMD YUnPxlOwMBlwAnq1KQvUJwPAwxG0Z08+DaJh4L3UylmS6SubGnPcEcJUi7cED3ga/lgRiahu8Dv+ PjBExyfXyWll3mBAZSrwZcfASMFLO5YLus0K+6dOmmcBGDbClHoCjEVulxFXzqugx4Rt3JFrgayO L9Zx8LJmXxHE5QbsCSDoB6yO81c6QAl/17hzrQOpYhFoC1A+RZYRzryF3bJ4vvkAWj7Fqob3Bcov yIwXBImdov5TPe/tbZRG4wP4P6AZUX/7WuBL164kAb2vDUAFSJ/9ATpIhHwy4xsIAAAAAElFTkSu QmCC In-Reply-To: (Tino Calancha's message of "Mon, 5 Sep 2016 16:52:48 +0900 (JST)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207194 Archived-At: Tino Calancha writes: > * lisp/image.el (image-rotate): > Add argument ANGLE, the angle in degrees for the rotation. > Add optional argument _ARG; in interactive calls, a non-nil > value prompt for ANGLE. [...] > +(defun image-rotate (angle &optional _arg) > + "Rotate the image under point by ANGLE degrees clockwise. > +If ANGLE is a negative number, then rotate counterclockwise. > +When called interactively with a prefix argument, prompt for ANGLE." > + (interactive > + (let* ((ask current-prefix-arg) > + (default 90) > + (prompt "Rotate image by ANGLE degrees: ") > + (rotation (if ask > + (read-number prompt default) > + default))) > + (list rotation ask))) I don't understand this code -- why are you binding the unused argument _arg to the value of current-prefix-arg? Anyway, I don't really see the use case here: The only reason somebody (in real life) has for changing the displayed angle of an image is if it's vertical instead of horizontal (and vice versa), so rotating by 90 degrees is the only thing that makes sense, I think. Do you see a use case for changing the displayed angle of an image by 72 degrees? > -(defun image-increase-size (n) > - "Increase the image size by a factor of N. [...] > +default is 20%. > +When called interactively with a prefix argument, prompt for N." I think this is a bad idea. `+'/`-' are quick, simple commands for changing the displayed size, and is not something that's done for fine-tuning: It's not an editing command. `5 +' increases the size by 50%, and that feels natural and pleasant. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no