User Profiles(2)This section describes how a user profile should be incorporated into MicroEmacs '02. A user profile defines a set of extensions to MicroEmacs which encapsulates settings which are used by an individual user.
The user profile allows:-
In order to identify a user MicroEmacs '02 uses information in the system to determine the name of the user, and in turn the configuration to use. On all systems the value of the environment variable $MENAME(5) takes priority over any other means of user identification. If this variable is not defined then the host system typically provides a mechanism to determine the current user. DOS and Windows systems present problems where a login prompt is not supplied.
Each of the supported platforms are now described.
UNIX
DOS
SET MENAME=fred
Remember to re-boot the system before the new command takes effect. (see the next step, there is another change to autoexec.bat).
Microsoft Windows
If login is not enabled then the me32.ini(8) file may be modified to provide a default login name. To add the user fred then add the following lines to the ini file:-
[guest] MENAME=fred
If login is subsequently enabled on the system then these lines should be removed. These lines force the user identification to be fred.
The above technique may be used within the windows environment to modify your login name. Assuming that the system administrator has assigned fred a user login name of fwhite, and fred requires all of his configuration files to be the same name as his UNIX login which is fred. Then fred may force his user name to fred from the me32.ini file as follows:-
[fwhite] MENAME=fred
Once fred has entered MicroEmacs he will adopt his new login name which will be used to identify his own files etc. The action of this statement is to force the environment variable $MENAME to a new value. Any other environment variables may be forced in this way i.e. $HOSTNAME is a good candidate here as the me32.ini is local to the machine.
Shared Platforms
The private user profile is stored in a separate directory. The directory that MicroEmacs uses must be created by the user, create the directory in your local file system. In addition, the MicroEmacs search path $MEPATH(5) should be modified to include your new MicroEmacs personal directory.
UNIX
Add/modify the $MEPATH(5) environment variable to include your personal directory in your .login, .chsrc or .profile file, the file and exact syntax will depend upon your shell. For a Korn shell the following line would be added to the .profile file:-
export MEPATH=$HOME/.microemacs:/usr/local/microemacs
Where $HOME is assumed to be the users login home directory, or use the directory location of your new directory.
DOS
mkdir c:\me\fred
Change the $MEPATH(5) in the autoexec.bat to include the new directory i.e.
SET MEPATH=c:\me\fred;c:\me
Windows
userPath=C:\Program Files\JASSPA\MicroEmacs
Create your MicroEmacs personal directory in this folder, the name of the folder should be your login name or $MENAME, depending upon how your name is identified.
Once you have created a new directory to store your user profile, create a default profile for yourself from MicroEmacs using the user-setup(3) dialog:-
Help => User Setup
Fill in the entries in the dialog, and ensure that Save is depressed on exit to write the files.
The dictionaries often present difficulties the first time, a prompt to save the dictionary requires the full pathname and the name of the file, the pathname is the path to your personal folder, the filename is typically your username.edf. Once the file is created you will not have a problem in the future.
Files created in the user directory include:-
In addition to the above, if new file hooks are defined then they should be added to this directory (if they are not global to the company).
The following are examples of some individuals start-up files:-
; Jon's special settings
;
; Last Modified <190698.2226>
;
; Macro to delete the whitespace, or if an a word all of the
; word until the next word is reached.
define-macro super-delete
set-variable #l0 0
!while ¬ &sin @wc " \t\n"
forward-char
set-variable #l0 &add #l0 1
!done
!repeat
!force forward-char
!if $status
set-variable #l0 &add #l0 1
!endif
!until &or &seq @wc "" ¬ &sin @wc " \t\n"
#l0 backward-delete-char
!return
!emacro
; Make a previous-buffer command.
define-macro previous-buffer
&neg @# next-buffer
!emacro
; spotless; Perform a clean and remove any multi-blank lines.
define-macro spotless
-1 clean
!emacro
; comment-adjust; Used for comments in electric-c mode (and the other
; electic modes. Moves to the comment fill position, saves having to mess
; around with comments at the end of the line.
0 define-macro comment-adjust
; delete all spaces up until the next character
!while &sin @wc " \t"
forward-delete-char
!done
; Fill the line to the current $c-margin. We use this as
; this is the only variable that tells us where the margin
; should be.
!if &gre $window-acol 0
backward-char
!if &sin @wc " \t"
forward-delete-char
!jump -4
!else
forward-char
!endif
!endif
; Now fill to the $c-margin
&sub $c-margin $window-acol insert-string " "
!emacro
; Macro to force buffer to compile buffer for C-x '
define-macro compile-error-buffer
!force delete-buffer *compile*
change-buffer-name "*compile*"
!emacro
;
; Set up the bindings.
;
global-bind-key super-delete "C-delete"
global-bind-key beginning-of-line "home"
global-bind-key end-of-line "end"
global-bind-key undo "f4"
!if &seq %emulate "ERROR"
global-bind-key comment-adjust "esc tab"
global-bind-key comment-adjust "C-insert"
; Like a korn shell please.
ml-bind-key tab "esc esc"
!endif
;
; Setup for windows and UNIX.
;
; Define my hilighting colour for Windows and UNIX.
!if &equ &band $system 0x001 0
!if ¬ &seq $platform "win32"
; Small bold font is better for me.
change-font "-*-clean-medium-r-*-*-*-130-*-*-*-*-*-*"
; Small non-bold font.
; change-font "-misc-fixed-medium-r-normal--13-*-*-*-c-70-iso8859-1"
; Change the size of the screen
82 change-screen-width
50 change-screen-depth
!endif
!endif
; Change the default diff command-line for GNU diff utility all platforms
set-variable %diff-com "diff --context --minimal --ignore-space-change --report-identical-files --recursive"
set-variable %gdiff-com "diff --context --ignore-space-change -w"
; Setup for cygnus
!if &seq $platform "win32"
set-variable %cygnus-bin-path "c:/cygwin/bin"
set-variable %cygnus-hilight 1
set-variable %cygnus-prompt "$"
!endif
; Set up the ftp flags. The letters have the following meaning:
; c - Create a console (*ftp-console* for ftp, *http-console* for http)
; s - Show the console
; p - Show download progress ('#' every 2Kb downloaded)
set-variable %ftp-flags "csp"
; Info files
;To hilight the .info and also the dir file
add-file-hook ".info dir" fhook-info ; Info-files
;To hilight all info files without the extension .info
;but starting with the text "This is info file..
-2 add-file-hook "This is Info file" fhook-info
; Finished
ml-write "Configured to Jon's requirements"
$MEPATH(5), $MENAME(5), user-setup(3), Company Profiles, File Hooks, File Language Templates, Installation.
(c) Copyright JASSPA 2002
Last Modified: 2002/01/04
Generated On: 2002/01/06