From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: POC comment/uncomment region in nxml-mode Date: Mon, 18 Aug 2014 11:31:33 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408375923 10740 80.91.229.3 (18 Aug 2014 15:32:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Aug 2014 15:32:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tim Chambers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 18 17:31:56 2014 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 1XJOua-0001th-8f for ged-emacs-devel@m.gmane.org; Mon, 18 Aug 2014 17:31:56 +0200 Original-Received: from localhost ([::1]:44366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJOuZ-0000QW-Tk for ged-emacs-devel@m.gmane.org; Mon, 18 Aug 2014 11:31:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJOuQ-0000N1-BN for emacs-devel@gnu.org; Mon, 18 Aug 2014 11:31:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJOuH-00007p-TS for emacs-devel@gnu.org; Mon, 18 Aug 2014 11:31:46 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJOuH-00007Z-PC for emacs-devel@gnu.org; Mon, 18 Aug 2014 11:31:37 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s7IFVZ81032316; Mon, 18 Aug 2014 11:31:35 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id C223BAE091; Mon, 18 Aug 2014 11:31:33 -0400 (EDT) In-Reply-To: (Tim Chambers's message of "Tue, 22 Jul 2014 17:22:23 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5038=0 X-NAI-Spam-Version: 2.3.0.9378 : core <5038> : inlines <1187> : streams <1266968> : uri <1804044> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:173744 Archived-At: > Here's a POC for interactively commenting/uncommenting a region in > nxml-mode. I guess if I wanted to submit this as an enhancement to > nxml-mode I'd have to properly integrate the functions into nXML mode. > Looking for motivation. Anyone interest in pursuing this? IIUC, this is indeed needed, thank you. A few comments, tho: - It should not create new commands. Instead it should set (un)comment-region-function buffer-locally. - It should use the default (un)comment-region functions internally (e.g. first quote all "--", then call the default comment-region). - I don't think you need to turn "--" into "\-\-". Turning them into "-\-" should be sufficient. - comment-region followed by an uncomment-region should also work on a region which already contains comments with a quoted "--" (i.e. with a "-\-"). For that I think you also need to quote "-\-" to "-\\-" and to unquote "-\\-" to "-\-" (and same for any number of backslashed between dashes). Would you like to try to submit revised patch? Stefan