From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] newcomment.el (comment-line): New command. Date: Tue, 27 Jan 2015 00:35:31 -0200 Message-ID: References: Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d5966d84bad050d991b79 X-Trace: ger.gmane.org 1422326141 5665 80.91.229.3 (27 Jan 2015 02:35:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2015 02:35:41 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 27 03:35:40 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YFw0B-0000mD-Li for ged-emacs-devel@m.gmane.org; Tue, 27 Jan 2015 03:35:39 +0100 Original-Received: from localhost ([::1]:45019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFw0B-0008KL-37 for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 21:35:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFw06-0008KG-C6 for emacs-devel@gnu.org; Mon, 26 Jan 2015 21:35:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFw04-0005MO-L5 for emacs-devel@gnu.org; Mon, 26 Jan 2015 21:35:34 -0500 Original-Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:52221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFw04-0005MI-EA for emacs-devel@gnu.org; Mon, 26 Jan 2015 21:35:32 -0500 Original-Received: by mail-oi0-f45.google.com with SMTP id g201so10374869oib.4 for ; Mon, 26 Jan 2015 18:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=MLlL77HPOY5iOC7YorqkEWOyzgc5RXpoAxyTMQ6+Agw=; b=xbqMXfX9AL3sJ3qk1OKBH0Fh3tR6NOdo72fW+wugo7J1smdkluqzwrj5ZhIahEpm7w 1R3rZe95MV6KHVEjZp7TnyksgO187zxDmlWOKjZYqx+LErALrdpw6KOd51RxG5IXwTxR g4YIT8cV7d+W4wmuiNgfsRgbtJDSelmgF4gwUKhQPQO8o1zeOOUUJydyPG9YwJrdjkjQ UzkE06AKSabgxggbyYtQaz57rvvPZ3BiHJOWk+blkZ2t3b60cz05hBYalZa8NDXOm7AL wTXNIgVO5MsACcYT3m8zuFFjBAhnYTaxVKM4EQOcYUIsrjkipHbYzSt7N1JH3qqbO3N0 JI+g== X-Received: by 10.202.97.130 with SMTP id v124mr5214946oib.34.1422326131868; Mon, 26 Jan 2015 18:35:31 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Mon, 26 Jan 2015 18:35:31 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Mon, 26 Jan 2015 18:35:31 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: QqKhd82kn4c8q0ixZZfRHbrCNd8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c06::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181815 Archived-At: --001a113d5966d84bad050d991b79 Content-Type: text/plain; charset=UTF-8 On 26 Jan 2015 20:41, "Stefan Monnier" wrote: > > > Is there any particular reason why there's no `comment-line' command > > in Emacs? > > Probably because the question goes both ways: is there any particular > reason we'd need a comment-line command? > > C-a C-SPC C-n M-; > > works for me when I need it. M-x comment-line RET is much longer (even > if you shorten it with something like partial-completion), so for such > a command to make sense, you'd need a key binding for it. Yes, you would. I didn't mention keybinds yet, because I was tackling this by parts. I bind it to `C-;'. Another viable key might be `C-M-;'. But it definitely needs a key. When you want to comment/uncomment something between 1 and 9 lines, it always requires less keypresses than the M-; alternative. Besides, commenting a single line is such a common scenario, I find it deserves a single key instead of a 4 key combo. It's also something that a lot of IDE's assign to a hotkey, so I'm sure I'm not the only one that finds it useful. :-) And people who come from other editors are sure to miss it. --001a113d5966d84bad050d991b79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 26 Jan 2015 20:41, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote= :
>
> > Is there any particular reason why there's no `comment-line&#= 39; command
> > in Emacs?
>
> Probably because the question goes both ways: is there any particular<= br> > reason we'd need a comment-line command?
>
> =C2=A0 =C2=A0C-a C-SPC C-n M-;
>
> works for me when I need it.=C2=A0 M-x comment-line RET is much longer= (even
> if you shorten it with something like partial-completion), so for such=
> a command to make sense, you'd need a key binding for it.

Yes, you would. I didn't mention keybinds yet, because I= was tackling this by parts.

I bind it to `C-;'. Another viable key might be `C-M-;'. But it def= initely needs a key.
When you want to comment/uncomment something between 1 and 9 lines, it alwa= ys requires less keypresses than the M-; alternative.

Besides, commenting a single line is such a common scenario,= I find it deserves a single key instead of a 4 key combo.

It's also something that a lot of IDE's assign to a = hotkey, so I'm sure I'm not the only one that finds it useful. :-) = And people who come from other editors are sure to miss it.

--001a113d5966d84bad050d991b79--