[comp.emacs] Some gnu questions

tlastran@esunix.UUCP (06/16/87)

I just installed gnuemacs 18.41 and have a couple of questions:

1. Is there an equivalent to auto-execute?  I noticed something about
   some language hooks but nothing about how to write my own language
   sensitive bindings, any suggestions on easy ways to execute commands
   when certain file extensions are read?

2. When I load vip-mode I can't get it to come up in vip-mode, it
   comes up in emacs mode requiring me to hit Ctrl-Z to switch modes,
   is there a way to force it not to come up in Emacs mode.

Forgive these questions if they have already been beaten to death here,
I am a vi user with rather limited knowledge of emacs.

--
Tom LaStrange
Evans & Sutherland Computer Corporation

UUCP Address:  {ihnp4,seismo}!utah-cs!utah-gr!uplherc!esunix!tlastran
Alternate:     {ihnp4,decvax}!decwrl!esunix!tlastran

mkhaw@teknowledge-vaxc.UUCP (06/18/87)

In article <359@esunix.UUCP> tlastran@esunix.UUCP (Tom LaStrange) writes:
>2. When I load vip-mode I can't get it to come up in vip-mode, it
>   comes up in emacs mode requiring me to hit Ctrl-Z to switch modes,
>   is there a way to force it not to come up in Emacs mode.

I asked the very same question not long ago and the answer that works
reliably came from Leonard(?) Tower (apologies if I got the name wrong:
I've already deleted the message)

What I have in my .emacs file is:

	(load "vip")
	(setq term-setup-hook 'vip-mode)

This makes the startup code in startup.elc execute the vip-mode function.
Why doing "(vip-mode)" in .emacs doesn't work I don't understand.  I'm not
complaining.  It works.

Mike Khaw
-- 
internet:  mkhaw@teknowledge-vaxc.arpa
usenet:	   {hplabs|sun|ucbvax|decwrl|sri-unix}!mkhaw%teknowledge-vaxc.arpa
USnail:	   Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303

mkhaw@teknowledge-vaxc.UUCP (06/18/87)

It turns out that to make emacs come up in vi mode, it is sufficient
for the .emacs file to say just

	(setq term-setup-hook 'vip-mode)

In my previous posting I stated that .emacs should (load "vip") ... that
is unnecessary.

Mike Khaw
-- 
internet:  mkhaw@teknowledge-vaxc.arpa
usenet:	   {hplabs|sun|ucbvax|decwrl|sri-unix}!mkhaw%teknowledge-vaxc.arpa
USnail:	   Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303

hartzell@boulder.Colorado.EDU (George Hartzell) (06/18/87)

In article <359@esunix.UUCP> tlastran@esunix.UUCP (Tom LaStrange) writes:
>
>1. Is there an equivalent to auto-execute?  I noticed something about
>   some language hooks but nothing about how to write my own language
>   sensitive bindings, any suggestions on easy ways to execute commands
>   when certain file extensions are read?
>--
>Tom LaStrange

If you look in lisp/loaddefs.el for:

(setq auto-mode-alist ........

you will see where the association is made between filename extensions
and modes.  Hope that this helps.
g.
George Hartzell			                 (303) 492-4535
MCD Biology, University of Colorado-Boulder, Boulder, CO 80309
hartzell@Boulder.Colorado.EDU  ..!{hao,nbires}!boulder!hartzell

john@xanth.UUCP (06/19/87)

In article <359@esunix.UUCP>, tlastran@esunix.UUCP (Tom LaStrange) writes:
> 1. Is there an equivalent to auto-execute?  I noticed something about
>    some language hooks but nothing about how to write my own language
>    sensitive bindings, any suggestions on easy ways to execute commands
>    when certain file extensions are read?

(describe-variable 'auto-mode-alist) gives:

Documentation:
Alist of filename patterns vs corresponding major mode functions.
Each element looks like (REGEXP . FUNCTION).
Visiting a file whose name matches REGEXP causes FUNCTION to be called.

In my .emacs I have:
  ; automatically load nroff-mode on .me files, etc. (private convention)
  (setq auto-mode-alist (append auto-mode-alist
				'(("\\.me$" . nroff-mode)
				  ("^/tmp/post" . text-mode)
				  ("^/tmp/fol" . text-mode))))

Hope this helps, and thanks to <Kyle@ODU.EDU>, our resident GNU-wizard.

-- 
John Owens		Old Dominion University - Norfolk, Virginia, USA
john@ODU.EDU		old arpa: john%odu.edu@RELAY.CS.NET
+1 804 440 4529		old uucp: {seismo,harvard,sun,hoptoad}!xanth!john