unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how can I add a file extension to a font lock mode
@ 2009-07-24  0:36 n179911
  2009-07-24  8:57 ` tomas
  0 siblings, 1 reply; 3+ messages in thread
From: n179911 @ 2009-07-24  0:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Can you please tell me how can I add file extension '*.mm' to use
c/c++ font lock mode?

Thank you.




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

* Re: how can I add a file extension to a font lock mode
       [not found] <mailman.3063.1248395789.2239.help-gnu-emacs@gnu.org>
@ 2009-07-24  1:11 ` Xah Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Xah Lee @ 2009-07-24  1:11 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 23, 5:36 pm, n179911 <n179...@gmail.com> wrote:
> Hi,
>
> Can you please tell me how can I add file extension '*.mm' to use
> c/c++ font lock mode?
>
> Thank you.

(add-to-list 'auto-mode-alist '("\\.mm\\'" . c-mode))

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how can I add a file extension to a font lock mode
  2009-07-24  0:36 n179911
@ 2009-07-24  8:57 ` tomas
  0 siblings, 0 replies; 3+ messages in thread
From: tomas @ 2009-07-24  8:57 UTC (permalink / raw)
  To: n179911; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jul 23, 2009 at 05:36:19PM -0700, n179911 wrote:
> Hi,
> 
> Can you please tell me how can I add file extension '*.mm' to use
> c/c++ font lock mode?

There is a variable auto-mode-alist which associates file name patterns
with modes. You can read about it with C-h v auto-mode-alist[RET]
(that is: control-h, then "v" -- you are then queried for a var name in
the minbuffer; enter "auto-mode-alist").

To set it from your start-up file, you may use this code there:

  (add-to-list 'auto-mode-alist '("\\.mm\\'" . c++-mode))

HTH
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFKaXdzBcgs9XrR2kYRAmp7AJ4yvNB5uPdlv3NPyIpevR75KZAUfQCdEr7b
qYBPDQm/UFtN11XrVa2Z7Xo=
=puU+
-----END PGP SIGNATURE-----




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

end of thread, other threads:[~2009-07-24  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3063.1248395789.2239.help-gnu-emacs@gnu.org>
2009-07-24  1:11 ` how can I add a file extension to a font lock mode Xah Lee
2009-07-24  0:36 n179911
2009-07-24  8:57 ` tomas

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