From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: comment character Date: 18 May 2005 08:11:02 -0700 Organization: http://groups.google.com Message-ID: <1116429062.474825.83000@o13g2000cwo.googlegroups.com> References: <87sm0kodth.fsf@vatutin.emacs.no-ip.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1116439985 27540 80.91.229.2 (18 May 2005 18:13:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 May 2005 18:13:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 18 20:12:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DYSzy-0006R6-GQ for geh-help-gnu-emacs@m.gmane.org; Wed, 18 May 2005 20:10:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DYT2Q-00008Q-HI for geh-help-gnu-emacs@m.gmane.org; Wed, 18 May 2005 14:13:00 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 198.74.20.74 Original-X-Trace: posting.google.com 1116429067 29965 127.0.0.1 (18 May 2005 15:11:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 18 May 2005 15:11:07 +0000 (UTC) In-Reply-To: <87sm0kodth.fsf@vatutin.emacs.no-ip.org> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=198.74.20.74; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:131346 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26801 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26801 > > 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.