all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: chad <yandros@mit.edu>, Stefan Monnier <monnier@iro.umontreal.ca>,
	"emacs-devel@gnu.org Development" <emacs-devel@gnu.org>
Subject: RE: [PATCH] Make `C-x {' and `C-x }' repeatable
Date: Fri, 24 May 2013 08:55:11 -0700 (PDT)	[thread overview]
Message-ID: <743145c2-9a1b-4db6-b964-a2cd00276c7e@default> (raw)
In-Reply-To: <87ppwht1vl.fsf@uwakimon.sk.tsukuba.ac.jp>

> (1) Discoverability.  Auto-acceleration 

It's undefined, so far.  Hard to defend or criticize something still pie-in-the-sky.

But my crystal ball and experience whisper to me that "automatic" too often misses
the mark and does not really DWIM.

On the other hand, _direct manipulation_ is all about user control, with
immediate feedback.

>     would likely happen to me frequently, so I'd learn it.
>     (Maybe not learn to use it, but learn to avoid it, at least.)

Avoiding an "automatic" do-it-all solution is one way to try to deal with it.
But it does not solve the problem.

>     "C-u C-u C-x } } C-3 }" is not something I would likely try
>     on my own, nor would I find it easy to remember if I read
>     about it in passing.

No need to remember anything.  The default behavior (no prefix arg) provides
a fine-tuning value (e.g. an increment) of 1.

And trying C-u at the outset, which is pretty simple and discoverable, quickly
shows you what it does: provides a larger increment for subsequent stepping.

Just stop and start again with the prefix key, if you like, to use a different
increment for subsequent steps.  Also obvious.

And if you _happen_ to use a prefix arg also before one of the final-key
occurrences... WYSIWYG - immediately.  This is just a shortcut so you don't have
to start again with the prefix key.

Readers of the doc string or curious experimenters will quickly discover the shortcut.
And others are not handicapped without the shortcut: they can just hit the prefix
key again, giving it a different prefix arg to change the increment size.

IOW, if you don't happen to stumble upon all the available behaviors, it's likely
you'll continue using the default increment, which means fine-tuning all the time.
Or you'll figure out only the initial prefix arg, so will quit after N uses and
start again without a prefix arg to fine-tune.

> (2) Consistency.  I can't think of any other case where an infix key
>     controls the behavior of a command.

There is no "infix" key anywhere here.  There are just keys, bound to various
commands.  And each key accepts a prefix arg and does something with it.

The only thing different from usual here is that the default value of the prefix
arg is the last used prefix arg, instead of 1.

And that is already what we do for C-x C-(+|-), except that we don't let you
change the prefix arg along the way.  The arg you use initially continues to be
used for each subsequent step.  We do NOT revert you to the default increment
size for steps after the first.  You continue to increment/decrement using the
same increment size for all steps.

That's the approach I recommend.  With the added feature that you can, if you like,
change the increment on the fly, without having to start over with the prefix key.

> (3) Usability.  Some people, like you, can estimate pretty well
>     whether you need C-2 or C-3.  Others can't, and would need to
>     calculate, possibly costing more time than they save.  Auto-
>     acceleration has no such cost of computation.

No, you miss the point.  This is direct manipulation.  Typically each such
resizing, moving, etc. command/key has its opposite: `right' cancels `left'
etc.  Overshoot?  Just come back.  Come back less or more, as needed.
There is nothing to "estimate".  Just do it and see immediately the effect,
adjusting on the fly as needed.

This is typical of any command that is repeatable and provides incremental adjustment.
A different but similar approach is used in DoReMi, which lets you incrementally
change all kinds of things.  There, instead of a prefix arg, there is a default
increment size, and using the `Meta' key with the usual incrementing keys (e.g. `up',
`down', `left', `right') boosts the default increment by a factor.

