From: David House <dhouse@janestreet.com>
To: Christophe TROESTLER <Christophe.Troestler@umons.ac.be>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: [Announce] New release of tuareg mode
Date: Fri, 25 May 2012 07:13:50 +0100 [thread overview]
Message-ID: <CAK=fH+hUUrgCZdNyqqV__h3pTVDGaNJLW=VQ60FLQArYF1HDng@mail.gmail.com> (raw)
In-Reply-To: <20120524.220613.1066733202670535323.Christophe.Troestler@umons.ac.be>
I have C-; for a custom function called comment-current-line. It's
probably one of my most used custom functions.
I do use M-; to insert comments at the end of nonblank lines, albeit
rarely, so I would probably stick with my curernt solution.
On Thu, May 24, 2012 at 9:06 PM, Christophe TROESTLER
<Christophe.Troestler@umons.ac.be> wrote:
> Hi,
>
> By default, Emacs binds M-; to comment-dwim -- a powerful commenting
> macro. However, to alleviate the absence of single line comment in
> OCaml, I am thinking to bind M-; in tuareg instead to the following
> variant:
>
> (defun comment-dwim-line (&optional arg)
> "Replacement for the comment-dwim command.
> If no region is selected and current line is not blank and we are
> not at the end of the line, then comment current line. Replaces
> default behaviour of comment-dwim, when it inserts comment at the
> end of the line."
> (interactive "*P")
> (comment-normalize-vars)
> (if (and (not (region-active-p)) (not (looking-at "[ \t]*$")))
> (comment-or-uncomment-region (line-beginning-position)
> (line-end-position))
> (comment-dwim arg)))
>
> (taken from http://www.emacswiki.org/emacs/CommentingCode) to easily
> toggle commenting single lines.
>
> I'd like to know your opinion. Do you think (or not) it would be a
> useful default?
>
> Best,
> C.
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
next prev parent reply other threads:[~2012-05-25 6:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 15:15 [Caml-list] Tuareg-mode and pipes | Romain Bardou
2012-05-23 15:53 ` Eric Cooper
2012-05-23 15:55 ` Romain Bardou
2012-05-23 16:15 ` Eric Cooper
2012-05-23 17:16 ` [Caml-list] " Hongbo Zhang
2012-05-23 18:03 ` Thibault Suzanne
[not found] ` <20120523.225137.2235002212124282451.Christophe.Troestler@umons.ac.be>
2012-05-23 21:27 ` [Caml-list] " Mehdi Dogguy
[not found] ` <20120524.104708.916458905184337628.Christophe.Troestler@umons.ac.be>
[not found] ` <20120524.220613.1066733202670535323.Christophe.Troestler@umons.ac.be>
2012-05-25 6:13 ` David House [this message]
2012-05-24 8:10 ` Romain Bardou
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK=fH+hUUrgCZdNyqqV__h3pTVDGaNJLW=VQ60FLQArYF1HDng@mail.gmail.com' \
--to=dhouse@janestreet.com \
--cc=Christophe.Troestler@umons.ac.be \
--cc=caml-list@inria.fr \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox