[net.emacs] text-mode in emacs

brian@fritz.UUCP (Brian Meyette) (08/09/84)

Does anyone out there know how to get Unipress emacs version 264
running on 4.2 BSD to come up in text-mode, rather than normal?

I've tried:

(autoload "text-mode" "text-mode")
(autoload "text-mode" "text-mode.ml")
(setq text-mode 1)
(autoexecute "text-mode" "text-mode.ml")

The setq and autoexecute bombed and the autoload did nothing.  We have an
emacs macro library with text-mode.ml and text-mode.mo in it.

Thanks for any help you can give me.

Brian Meyette

young@AMES-NAS-GW.ARPA (08/11/84)

From:  Bruce Young <young@AMES-NAS-GW.ARPA>

Brian,

Text mode is easily obtained with (load "text-mode")
in your emacs profile named .emacs_pro

With no extension (load "text-mode") picks *.mo or *.ml
according to the more current date.

Your (autoload "command" "file") loads file only when
command is invoked within emacs.

from: Bruce Young  GE @ AMES

chris@umcp-cs (08/12/84)

Say what?

Try this:

	(autoload "text-mode" <whatever file you keep yours in>)
	(auto-execute "text-mode" "*.nr")
	(auto-execute "text-mode" "/tmp/Re*")

The auto-execute function takes a function name and a ``pattern''
(which must be either an asterisk followed by non-asterisk text
or non-asterisk text followed by an asterisk or just an asterisk,
whew!) and runs the named function whenever you visit a file whose
name matches the ``pattern''.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland

jpm@calmasd.UUCP (John McNally) (08/14/84)

< how to set up emacs to enter text mode on entry>
Yes, I can answer that one.  I have customized emacs quite a bit and
have actually bound text-mode to a key so I can go back and forth
between C and text (I find normal mode pretty much useless).  You can
also set it up to go into text mode when you enter the editor.  The 
autoload commands you created are (probably) not necessary.  They are
not in my profile, but they dont hurt.  Its your autoexecute thats all
wrong.  Autoexecute specifies the type of file needed to invoke a particular
mode.  The way you have it setup the only way you would get into text
mode automatically is on that particular file name in your a-e. I suggest:
(autoexecute "text-mode" "*")
which will give text mode for all files, unless you explicitly change to
another mode.  You also might like a little friendlier text mode as 
defined by the following in your .emacs_pro:

(defun
  (text-action
    (text-mode)
    (set "left-margin" 5)
    (set "right-margin" 72)
    (set "paragraph-indent" 5)
    (no-value)))
(auto-execute "text-action" "*")

paragraph-indent is a strange beast in emacs.  Its discussed in the
manual, but (at least our version) has no such variable.  However, if
you define the variable with a setq (set, set-default, lots of ways),
then emacs knows about it and uses it as described.  Very odd!  This
all applies to UniPress emacs.
So, that should solve the root of your problem.  Good luck

John McNally sdcsvax!calmasd!jpm

 

chris@umcp-cs.UUCP (08/21/84)

Not that it's important in that particular example, but if you're
setting Emacs variables and the names are fixed it's a lot faster
(in versions with .mo files) to use

	(setq xyzzy 1)

than to use

	(set "xyzzy" 1)

The reason is that the compiler generates the name and a null pointer.
The first time the code is used, the variable is instantiated (if
necessary) and the pointer is modified to point to it.  Further
invocations of the same code need not look up the name ever again.
If you use the string name, however, a table lookup is done every
time.  (AND, the table is not sorted or hashed in any way!  The
various tables need to be consolidated somehow and a faster lookup
mechanism created.)  (Who, me?)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland