unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Tim Chambers <tbchambers@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: POC comment/uncomment region in nxml-mode
Date: Mon, 18 Aug 2014 11:31:33 -0400	[thread overview]
Message-ID: <jwvvbppq0tz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CABoxX=yay2SGfAZEhC7wCgnRJBKVVOAsqXwBztnpa6Of1_ib7w@mail.gmail.com> (Tim Chambers's message of "Tue, 22 Jul 2014 17:22:23 -0600")

> 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



  parent reply	other threads:[~2014-08-18 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 23:22 POC comment/uncomment region in nxml-mode Tim Chambers
2014-07-23  6:36 ` Andreas Röhler
2014-08-18 15:31 ` Stefan Monnier [this message]
2014-08-19 15:12   ` Tim Chambers
2014-08-20 14:13     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvvbppq0tz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=tbchambers@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).