[comp.emacs] UE310 add mode from .rc?

campbell@hpdml93.HP.COM (Gary Campbell) (09/18/89)

I would like to have MicroEmacs 3.10 start up whith wrap mode in effect
on the buffer associated with the first file on the command line.  When
I put 'add-mode "wrap"' in the emacs.rc file, it works if there is no
file specified on the command line, but it doesn't work if you specify a
file.  Is there a way to do this, or do I need to use a global mode?

--
Gary Campbell
Internet: campbell%hpbsla@hplabs.HP.COM

davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) (09/19/89)

You can use a global mode or bind a macro to be run when a file is read.
By checking the filename you can turn on the modes appropriate for that
type file.

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

nwd@j.cc.purdue.edu (Daniel Lawrence) (09/19/89)

In article <340001@hpdml93.HP.COM> campbell@hpdml93.HP.COM (Gary Campbell) writes:
>I would like to have MicroEmacs 3.10 start up whith wrap mode in effect
>on the buffer associated with the first file on the command line.  When
>I put 'add-mode "wrap"' in the emacs.rc file, it works if there is no
>file specified on the command line, but it doesn't work if you specify a
>file.  Is there a way to do this, or do I need to use a global mode?

	MicroEMACS processes the startup file before it reads the
initial file in.  This is the only way it can have things set up
properly before the file gets thier (like CRYPTing) and as such, no
local mode exists until the file is read.

	If it is a particular type of file you want in WRAP mode you
could add the check for it in macro 20 in the standard emacs.rc file
(the one that gets bound to $readhook).  Or, as you pointed out, you
could just add it as a global mode, but then all your other files in the
same session will be in WRAP mode as well.  I think I would really need
to know more about how you are using emacs to determine the best
solution.

	If many enough people simply wanted the ability to do this, I
could add a new command line switch for it as well.  (The code would not
be difficult, look at the code in main.c handling the -v switch).

			Daniel Lawrence  voice: (317) 742-5153
					  arpa:	dan@midas.mgmt.purdue.edu
				The Programmer's Room 
				Fido: 1:201/10 - (317) 742-5533