unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: New comment-sexp command and key bind
Date: Fri, 21 Aug 2015 13:24:46 +0100	[thread overview]
Message-ID: <CAAdUY-LoskXyZNNs7-1svobsXuy=hG7XKfGofDDC5KSWMDUVuA@mail.gmail.com> (raw)
In-Reply-To: <CALDnm51QMtp=pQHpXcs3JhP6Ai_9yQU5Qp_X6Oim+VmomEGKFg@mail.gmail.com>

2015-08-21 12:31 GMT+01:00 João Távora <joaotavora@gmail.com>:
> This is interesting, I just tried it.
>
> Was it your intention to make the uncommenting behaviour for
> consecutive sexps different from the commenting behaviour? The former
> keeps point at the beginning of the sexp, while the latter advances
> one sexp. I thing they should be uniform.

Yes, it was intentional, though I'm still experimenting with the
command so that's up for discussion.

- When uncommenting, it leaves point exactly where it was unless you
provide a prefix argument. With a prefix argument, it uncomments that
many sexps and moves point after them.

- When commenting, we always move point after the commented region
(the prefix argument still specifies a number of sexps to comment).

The only reason for this is that it's what seemed most useful to me. I
never want point to be inside a sexp I just commented out (what could
I possibly want to do with it?). OTOH, when I UNcomment something, I
sometimes want to edit it afterwards (sometimes I don't, like I said,
up for discussion).

> I would prefer to *not* advance sexps. But I realize that that has the
> drawback that it is difficult to advance one recently commented sexp.

I really like advancing when commenting.
It lets me comment a series of sexps by just holding down C-M- and
then repeatedly hitting ; (of course, I can use the prefix arg for
this, but sometimes I'm deciding which sexps to comment on the fly).
Like you mention, it's also hard to manually forward-sexp after having
commented it.



  reply	other threads:[~2015-08-21 12:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 11:11 New comment-sexp command and key bind Artur Malabarba
2015-08-21 11:31 ` João Távora
2015-08-21 12:24   ` Artur Malabarba [this message]
2015-08-21 12:15 ` Andreas Schwab
2015-08-21 12:50 ` Óscar Fuentes
2015-08-21 13:44   ` Artur Malabarba
2015-08-21 13:31 ` Stefan Monnier
2015-08-21 14:21   ` Artur Malabarba
2015-08-21 15:16     ` Óscar Fuentes

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='CAAdUY-LoskXyZNNs7-1svobsXuy=hG7XKfGofDDC5KSWMDUVuA@mail.gmail.com' \
    --to=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@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 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).