unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: comment / uncomment region
Date: Mon, 02 Aug 2004 09:49:08 -0600	[thread overview]
Message-ID: <410E6274.6070009@yahoo.com> (raw)
In-Reply-To: 87isc339ir.fsf@thalassa.informatimago.com

Pascal Bourguignon wrote:
 > Yes, that's because comment-start is a buffer-local variable.
 > You have to set it in your grammar buffer.
 >
 > You can do it manually with:
 >
 >     M-x eval-expression RET (setq comment-start "//") RET
 >
 > or rather:
 >
 >     M-x set-variable    RET comment-start RET "//" RET
 >
 >
 > You could put this at the end of each of your grammar files:
 >
 > // Local Variables:
 > // comment-start: "//"
 > // End:
 >
 > Or, if you don't want to program a mode for your grammar files you
 > could have a find-file-hook that would check the file type (or file
 > name extension) and would initialize the buffer environment when it
 > finds that a grammar is being opened. Something like:
 >
 > (add-hook 'find-file-hook
 >      (lambda ()
 >         (when (string-match "\\.grammar$" (buffer-file-name))
 >            (setf comment-start "//")
 >            ;; ...
 >            )))

Those are all good suggestions, but I would recommend trying out
define-generic-mode: you can define your own major mode just by
specifying 6 values, most of which are just lists of strings
(keywords, etc.).

-- 
Kevin Rodgers

  parent reply	other threads:[~2004-08-02 15:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2297.1091309895.1960.help-gnu-emacs@gnu.org>
2004-08-01  1:57 ` comment / uncomment region Pascal Bourguignon
2004-08-02  2:33   ` exits funnel
2004-08-02 15:49   ` Kevin Rodgers [this message]
2004-08-03  3:12   ` exits funnel
     [not found] <mailman.2535.1091502983.1960.help-gnu-emacs@gnu.org>
2004-08-03  8:21 ` Pascal Bourguignon
2004-08-03 14:16   ` Stefan Monnier
2004-07-31 21:34 exits funnel

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=410E6274.6070009@yahoo.com \
    --to=ihs_4664@yahoo.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.
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).