From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.help Subject: Re: Is Elisp really that slow? Date: Wed, 15 May 2019 22:09:30 +0200 Message-ID: <20190515200930.ltwwgjjfpnvpcjv6@Ergus> References: <46f308ff-5a70-8ccc-310b-48167088ff5a@yandex.ru> <87woirsvdb.fsf@telefonica.net> <87sgtfsswd.fsf@telefonica.net> <76f6370c-e8b7-bc59-634c-c48ea7af7f70@yandex.ru> <87lfz7sqb9.fsf@telefonica.net> <9f750259-44f6-4d39-b01c-db440e8d8782@default> <20190515193833.7n5aiogfwx4jjkzr@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="249365"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: help-gnu-emacs@gnu.org, Stefan Monnier To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 15 22:10:09 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR0E4-0012lT-Sj for geh-help-gnu-emacs@m.gmane.org; Wed, 15 May 2019 22:10:09 +0200 Original-Received: from localhost ([127.0.0.1]:41803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0E3-00045K-Jz for geh-help-gnu-emacs@m.gmane.org; Wed, 15 May 2019 16:10:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0Dg-00044Q-Ns for help-gnu-emacs@gnu.org; Wed, 15 May 2019 16:09:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0De-0002AN-TJ for help-gnu-emacs@gnu.org; Wed, 15 May 2019 16:09:44 -0400 Original-Received: from sonic301-22.consmr.mail.ir2.yahoo.com ([77.238.176.99]:44137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hR0Dd-00027O-8D for help-gnu-emacs@gnu.org; Wed, 15 May 2019 16:09:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1557950978; bh=x9TBN8nx0TNUzojS9d9/PQNcFuZZ9wb75mABfpcRdwk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=LhJCOsLSnUq4XVgxG5tRsQNcotq6cYxvBVZqyUQWc6Y7a5BYqP/rCu1KcM25TeA9JS2gk2V98amnbvrhLOojY9RpUSxvOW/Sw2/7blRrERVeuBo/1kup44vskrzyQLsch1MluYhDDvLjAXYSYGIa+L/QVaq2l/+TSbmj+W+MI4MUKuJ8MYbMbvZSk+7AuXOXep4CxEX9aYyGp5l4FEtgZIXFOWrKHT8MDilN601wdj3VTSVBdgBpGBYL3+FZQUv1N80CmM1dlyVy6J9MPaTamQOYU9dwuERLyfwXS11OHyia2S0b/CMPILHZYYZgTZhcKFu+9ivC/MilccESQcDxEA== X-YMail-OSG: 4r0x9tcVM1kv4lCUX6Cvm0XXm_hYyNM1Hql79maUSzJkjrf5WfWWgHLCJFy7sFH qLIXeTlkTWKeTolH21ITIDQxouaAJgHhG7KFDyqp0fELCx3.SzrmyK7PnWDfz5j3Uyb3in.F09QP 9rTsa9DaIqGoQ.eQBr0_0x8Byf8DUmGBSGSEeZtYEtC_wWaQcYtZ8Miq2ijs40V4XeTEI3IUnezD TwOncUUoa3btH40HtXGJZpPckXuzu6GhmCrGb1Tpq8fy3zv9khW7cxbrwPzdFL19w8giCbsEHU.u jnnT7Mcwjnv51EDdSnOUo8dsLGFIrybSa15kirz05RjCVOgAzMhPmqrqPRGtWAJXz5JZE9HOKnM3 gCFK15585SvhHfLqo_PqlV8ZcUebKNGSkfP4fMuEsjFaBnEJ.ZSfDJuiWHnT9YSK7GiECSWDKwEf I47ReirOWMnMVd1BaRU7RlPUV.g.pUJ9LRCjz8YQKOCDNyWav1nIsE0HurYIIIROX8kjpfgucLI7 vgRbxmtj0syUOCHpZ1tiIao9FGiEzItfJrL9cXpHtXwLXypz2qipeTwwVVYS.UpRGIqiiV6FZMWg Kbn8ybHhbOWxX5FiLz2pkOpWM89jQnIIkQnDgXmq5d1yPUnndcjMOXcoNDE5PC0u.DpfkGnnM0RG AtSN3YVXU5kBB3pF4A6UzTHheFa1ItZV_KCIMnulN2SKsGEuwn4O7G3zN_217aXzUjCMLa0pui44 LPFG8TLTertgSm0Ms95qL2IV4egEfTeikHlwdsEkCHEznWRY723kM7P1uiuqMojj6pAY8D1OJHbf .anXvqB8BYa2_.K5zu8bYyufUCyU2EwzDTKXJrlQ71 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Wed, 15 May 2019 20:09:38 +0000 Original-Received: from 2.152.205.184.dyn.user.ono.com (EHLO Ergus) ([2.152.205.184]) by smtp430.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 3f9c21f1dfc895be2fb146eb5bd2c016; Wed, 15 May 2019 20:09:34 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.176.99 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120418 Archived-At: On Wed, May 15, 2019 at 12:53:43PM -0700, Drew Adams wrote: >> >I agree with Oscar that `comment-dwim' and `comment-region' >> >have different behaviors - so neither is a substitute >> >for the other. >> > >> >In particular, `comment-region' lets you also >> >uncomment, including unnest, comments. >> >> To no waste bindings we could just modify comment-region to accept >> negative prefix to uncomment. So C-- M-; uncoments region, and M-; >> comments it. > >I don't get your point. `comment-region' already >uncomments, with plain `C-u'. > >> But now there will come another user saying that the dwim >> version is better... we will never agree in anything this way. > >The point was that both `M-;' and `comment-region' >are useful, and that neither substitutes for the other. >It doesn't matter which one someone think is "better". >They're both available. > >> >I use both, and I bind each to a short key sequence. >> > >> >More precisely, I leave `comment-dwim' on `M-;' >> >and I bind `C-x C-;' to a command similar to >> >`comment-region' but that I find more useful: >> >`comment-region-lines'. It comments/uncomments >> >whole lines. >> > >> >(So it too differs from `comment-region' - so it >> >too is not an exact "replacement".) >> > >> >As for key bindings: >> > >> >Although I haven't bothered to change the binding of >> >`M-;', I think it's a shame and a waste to sacrifice >> >such a nice, short, _repeatable_ key sequence for a >> >command that does _nothing_ when you repeat it. >> > >> >Far better to use `M-;' for some command that keeps >> >doing something when repeated (just hold down `M-;'). >> >That's what Emacs should do eventually, IMHO. No >> >urgency, but someday, when we find a really useful >> >repeatable command... >> > >> >As for `comment-dwim': Since I use `C-x C-;' >> >(`comment-region-lines') for block commenting and >> >uncommenting, I never really use `M-;' for anything >> >other than an end-of-line comment. >> > >> >`M-;' used to be bound to a command that did only >> >that: `indent-for-comment'. And since that's all >> >I really use `M-;' for, the rest of `comment-dwim' >> >is, yes, wasted and replaceable by `comment-region' >> >or my `comment-region-line'. `M-;' for eol comment, >> >`C-x C-;' for commenting/uncommenting lines. >> > >> >(defun comment-region-lines (beg end &optional arg) >> > "Like `comment-region', but comment/uncomment whole lines." >> > (interactive "*r\nP") >> > (when (> beg end) >> > (setq beg (prog1 end (setq end beg)))) >> > (let ((bol (save-excursion >> > (goto-char beg) >> > (line-beginning-position))) >> > (eol (save-excursion >> > (goto-char end) >> > (if (bolp) (point) (line-end-position))))) >> > (comment-region bol eol arg))) >> >> This is the king of features I would really support. Enable line or >> region by default. There is a package for that in melpa y find very >> useful. > >I proposed it long ago to emacs-devel. Other, >similar commands were also discussed. Emacs-devel >decided not to go there (by adding such a command >or by giving it - or even `comment-region' - a >binding by default). Apparently it was thought >that `M-;' is sufficient. Giving something a DWIM >name makes it universally useful, I guess. ;-) > >Well, `comment-region' still does have a "key" >binding in vanilla Emacs (at least in some modes), >but not a _keyboard_ key binding: > But that's the point. The common features in emacs should have the same base behavior independently of the mode (comment region, hungry deletion indent region, send to terminal (compile and execute)/ send mail/ commit) >comment-region is on