From: chris@grierwhite.com (Christopher J. White)
Subject: Re: syntax highlighting
Date: Tue, 28 Jan 2003 08:06:45 -0500 [thread overview]
Message-ID: <m24r7th196.fsf@bluesteel.grierwhite.com> (raw)
In-Reply-To: pan.2003.01.28.12.42.42.863278@rogers.com
>>>>> "paul" == Paul O'Donnell <odonnellp@rogers.com> writes:
paul> I am a little confused about syntax highlighting in emacs. When
paul> I open a file with *.c or *.html extensions and syntax
paul> highlighting is turned on I get the appropriate syntax
paul> highlighting.
paul> But what about bash script files?
Highlighting is font-lock-mode, using keywords appropriate for the
type of file you are editing. This depends on emacs properly
detecting the major-mode of the files you are editing. To my
knowledge, emacs has the following methods of doing this automatically:
1) Filename name matching via auto-mode-alist...when you
open "blah.sh", emacs matches this against a pattern in
auto-mode-alist and decides it's sh-mode. sh-mode is
activated and turns on font-lock-mode
2) Interpreter name matching via interpreter-mode-alist...
If first line of file is "#!", it looks for an interperter and
assigns the mode that way.
3) Presence of a line of the format:
-*- mode: MODENAME -*-
which must be present as the first nonblank line of the file. See
the info pages for Major Modes and Choosing Major modes for more info.
...cj
--
------------------------------------------------------------------------------
Christopher J. White chris@grierwhite.com
------------------------------------------------------------------------------
next prev parent reply other threads:[~2003-01-28 13:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-28 12:42 syntax highlighting Paul O'Donnell
2003-01-28 13:06 ` Christopher J. White [this message]
2003-01-28 13:07 ` David Kastrup
2003-01-28 15:11 ` Kester Clegg
2003-01-29 8:07 ` Lee Sau Dan
-- strict thread matches above, loose matches on Subject: below --
2015-03-16 17:39 Bostjan Vilfan
2015-03-15 21:31 Bostjan Vilfan
2015-03-16 2:55 ` Stefan Monnier
2014-11-16 1:40 mzp3769
2014-11-16 7:56 ` Emanuel Berg
2014-11-16 15:08 ` M P
2014-11-16 19:31 ` Bob Proulx
[not found] ` <mailman.13823.1416166289.1147.help-gnu-emacs@gnu.org>
2014-11-16 21:15 ` M P
2014-11-17 1:26 ` Robert Thorpe
2014-11-17 5:04 ` Bob Proulx
2014-11-17 14:53 ` Bruno Félix Rezende Ribeiro
2014-11-17 15:01 ` Stefan Monnier
2014-11-18 2:15 ` Bob Proulx
2014-11-18 8:59 ` Bruno Félix Rezende Ribeiro
2014-11-18 18:23 ` Bob Proulx
[not found] ` <mailman.13882.1416236018.1147.help-gnu-emacs@gnu.org>
2014-11-18 2:10 ` Emanuel Berg
[not found] ` <mailman.13854.1416200675.1147.help-gnu-emacs@gnu.org>
2014-11-18 2:00 ` Emanuel Berg
2014-11-16 21:16 ` Emanuel Berg
2014-11-17 2:15 ` Robert Thorpe
2003-01-28 16:02 Bingham, Jay
2002-11-20 22:26 Michael Mossey
2002-11-20 23:30 ` Michael Slass
2002-11-21 6:06 ` Eli Zaretskii
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=m24r7th196.fsf@bluesteel.grierwhite.com \
--to=chris@grierwhite.com \
/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).