[comp.emacs] Automatic Mode switching

mbader@deep.cs.washington.edu (Mark P. Bader) (01/10/89)

I haven't been able to figure this one out (maybe has to do with my non-
knowledge of lisp):

I need to modify the variable auto-mode-alist to include some new file
specifications that will automatically call up certain modes.  In other
words, how do you add a list item to a emacs lisp variable?  (probably to
be done in my .emacs file).

Thanks.

--
Mark Bader
 mbader@uwav1.bitnet
 mbader@fred.cs.washington.edu

ugwiles@sybil (Dale Wiles) (01/11/89)

In article <MBADER.89Jan9140035@deep.cs.washington.edu>, mbader@deep (Mark P. Bader) writes:

>How do you add a list item to a emacs lisp variable?  (probably to
>be done in my .emacs file).

This is how I do it. I added this to my .emacs file so that when I
load in a file that ends with ".foo", EMACS enters "bar" mode.

(setq auto-mode-alist
  (append auto-mode-alist
	  (list (cons '"\\.foo$" 'bar-mode))))

Hope this helps.

BTW, where the #$@#$ does "foo" and "bar" come from? Why "foo" and why
"bar"?
-- 
***Palindrome->Emacs came, Dale, lad, Emacs came.*** Looks more (bonk)
* Disclaimer: I don't disclaim nothing! I am THE   * like a sick-e-more (bonk)
* official opinion of my college, state, country   * to me.
* and of all carbon based life forms in the universe.    Yogi the Space Bear.

julian@uhccux.uhcc.hawaii.edu (Julian Cowley) (01/11/89)

In article <3631@cs.Buffalo.EDU> ugwiles@sybil (Dale Wiles) writes:
>***Palindrome->Emacs came, Dale, lad, Emacs came.*** Looks more (bonk)

This reminds me of a palindrome that someone (sorry, forgot his
name) had on the net about a year and a half ago:

Ungate me, vi, I've met a GNU!

julian@uhccux.uhcc.hawaii.edu
uunet!ucsd!nosc!uhccux!julian
julian@uhccux.bitnet
"People who aren't amused don't talk."

schuetz@iraul1.ira.uka.de (Elmar Schuetz) (01/13/89)

[Sorry for following up - but I don't know the network
 of Dale's address to reply - maybe ARPA? ----|	]
					      v
In article <3631@cs.Buffalo.EDU> ugwiles@sybil (Dale Wiles) writes:
>BTW, where the #$@#$ does "foo" and "bar" come from? Why "foo" and why
>"bar"?

From news.announce.newusers - Subject: Answers to Frequently Asked Questions:
# 2.	What is the derivation of "foo" as a filler word?
#
#	The favorite story is that it comes from "fubar" which is an
#	acronym for "fouled up beyond all recognition", which is supposed
#	to be a military term.  (Various forms of this exist, "fouled"
#	usually being replaced by a stronger word.) "Foo" and "Bar" have
#	the same derivation.

And, from experience:
$ Frequently used among Lisp-programmers.

Cheers, Elmar