On Wed, Nov 03, 1999 at 11:16:45PM -0600, Mike Friedrichs wrote:
> I assume you issue the command xemacs.
> 
> Then where do you issue the command 'syntax on'.

Ok, assuming you've got XEmacs up and running: Usually, XEmacs does a
pretty good job in figuring out for itself when you need syntax
highlighting. However, if you want to be sure, you can add something
like this to your ~/.emacs file:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
(setq auto-mode-alist (cons (cons "\\.c$" 'c-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.h$" 'c-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.y$" 'c-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.l$" 'c-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.cc$" 'c++-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.tex$" 'tex-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.toc$" 'tex-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.sty$" 'tex-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.cls$" 'tex-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.clo$" 'tex-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.texinfo$" 'texinfo-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.htm$" 'html-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.html$" 'html-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.shtml$" 'html-mode) auto-mode-alist))
(setq auto-mode-alist (cons  '("\\.v\\'" . verilog-mode) auto-mode-alist))
(setq auto-mode-alist (cons  '("\\.ver\\'" . verilog-mode) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.java$" . java-mode)) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.js$" . java-mode)) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.pl$" . perl-mode)) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.cgi$" . perl-mode)) auto-mode-alist))

(add-hook 'ams-tex-mode-hook  'turn-on-font-lock)
(add-hook 'asm-mode-hook      'turn-on-font-lock)
(add-hook 'awk-mode-hook      'turn-on-font-lock)
(add-hook 'bibtex-mode-hook   'turn-on-font-lock)
(add-hook 'c-mode-hook                'turn-on-font-lock)
(add-hook 'c++-mode-hook      'turn-on-font-lock)
(add-hook 'dired-mode-hook    'turn-on-font-lock)
(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
(add-hook 'latex-mode-hook    'turn-on-font-lock)
(add-hook 'lisp-mode-hook     'turn-on-font-lock)
(add-hook 'perl-mode-hook     'turn-on-font-lock)
(add-hook 'postscript-mode-hook 'turn-on-font-lock)
(add-hook 'tex-mode-hook 'turn-on-font-lock)
(add-hook 'texinfo-mode-hook 'turn-on-font-lock)
(add-hook 'html-mode-hook 'turn-on-font-lock)
(add-hook 'verilog-mode-hook 'turn-on-font-lock)
(add-hook 'csh-mode-hook 'turn-on-font-lock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    
Those lines are from my own .emacs and cater for C, C++, TeX/LaTeX,
texinfo, HTML, Java, Verilog, Csh, Emacs-Lisp and Perl, though I haven't
used the Java, texinfo and C++ modes yet. Note: The Verilog mode is not
part of the XEmasc distribution and neither is the Csh mode.

In addition, you can add a comment like this to your source files:

# -*- mode: perl -*-

(for a Perl file)

That will also tell XEmacs what mode to use and comes in handy, if your
script files don't start with "#!/path/to/interpreter" and don't have a
known file extension.
Also, most of the modes not only support syntax highlighting and
auto-indentation, but also come with a set of keyboard shortcuts
(especially handy in HTML and LaTeX mode). You can list them with 
'Ctrl-h b'.

And last but not least: When coming from the DOS world, you might find a
little add-on called "pc-select.el" very helpful - it changes the
keyboard assignments so that you can use "Shift+MOVEMENT_KEY" to mark
text, Ctrl-Insert/Shift-Insert/Shift-Del to copy/paste/cut and things
like that. I found it very helpful.
You can find pc-select.el at the XEmacs web site:
http://www.xemacs.org/Download/elispPackages.html
If you have difficulties setting pc-select.el up, give me a shout and
I'll try to help.

HTH,

Thomas
-- 
             "Look, Ma, no obsolete quotes and plain text only!"

     Thomas Ribbrock | http://www.bigfoot.com/~kaytan | ICQ#: 15839919
   "You have to live on the edge of reality - to make your dreams come true!"


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to