From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: finding the hork point in ~/.emacs Date: Wed, 26 Aug 2020 19:58:23 -0700 (PDT) Message-ID: References: <1731fb09-fa74-49a7-bd02-df34d8a00544@default> <87a6ygj01j.fsf@ebih.ebihd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31331"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 27 04:58:49 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kB87l-00080b-07 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 27 Aug 2020 04:58:49 +0200 Original-Received: from localhost ([::1]:39468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB87k-0004FV-2u for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 26 Aug 2020 22:58:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB87R-0004FO-5M for help-gnu-emacs@gnu.org; Wed, 26 Aug 2020 22:58:29 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:39552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB87P-0005JX-8Y for help-gnu-emacs@gnu.org; Wed, 26 Aug 2020 22:58:28 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07R2sfUI085134; Thu, 27 Aug 2020 02:58:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=mCrR7VWKO90aM/PRIaosKeASodDVBK2T//Dbja6xMnY=; b=U2jdIfU0AujAoduDZdA+FsjWvxUfUFXTpQf4FWBZBE3FXkMlE2I4G+aE0PUDFwLV1U5W K7i1Y/NL9LNoHalzHPLl23Uww8SkiweL/373ILlE5RGEkLg3mU07/fgdCD+fHTeGfK2r E4ou2ZeX5Z5ozD2b/D8YwDApk2DdDImZRmTd9SGKntN5DWtufrGiu89jpAMpMGA6W53C BzSAv2jjHNcmeVTn9ugi90iDewAKYVpd6Hw7oz5WWfnMYYBPiciZyjr6WTKzqDBxypCv kP7aLKcsbfXh47mNc7BSBFDhzktW2mhhZdKOrPcB9P7g+JtA6uH/V1ynTBpBtRx3jnDW ww== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 333dbs3snm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 27 Aug 2020 02:58:25 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07R2uH8x083941; Thu, 27 Aug 2020 02:58:25 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 333rubudud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Aug 2020 02:58:25 +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 07R2wOx3032133; Thu, 27 Aug 2020 02:58:24 GMT In-Reply-To: <87a6ygj01j.fsf@ebih.ebihd> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5044.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9725 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008270024 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9725 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008270024 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 21:42:10 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123792 Archived-At: [I really must remember that Reply All to you doesn't send to the list, for some reason. Sending again, ccing it explicitly.] > > If you use `C-u M-x comment-region' it UNcomments. >=20 > Try M-; for `comment-dwim'. It comments and then > uncomments if the region contains a comment. ... which is not as good as `comment-region', IMHO. I use `M-;' only for eol comments. IMO, it's not really made for block (un)commenting. `comment-region' works well with nesting comment blocks - it unnests a given level of nesting. (Almost like having Common Lisp's `#|' and `|#'.) `M-;' commenting or uncommenting a line in the region, depending on whether the line is commented, is never what I want. It's a poor substitute for uncommenting a given level of commenting. YMMV. > Also, this preserves comments already there. So if you have > ... do M-; > ... do M-; again ... `comment-region' does all of that, & more, & better. I actually use my `comment-region-lines', which I bind to `C-x C-;': (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=20 (goto-char beg)=20 (line-beginning-position))) (eol (save-excursion=20 (goto-char end)=20 (if (bolp) (point) (line-end-position))))) (comment-region bol eol arg))) =20 > M-; is also one of the most ergonomic keystrokes on > the keyboard, so make sure to use it often :) `M-;' has been there forever for eol comments, long before they added half-baked region-(un)commenting behavior to it.