all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: image-rotate: Accept angle as an argument
Date: Mon, 05 Sep 2016 14:36:29 +0200	[thread overview]
Message-ID: <m337leseuq.fsf@gnus.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1609051650300.22704@calancha-pc> (Tino Calancha's message of "Mon, 5 Sep 2016 16:52:48 +0900 (JST)")

Tino Calancha <tino.calancha@gmail.com> 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	other threads:[~2016-09-05 12:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05  5:52 image-rotate: Accept angle as an argument Tino Calancha
2016-09-05  7:52 ` Tino Calancha
2016-09-05 12:36   ` Lars Ingebrigtsen [this message]
2016-09-05 14:59     ` Stefan Monnier
2016-09-05 16:30     ` Tino Calancha
2016-09-05 16:52       ` Lars Ingebrigtsen
2016-09-05 17:28         ` 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=m337leseuq.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=tino.calancha@gmail.com \
    /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.