unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* adding extensions to cc-mode
@ 2005-08-22 10:05 jose_luis_fdez_diaz_news
  2005-08-22 18:07 ` kgold
  0 siblings, 1 reply; 3+ messages in thread
From: jose_luis_fdez_diaz_news @ 2005-08-22 10:05 UTC (permalink / raw)


Hi,

I went through the code in the .emacs file and tried to add .pc file
extensions to the auto-mode-alist, but it still doesn't color my .pc
(Pro*C)
files when I bring them up.  I am runnig emacs on Windows. Got any
suggestions?



;; This is how emacs tells the file type by the file suffix.
(setq auto-mode-alist
      (append '(("\\.mss$" . scribe-mode))
	      '(("\\.bib$" . bibtex-mode))
	      '(("\\.tex$" . latex-mode))
	      '(("\\.obj$" . lisp-mode))
	      '(("\\.st$"  . smalltalk-mode))
	      '(("\\.Z$"   . uncompress-while-visiting))
	      '(("\\.cs$"  . indented-text-mode))
	      '(("\\.C$"   . c++-mode))
	      '(("\\.cc$"  . c++-mode))
	      '(("\\.icc$" . c++-mode))
	      '(("\\.c$"   . c-mode))
	      '(("\\.pc$"   . c-mode))
	      '(("\\.y$"   . c-mode))
	      '(("\\.h$"   . c++-mode))
	      auto-mode-alist))


Thanks in advance,
Jose Luis.

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

* Re: adding extensions to cc-mode
  2005-08-22 10:05 adding extensions to cc-mode jose_luis_fdez_diaz_news
@ 2005-08-22 18:07 ` kgold
  2005-08-22 19:16   ` Peter Dyballa
  0 siblings, 1 reply; 3+ messages in thread
From: kgold @ 2005-08-22 18:07 UTC (permalink / raw)


Did you re-read the .emacs file after you edited it.

E.g., restart emacs, or point to the end of the statement
and C-x C-e (C-x C-e runs the command eval-last-sexp).

The extra quotes might work, but mine looks like:

(setq auto-mode-alist
      (append '(
		("\\.[Ss]$"	  . asm-mode)
		("\\.68k$"	  . asm-mode)
		("\\.inc$"	  . asm-mode)
		("\\.[bB][aA][tT]$"	. bat-mode)
		("\\.x$"	  . c-mode)
		) auto-mode-alist))

jose_luis_fdez_diaz_news@yahoo.es writes:
> 
> I went through the code in the .emacs file and tried to add .pc file
> extensions to the auto-mode-alist, but it still doesn't color my .pc
> (Pro*C)
> files when I bring them up.  I am runnig emacs on Windows. Got any
> suggestions?
> 
> 
> 
> ;; This is how emacs tells the file type by the file suffix.
> (setq auto-mode-alist
>       (append '(("\\.mss$" . scribe-mode))
> 	      '(("\\.bib$" . bibtex-mode))
> 	      '(("\\.tex$" . latex-mode))
> 	      '(("\\.obj$" . lisp-mode))
> 	      '(("\\.st$"  . smalltalk-mode))
> 	      '(("\\.Z$"   . uncompress-while-visiting))
> 	      '(("\\.cs$"  . indented-text-mode))
> 	      '(("\\.C$"   . c++-mode))
> 	      '(("\\.cc$"  . c++-mode))
> 	      '(("\\.icc$" . c++-mode))
> 	      '(("\\.c$"   . c-mode))
> 	      '(("\\.pc$"   . c-mode))
> 	      '(("\\.y$"   . c-mode))
> 	      '(("\\.h$"   . c++-mode))
> 	      auto-mode-alist))

-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

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

* Re: adding extensions to cc-mode
  2005-08-22 18:07 ` kgold
@ 2005-08-22 19:16   ` Peter Dyballa
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Dyballa @ 2005-08-22 19:16 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.08.2005 um 18:07 schrieb kgold:

> The extra quotes might work, but mine looks like:
>
> (setq auto-mode-alist
>       (append '(
> 		("\\.[Ss]$"	  . asm-mode)
> 		("\\.68k$"	  . asm-mode)
> 		("\\.inc$"	  . asm-mode)
> 		("\\.[bB][aA][tT]$"	. bat-mode)
> 		("\\.x$"	  . c-mode)
> 		) auto-mode-alist))
>

And mine looks more like:

(setq auto-mode-alist
   (append
     '(("\\.\\(xsl\\|id\\[de\\]\\)\\'"                  . sgml-mode)
       ("\\.\\(plist\\|xml\\|xsl\\|fo\\)\\'"            . xml-mode)
    auto-mode-alist)))

Please notice the different use of parentheses! \\' is exactly matching 
a string's end. $ isn't that exact (I don't remember the exact reason).

--
Greetings

   Pete

 From error to error, one discovers the entire truth.
                                                             -Sigmund 
Freud

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

end of thread, other threads:[~2005-08-22 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-22 10:05 adding extensions to cc-mode jose_luis_fdez_diaz_news
2005-08-22 18:07 ` kgold
2005-08-22 19:16   ` Peter Dyballa

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