From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Is Elisp really that slow? Date: Wed, 15 May 2019 10:29:42 -0700 (PDT) Message-ID: <9f750259-44f6-4d39-b01c-db440e8d8782@default> References: <20190514235412.kncazq45szlum2gr@Ergus> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="147767"; mail-complaints-to="usenet@blaine.gmane.org" To: Stefan Monnier , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 15 19:41:40 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 1hQxuN-000cMT-O7 for geh-help-gnu-emacs@m.gmane.org; Wed, 15 May 2019 19:41:39 +0200 Original-Received: from localhost ([127.0.0.1]:40398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQxuM-00035g-Kc for geh-help-gnu-emacs@m.gmane.org; Wed, 15 May 2019 13:41:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQxti-0002OM-5U for help-gnu-emacs@gnu.org; Wed, 15 May 2019 13:40:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQxiv-0005qA-M0 for help-gnu-emacs@gnu.org; Wed, 15 May 2019 13:29:50 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:59314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQxiv-0005mp-DJ for help-gnu-emacs@gnu.org; Wed, 15 May 2019 13:29:49 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4FHT242127752; Wed, 15 May 2019 17:29:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=LaQV4nu8zu7R0EU5SO9CvQS2Qf1kPWC2sMmEeXz7XV4=; b=MW2RhhpYXkIBIv/Q5j/PBy8z+BDm5EFPP6bdRSEelBSZ50dmz17dKtxKWChdD5RhSXpb ggvTL9/N/GFaB/6GUsc9Nqh6h5Uz/431RrEaWPY7nKjh/e6Pr5oGLlj1ogCyFJP/3wS3 FxRr/Wv3+rZRSkp9cypaHGLdI0uriXrXm5y2BIsxz69Gt5FqSaVTGQKzBusOLN2VTB6G VarP057fluArrm2FVDMGHdzo2+aTv67NfFaPUB2Afi5UYPfnO0OFsZ93IHZnVSnQ44l9 OLECjo+SSY/e+91u1aWCr5g6vucD3UKwpUmz1fuUEyd78dmqWwO3940+kzLFEcPtYsKD Nw== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2sdnttxdve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2019 17:29:46 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4FHTMsQ184509; Wed, 15 May 2019 17:29:45 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2sgp32h68m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2019 17:29:45 +0000 Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4FHThIK013312; Wed, 15 May 2019 17:29:44 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4849.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9257 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=18 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=634 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905150106 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9257 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=18 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=662 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905150106 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 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:120408 Archived-At: > > And, as already mentioned, comment-dwim is not an > > alternative to comment-region. They do different > > things. >=20 > I beg to differ. And your begged difference, which presumably shows that they do NOT do different things, is what? ;-) I have nothing special to say here about `C-c C-c' or `cc-mode'. But I will say 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. 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)))