unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* comment character
@ 2005-05-18 12:36 Rancier, Jeff
  0 siblings, 0 replies; 5+ messages in thread
From: Rancier, Jeff @ 2005-05-18 12:36 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: comment character
       [not found] <mailman.371.1116420426.25862.help-gnu-emacs@gnu.org>
@ 2005-05-18 12:58 ` Phillip Lord
  2005-05-18 13:37 ` Nickolay Savchenko
  2005-05-18 22:15 ` Tim X
  2 siblings, 0 replies; 5+ messages in thread
From: Phillip Lord @ 2005-05-18 12:58 UTC (permalink / raw)


>>>>> "Jeff" == Rancier, Jeff <Jeff.Rancier@Sensis.com> writes:

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

In the syntax table, I think.

-- 
Phillip Lord,				Phone: +44 (0) 161 275 0683
PostDoctoral Research Associate,        Email: p.lord@cs.man.ac.uk (preferred)
School of Computer Science               : p.lord@russet.org.uk
Kilburn Building                        http://www.cs.man.ac.uk/~phillord
University of Manchester                http://www.russet.org.uk  
Oxford Road
Manchester
M13 9PL

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: comment character
       [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
  2005-05-18 22:15 ` Tim X
  2 siblings, 1 reply; 5+ messages in thread
From: Nickolay Savchenko @ 2005-05-18 13:37 UTC (permalink / raw)


"Rancier, Jeff" <Jeff.Rancier@Sensis.com> writes:

> 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

-- 
Best regards
Nickolay Savchenko

 Leela: Okay, this has gotta stop. I'm going to remind Fry of his 
   humanity the way only a woman can. 
 Professor: You're going to do his laundry?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: comment character
  2005-05-18 13:37 ` Nickolay Savchenko
@ 2005-05-18 15:11   ` rgb
  0 siblings, 0 replies; 5+ messages in thread
From: rgb @ 2005-05-18 15:11 UTC (permalink / raw)


> > 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: comment character
       [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 22:15 ` Tim X
  2 siblings, 0 replies; 5+ messages in thread
From: Tim X @ 2005-05-18 22:15 UTC (permalink / raw)


"Rancier, Jeff" <Jeff.Rancier@Sensis.com> writes:

> Where is the comment character defined for each programming mode?  C-u C-h a
> didn't show me a variable name either.
> Jeff
>
>
Have a look at syntax tables in the emacs lisp reference to see what
characters in a mode are treated as a comment character.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-18 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2005-05-18 22:15 ` Tim X
2005-05-18 12:36 Rancier, Jeff

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).