emacs-devel
[Top][All Lists]
Advanced

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

Re: image-rotate: Accept angle as an argument


From: Lars Ingebrigtsen
Subject: Re: image-rotate: Accept angle as an argument
Date: Mon, 05 Sep 2016 14:36:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Tino Calancha <address@hidden> 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



reply via email to

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