unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "rgb" <rbielaws@i1.net>
Subject: Re: comment character
Date: 18 May 2005 08:11:02 -0700	[thread overview]
Message-ID: <1116429062.474825.83000@o13g2000cwo.googlegroups.com> (raw)
In-Reply-To: <87sm0kodth.fsf@vatutin.emacs.no-ip.org>

> > Where is the comment character defined for each programming mode?
C-u C-h a
> > didn't show me a variable name either.
> > Jeff
>
> comment-start, comment-end, comment-add

These will, at best, show one type of comment.  Languages often
have several.

There can be no definitive place to store such information.
Some languages require an entire keyword whose position might be
significant.  For example
ECHO THIS REM IS NOT A COMMENT. THIS ENTIRE STRING WILL PRINT.
REM ECHO THIS ECHO COMMAND IS COMMENTED OUT BY A REM COMMAND
Cobol has comments in a particular set of columns.
No character actually marks the comment.
Anything in those columns is simply ignored by the compiler.

For many languages the syntax table often has them all however
modes support comment syntax that can't be represented by the
syntax table.  In this case the mode designer has a couple options.
The most common is probably to use font-lock-syntactic-keywords.
Basically a function looks at the text and determines if any of
it is comment and marks it by putting the comment start or comment
fence syntax property on a particular character and the comment
end (or another fence) on another.
But there are other ways to handle comments depending on the goals
of the mode writer.  It's generally easier to detect comments in
a mode than it is to generically create them.

  reply	other threads:[~2005-05-18 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.371.1116420426.25862.help-gnu-emacs@gnu.org>
2005-05-18 12:58 ` comment character Phillip Lord
2005-05-18 13:37 ` Nickolay Savchenko
2005-05-18 15:11   ` rgb [this message]
2005-05-18 22:15 ` Tim X
2005-05-18 12:36 Rancier, Jeff

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=1116429062.474825.83000@o13g2000cwo.googlegroups.com \
    --to=rbielaws@i1.net \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).