unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Artur Malabarba <bruce.connor.am@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: RE: master 97cb255: newcomment.el (comment-line): New command on C-x C-; .
Date: Sun, 8 Feb 2015 17:13:14 -0800 (PST)	[thread overview]
Message-ID: <2d8fcbc0-7f63-43de-9376-da8ed881d3e2@default> (raw)
In-Reply-To: <CAAdUY-Lkc-R1GkbU4gYqEvCM0N1OffW=AfWnLgwvTYctLGGuHg@mail.gmail.com>

> +    (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	other threads:[~2015-02-09  1:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150208190338.30436.1351@vcs.savannah.gnu.org>
     [not found] ` <E1YKX8s-0007vW-86@vcs.savannah.gnu.org>
2015-02-08 20:07   ` master 97cb255: newcomment.el (comment-line): New command on C-x C-; Stephen Berman
2015-02-08 20:26     ` Artur Malabarba
2015-02-09  1:13       ` Drew Adams [this message]
2015-02-10  0:13         ` Artur Malabarba
2015-02-10  6:21           ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d8fcbc0-7f63-43de-9376-da8ed881d3e2@default \
    --to=drew.adams@oracle.com \
    --cc=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).