emacs-devel
[Top][All Lists]
Advanced

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

RE: master 97cb255: newcomment.el (comment-line): New command on C-x C-;


From: Drew Adams
Subject: RE: master 97cb255: newcomment.el (comment-line): New command on C-x C-; .
Date: Sun, 8 Feb 2015 17:13:14 -0800 (PST)

> +    (when (and (eq last-command 'comment-line-backward)
> +               (natnump n))
> +      (setq n (- n)))

It's really too bad (IMO) that you didn't take my suggestion.
It sounded like you were going to... ("Good idea. Will do.")

You did part of it - repeated upward commenting when started
with a negative prefix arg.  So far, so good.  Thx.

But this other feature, which you left out, is also useful, IMO:

  When repeated, a negative prefix arg switches direction.

If you change the above predicate to just (eq last-command
'comment-line-backward) then you get the direction-switching
that I suggested.

You then still get inheritance of a negative prefix arg when
you repeat (upward commenting instead of downward).

The direction-switching feature does not change the behavior
in any way, except if you use a negative prefix arg again,
while you are repeating.

With your implementation, hitting `C--' while you are
repeating has an effect only if you are going downward.  In
that case it does switch direction.  But if you hit `C--'
when going up then it is a no-op.  And in fact I see no way
to switch to going down again - not `C-1' or `C-u' or ...

The direction-switching behavior is thus not symmetric.
It's not very useful for it to work only when moving down,
IMO.  If someone does not want to switch direction when
repeating moving down, then s?he just won't hit `C-' again.
Since the initial prefix arg is inherited, there is no
reason to hit `C--' again, if it does nothing.  In that
context, `C--' is useless anyway.

Did you try what I suggested in this regard?  If so, did
you find something wrong with it?  To me it is handy to be
able to always reverse direction (by hitting `C--') - not
only when you are moving downward.

It is in general handy to have a quick way to reverse
the direction of an operation that is bound to a repeating
key.  One can easily repeat quickly and go past a target
position.  A quick way to reverse, while staying within
the repeating command (e.g. as opposed to using `undo'),
is an advantage in general - not just for this command.

Anyway, not a big deal.  It won't be the first time I will
have my own local version of something. ;-)  I would prefer
not to have to, of course.  And I am curious what downside
you saw to this feature, if you even tried it at all.



reply via email to

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