So if you want to move your frame quickly across the screen then you hold down
`M-' while you hold down `right'.  If you want to slow down you release `M-'.
If you go too far then you use `left' to come back.  Simple, even obvious.

The point is that it is trivial to "discover" how to incrementally adjust something,
including taking advantage, when you want to, of any scaling/boosting/accelerating.
This is no more difficult to "learn" or discover than sliding a scroll-bar thumb
with your mouse pointer.

> (4) Economy.  The advantage of user control is smaller than you
>     suggest, I believe.  Anything bigger than C-1 will cause you to
>     miss the target half the time or more.

Simply not true.  Where do you get that "half the time or more"?  And what does
"miss the target" even mean here, precisely?

We're talking about incremental adjustment.  If I want to move an Emacs frame
downward so that its bottom edge precisely aligns with the top of another frame
(just as an example), that edge coincidence is presumably your "target".  It is
obvious and simple to do this incrementally.  If you want to move the whole distance
using a tiny increment (e.g. 1 pixel at a time), you can do that.  But if you want
to move most of the distance using a larger increment then you can do that too.

And if you overshoot (and you likely will, when in a final "docking" maneuver)
then you just move back (and forth, if necessary, until you get it right).

This is so simple as to make any description of it overkill.  But hopefully it
is clear now?  

>     Sometimes people will need
>     to correct for overshooting, which means either starting over with
>     the inverse command or using a negative count.  And even if they
>     undershoot they need to switch to C-1.

You make over/undershooting sound like some kind of error.  It is in fact the
_normal_ way we interact with our environments (and even with ourselves).
You cannot sit down or stand up or take a step without making over/undershoot
adjustments.

And no, I do not understand your statement about starting over.

> I don't want it badly enough to write the code, but I suspect more
> users will find it useful than the UI you propose.  Both are valid
> proposals and worth experimenting with.

Yes to the idea that experimenting is helpful.

If you want to experiment with incremental adjustment (if not the same prefix-arg
design), here are a few places to start:

* frame-cmds.el: commands such as `move-frame-(down|up|right|left)',
  `(enlarge|shrink)-frame(-horizontally)'
  http://www.emacswiki.org/emacs-en/download/frame-cmds.el

* doremi-frm.el, doremi-cmd.el: any of the commands (increment face/frame colors,
  frame/font sizes, etc.)
  http://www.emacswiki.org/emacs-en/download/doremi-frm.el
  http://www.emacswiki.org/emacs-en/download/doremi-cmd.el
  http://www.emacswiki.org/cgi-bin/wiki/DoReMi

Even in vanilla Emacs, just consider adjusting text size using C-x C-(-|+), with
and without a prefix arg.  A prefix arg here is "modal" in the sense that the
initial prefix arg you give is passed on to each subsequent +/-, instead of reverting
to an increment of 1.  You cannot, however, change the increment along the way (which
is the additional feature I proposed in the current context).

Or even just using `M-f' and `C-f' to move across text to your "target", coming back
with `(M|C)-b' if you overshoot, etc.  Here, like the DoReMi booster-key case, there
are separate keys for different size increments.  A prefix arg here controls not
the increment size but the number of jumps.

Really not a big deal at all.  All of these different ways of incrementally adjusting
something provide easy ways to fine-tune, including adjusting for over/undershoot.



  reply	other threads:[~2013-05-24 15:55 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 19:59 [PATCH] Make `C-x {' and `C-x }' repeatable Gauthier Östervall
2013-05-21  9:58 ` Vitalie Spinu
2013-05-21 13:53   ` Gauthier Östervall
2013-05-21 18:34 ` Juri Linkov
2013-05-22 17:44   ` Drew Adams
2013-05-22 18:55     ` Juri Linkov
2013-05-22 21:39       ` Drew Adams
2013-05-22 22:08         ` Stefan Monnier
2013-05-22 23:53           ` Drew Adams
2013-05-23  0:18             ` chad
2013-05-23 16:19               ` Drew Adams
2013-05-23 16:48                 ` Stefan Monnier
2013-05-23 19:52                   ` Drew Adams
2013-05-24  4:53                     ` Stephen J. Turnbull
2013-05-24 15:55                       ` Drew Adams [this message]
2013-05-24 17:00                         ` Stephen J. Turnbull
2013-05-22 21:47       ` Stefan Monnier
2013-05-22 22:24         ` Stefan Monnier
2013-05-22 23:53         ` Drew Adams
2013-05-23 22:30         ` Juri Linkov
2013-05-24  3:58           ` Stefan Monnier
2013-05-22 19:05 ` Stefan Monnier
2013-05-23 12:21   ` Gauthier Östervall
2013-05-23 13:41     ` Stefan Monnier
2013-05-23 22:04       ` Juri Linkov
2013-05-24  9:38         ` Alan Mackenzie
2013-05-24 20:31           ` Juri Linkov
2013-05-25 20:01             ` Alan Mackenzie
2013-05-25 20:40               ` Juri Linkov
2013-06-02 21:05                 ` isearch-allow-prefix [Was: [PATCH] Make `C-x {' and `C-x }' repeatable] Alan Mackenzie
2013-06-04 18:03                   ` Juri Linkov
2013-06-04 21:24                     ` Alan Mackenzie
2013-06-05  8:23                       ` Juri Linkov
2013-06-05 21:02                         ` Alan Mackenzie
2013-06-06  6:07                           ` isearch-allow-move [Was: isearch-allow-prefix] Juri Linkov
2013-06-06 12:45                             ` Stefan Monnier
2013-06-06 15:07                               ` Juri Linkov
2013-06-06 15:43                                 ` Drew Adams
2013-06-06 16:39                                 ` Stefan Monnier
2013-06-07  7:07                                   ` Juri Linkov
2013-06-06 20:07                             ` Alan Mackenzie
2013-06-07  6:59                               ` Juri Linkov
2013-06-07 10:30                                 ` Alan Mackenzie
2013-06-07 19:30                                   ` Juri Linkov
2013-06-09 20:09                                     ` Juri Linkov
2013-06-11 19:35                                       ` Juri Linkov
2013-06-07 20:04                               ` Juri Linkov
2013-06-09 12:07         ` [PATCH] set-temporary-overlay-map improvement and make windresize exit on other commands Vitalie Spinu
2013-06-09 16:03           ` Stefan Monnier
2013-06-09 17:12             ` Vitalie Spinu
2013-06-13 20:44               ` Stefan Monnier

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=743145c2-9a1b-4db6-b964-a2cd00276c7e@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen@xemacs.org \
    --cc=yandros@mit.edu \
    /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.