unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: how to define a comment syntax for files having a specific extension?
Date: Mon, 02 Apr 2007 10:01:16 -0400	[thread overview]
Message-ID: <jwvmz1qswpu.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 1175504010.137805.217560@o5g2000hsb.googlegroups.com

> and working on journal text files *.jou for which the commented lines
> must start with the character "/".

> While editing one of such files I need to run
> M-: (setq comment-start "/")
> in order to comment regions with the sequence C-c;

> I'd like to have emacs recognize the "*.jou" files and
> apply the corresponding comment syntax automatically,
> sparing me from having to type
> M-: (setq comment-start "/")
> each time I start working on a *.jou file.

You need to create a major mode for those types of files.
Check out sample-mode.el


        Stefan

  reply	other threads:[~2007-04-02 14:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02  8:53 how to define a comment syntax for files having a specific extension? gento
2007-04-02 14:01 ` Stefan Monnier [this message]
2007-04-02 15:23   ` gento
2007-04-03  7:30     ` Pascal Bourguignon
2007-04-03 10:51       ` gento
2007-04-03  8:27     ` Tim X

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=jwvmz1qswpu.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /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).