all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* file association in emacs
@ 2007-05-25 12:17 ypitrey
  2007-05-25 12:24 ` Thomas Hühn
  0 siblings, 1 reply; 5+ messages in thread
From: ypitrey @ 2007-05-25 12:17 UTC (permalink / raw)
  To: Help-gnu-emacs


hi,

how can i have the m4-mode activated automatically when i open a .m4 or .m4x
file?

more generally, how can i associate a syntaxic mode with a file type?

thanks a lot!

-- 
View this message in context: http://www.nabble.com/file-association-in-emacs-tf3815773.html#a10801875
Sent from the Emacs - Help mailing list archive at Nabble.com.

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

* Re: file association in emacs
  2007-05-25 12:17 file association in emacs ypitrey
@ 2007-05-25 12:24 ` Thomas Hühn
  2007-05-25 13:31   ` Sebastian Tennant
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Hühn @ 2007-05-25 12:24 UTC (permalink / raw)
  To: help-gnu-emacs

ypitrey <ypitrey@gmail.com> writes:

> how can i have the m4-mode activated automatically when i open a .m4 or .m4x
> file?
>
> more generally, how can i associate a syntaxic mode with a file type?

Add something like ("\\.m4$" . m4-mode) to auto-mode-alist.

Thomas

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

* Re: file association in emacs
       [not found] <mailman.1222.1180095472.32220.help-gnu-emacs@gnu.org>
@ 2007-05-25 12:45 ` Ivan
  2007-06-10  0:48   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Ivan @ 2007-05-25 12:45 UTC (permalink / raw)
  To: help-gnu-emacs

On петък, Май 25 2007, ypitrey wrote:

> hi,
>
> how can i have the m4-mode activated automatically when i open a .m4 or .m4x
> file?
>
> more generally, how can i associate a syntaxic mode with a file type?
>
> thanks a lot!

Try this way:

(setq auto-mode-alist
      (append '(("\\.m4$" . m4-mode)
                ("\\.m4cx$" . m4-mode)) auto-mode-alist))

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

* Re: file association in emacs
  2007-05-25 12:24 ` Thomas Hühn
@ 2007-05-25 13:31   ` Sebastian Tennant
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Tennant @ 2007-05-25 13:31 UTC (permalink / raw)
  To: help-gnu-emacs

Quoth Thomas Hühn <newsgroups@thomas-huehn.de>:
> ypitrey <ypitrey@gmail.com> writes:
>
>> how can i have the m4-mode activated automatically when i open a .m4 or .m4x
>> file?
>>
>> more generally, how can i associate a syntaxic mode with a file type?
>
> Add something like ("\\.m4$" . m4-mode) to auto-mode-alist.
>
> Thomas

Add

 (add-to-list 'auto-mode-alist '("\\.m4x*$" . m4-mode))

to your ~/.emacs if you want to match '.m4' and '.m4x' file suffixes.

Sebastian

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

* Re: file association in emacs
  2007-05-25 12:45 ` Ivan
@ 2007-06-10  0:48   ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2007-06-10  0:48 UTC (permalink / raw)
  To: help-gnu-emacs

> (setq auto-mode-alist
>       (append '(("\\.m4$" . m4-mode)
>                 ("\\.m4cx$" . m4-mode)) auto-mode-alist))

The "end of string" mark should be "\\'" rather than "$" (which means "end
of line").


        Stefan

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

end of thread, other threads:[~2007-06-10  0:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-25 12:17 file association in emacs ypitrey
2007-05-25 12:24 ` Thomas Hühn
2007-05-25 13:31   ` Sebastian Tennant
     [not found] <mailman.1222.1180095472.32220.help-gnu-emacs@gnu.org>
2007-05-25 12:45 ` Ivan
2007-06-10  0:48   ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.