Clean up startup and help files.

This commit is contained in:
Renaud 2021-09-16 09:44:59 +08:00
parent 0c584e5490
commit 8726e5b8aa
3 changed files with 89 additions and 396 deletions

View File

@ -19,7 +19,7 @@
-------------------------------------------------------------------------------
=> THE VERY BASICS
Notations: ^X means <Ctrl> and X. The <Meta> key is <Esc> on most systems.
Exiting: ^G aborts almost any operation. ^X ^C will get you out of uEmacs.
Exiting: ^G aborts almost any operation. ^X ^C will get you out of µEMACS.
A BUFFER is a named area containing a FILE being edited. Many buffers may
be active at once. Many WINDOWS may be active at once on the screen. All
@ -37,7 +37,7 @@ Beginning of file ..... Meta < End of file ........... Meta >
-------------------------------------------------------------------------------
=> FILE COMMANDS
Find file ............. ^X ^F Quick exit ............ Meta Z
View file ............. ^X ^V Exit emacs ............ ^X ^C
View file ............. ^X ^V Exit µEMACS ........... ^X ^C
Insert file ........... ^X ^I
Change file name ...... ^X N Filter buffer ......... ^X #
Save file ............. ^X ^D
@ -118,12 +118,12 @@ Query replace string .. Meta ^R :: Yes/no Y/N, replace rest !, cancel ^G.
-------------------------------------------------------------------------------
=> ACCESSING THE OPERATING SYSTEM
Quick exit ............ Meta Z :: Write out all changed buffers and exit.
Exit emacs ............ ^X ^C :: Exit without automatic save.
Exit µEMACS ........... ^X ^C :: Exit without automatic save.
I shell ............... ^X C :: Start a new command processor.
Shell command ......... ^X ! :: Execute one operating system command.
Pipe command .......... ^X @ :: Pipe command results to a new buffer. *
Filter buffer ......... ^X # :: Filter buffer through a program. *
Execute program ....... ^X $ :: * Not under VMS.
Pipe command .......... ^X @ :: Pipe command results to a new buffer.
Filter buffer ......... ^X # :: Filter buffer through a program.
Execute program ....... ^X $ ::
-------------------------------------------------------------------------------
=> MACRO COMMANDS
Begin macro ........... ^X (

310
emacs.rc
View File

@ -1,113 +1,51 @@
; EMACS.RC / .emacsrc
; .emacsrc -- Startup file for µEMACS 4.2
;
; Startup file for MicroEMACS 3.9 and uEmacs/PK 4.0
; This file is executed every time the editor is entered.
;
; Modified by Petri Kutvonen, last edited September 1991.
set $discmd "FALSE"
set $discmd FALSE
!if &not &seq $progname µEMACS
; uemacs/PK and MicroEMACS
set $discmd TRUE
!return
!endif
!if &seq $progname "µEMACS"
!force execute-file &cat $HOME "/.uerc"
set $tab 4
# set $viewtab TRUE # uncomment this line if you need to visualize tabs
set $fillcol 76
## Help facility
!if &seq $TERM cygwin
set $scroll FALSE
set %F1 FNP #currently not readable
set %Home FN1
set %End FN4
!else
; First, try to resolve if we are on a PC ... yes, this is a kludge
!if &seq $sres "NORMAL"
set %system "OTHER"
!else
set %system "PC"
set %F1 FNP
set %Home FNH
set %End FNF
!endif
!if &seq %system "PC"
; PC specific initialization
write-message "(Setting up)"
; Comment out or change this line if you want more than 25 lines,
; other possible $sres values include EGA and VGA
set $sres "CGA"
; Uncomment next line if your old screen "snows"
;set $flicker "TRUE"
; If your screen "snows" you'll not like scrolling
!if &seq $flicker "TRUE"
set $scroll "FALSE"
!endif
; Function keys (unshifted)
; f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
; FN; FN< FN= FN> FN? FN@ FNA FNB FNC FND
bind-to-key help FN;
bind-to-key exit-emacs FND
; Function keys (shifted)
; F1 F2 F3 F4 F5 F6 F7 F8 F9 F10
; FNT FNU FNV FNW FNX FNY FNZ FN[ FN\ FN]
; Other special keys (unshifted)
; Home End Ins Del PgUp PgDn
; FNG FNO FNR FNS FNI FNQ
; Some common Alt-keys
; Alt-X Alt-Z Alt-C Alt-F Alt-O
; FN- FN, FN. FN! FN^X
bind-to-key exit-emacs FN-
bind-to-key quick-exit FN,
bind-to-key i-shell FN.
bind-to-key find-file FN!
bind-to-key view-file FN/
bind-to-key next-window FN^X
; Set screen colors
; You can define a DOS environment variable EMACS_BW (any value)
; if you don't like colors, e.g. if you have a LCD screen
!if &seq &env "EMACS_BW" ""
add-global-mode "blue"
add-global-mode "HIGH"
!endif
!endif
; Help facility
40 store-macro
set $discmd "FALSE"
!store 40
set $discmd FALSE
!if &not &seq $cbufname "emacs.hlp"
write-message "(Loading Help)"
!force help
!force 8 resize-window
!if &seq %system "PC"
!if &seq &env "EMACS_BW" ""
add-mode "red"
!endif
bind-to-key execute-macro-38 FNI
bind-to-key execute-macro-37 FNQ
!if &not &seq $cbufname "emacs.hlp"
write-message "(Failed to load Help)"
!else
bind-to-key execute-macro-38 FN5
bind-to-key execute-macro-37 FN6
!force 8 resize-window
bind-to-key execute-macro-39 FN5
bind-to-key execute-macro-38 FN6
bind-to-key execute-macro-37 %Home
bind-to-key execute-macro-36 %End
beginning-of-line
2 forward-character
1 redraw-display
set %hlpupdn "[PgUp] / [PgDn]"
set %hlphelp "[F1]"
run helponhelp
!endif
beginning-of-line
2 forward-character
1 redraw-display
save-window
!if &seq %system "PC"
set %hlpupdn "<PgUp> / <PgDn>"
set %hlphelp "<F1>"
!else
set %hlpupdn "<Prev Scrn> / <Next Scrn>"
set %hlphelp "<Help>"
!endif
execute-macro-39
!else
set %hlpcode &lef $line 2
!if &seq %hlpcode ".."
@ -117,33 +55,29 @@ bind-to-key next-window FN^X
beginning-of-line
2 forward-character
1 redraw-display
execute-macro-39
run helponhelp
!else
!if &seq %system "PC"
bind-to-key previous-page FNI
bind-to-key next-page FNQ
!else
bind-to-key previous-page FN5
bind-to-key next-page FN6
!endif
!force restore-window
!force search-reverse "=>"
bind-to-key previous-page FN5
bind-to-key next-page FN6
bind-to-key beginning-of-file %Home
bind-to-key end-of-file %End
!force delete-window
clear-message-line
!endif
!endif
set $discmd "TRUE"
set $discmd TRUE
!endm
bind-to-key execute-macro-40 M-?
!if &seq %system "PC"
bind-to-key execute-macro-40 FN;
!else
bind-to-key execute-macro-40 FNh
!endif
bind-to-key execute-macro-40 %F1
bind-to-key execute-macro-40 M-O
bind-to-key beginning-of-file %Home
bind-to-key end-of-file %End
; Help on Help
39 store-macro
## Help on Help
!store helponhelp
!if &seq &rig $line 5 "INDEX"
write-message &cat "Select topic from list and press " %hlphelp
!else
@ -151,150 +85,72 @@ bind-to-key execute-macro-40 M-?
!endif
!endm
; Previous help page
38 store-macro
## Previous help page
!store 39
!if &seq $cbufname "emacs.hlp"
beginning-of-line
!force search-reverse "=>"
2 forward-character
1 redraw-display
execute-macro-39
run helponhelp
!else
previous-page
!endif
!endm
; Next help page
37 store-macro
## Next help page
!store 38
!if &seq $cbufname "emacs.hlp"
beginning-of-line
2 forward-character
!force search-forward "=>"
1 redraw-display
execute-macro-39
run helponhelp
!else
next-page
!endif
!endm
; Set up auto CMODE
!store 37
beginning-of-file
!if &seq $cbufname "emacs.hlp"
execute-macro-39
!endif
!endm
36 store-macro
!if &seq &mid $cfname 1 7 "/tmp/Re"
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/.ed" 0
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/.let" 0
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/.art" 0
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/nn." 0
add-mode "wrap"
!return
!endif
set %rctmp &sin $cfname "."
!if &equ %rctmp 0
!return
!endif
set %rctmp &mid $cfname &add %rctmp 1 5
!if &or &seq %rctmp "c" &seq %rctmp "h"
add-mode "cmode"
!endif
!if &or &seq %rctmp "txt" &or &seq %rctmp "doc" &or &seq %rctmp "tmp" &seq %rctmp "tex"
add-mode "wrap"
!store 36
end-of-file
!if &seq $cbufname "emacs.hlp"
execute-macro-39
!endif
!endm
## Set up auto CMODE or WRAP
!store 35
set %rctmp &right $cfname 4
!if &or &seq .txt %rctmp &seq .doc %rctmp
add-mode wrap
!return
!endif
set %rctmp &right %rctmp 2
!if &or &seq .c %rctmp &seq .h %rctmp
add-mode cmode
!return
!endif
!endm
bind-to-key execute-macro-36 M-FNR
bind-to-key execute-macro-35 M-FNR
; Setup for ASCII {|}[\] to ISO Latin-1 translation
21 store-macro
insert-string "ä"
!endm
22 store-macro
insert-string "ö"
!endm
23 store-macro
insert-string "å"
!endm
24 store-macro
insert-string "Ä"
!endm
25 store-macro
insert-string "Ö"
!endm
26 store-macro
insert-string "Å"
!endm
27 store-macro
bind-to-key execute-macro-21 {
bind-to-key execute-macro-22 |
bind-to-key execute-macro-23 }
bind-to-key execute-macro-24 [
bind-to-key execute-macro-25 \
bind-to-key execute-macro-26 ]
write-message "ISO Latin-1 äöåÄÖÅ"
!endm
28 store-macro
unbind-key {
unbind-key |
unbind-key }
unbind-key [
unbind-key \
unbind-key ]
write-message "ASCII {|}[\]"
!endm
bind-to-key execute-macro-27 ^X[
bind-to-key execute-macro-28 ^X]
; Make cut-paste easier in window systems
## Make cut-paste easier in window systems
bind-to-key newline ^J
; uEmacs/PK specific initialization
!if &seq $progname "uEmacs/PK"
; Don't scroll on a Sun
!if &or &seq $TERM "sun" &seq $TERM "sun-cmd"
set $scroll "FALSE"
!endif
; Execute local initialization files
!if &seq %system "PC"
!force execute-file "EM.RC"
!else
!force execute-file &cat $HOME "/.emrc"
!force execute-file ".emrc"
!endif
!endif
!if &gre &sin $LANG "UTF-8" 0
!if &or &sin $LANG "UTF-8" &sin $LANG "utf8"
add-global-mode "utf-8"
!endif
!if &gre &sin $LANG "utf8" 0
add-global-mode "utf-8"
!endif
add-global-mode "utf-8"
!endif
set $discmd "TRUE"
set $discmd TRUE

163
ue.rc
View File

@ -1,163 +0,0 @@
# UE.RC
#
# Startup file for µEMACS 4.2
# This file is executed every time the editor is entered.
# If you want to keep compatibility with em (uEmacs/PK) or me (MicroEMACS)
# cp emacs.rc ~/.emacsrc
# cp ue.rc ~/.uerc
# otherwise
# cp ue.rc ~/.emacsrc
set $discmd "FALSE"
set $tab 4
; Help facility
40 store-macro
set $discmd "FALSE"
!if &not &seq $cbufname "emacs.hlp"
write-message "(Loading Help)"
!force help
!if &not &seq $cbufname "emacs.hlp"
write-message "(Failed to load Help)"
!else
!force 8 resize-window
bind-to-key execute-macro-39 FN5
bind-to-key execute-macro-38 FN6
bind-to-key execute-macro-37 FNH
bind-to-key execute-macro-36 FNF
beginning-of-line
2 forward-character
1 redraw-display
set %hlpupdn "[PgUp] / [PgDn]"
set %hlphelp "[F1]"
run helponhelp
!endif
!else
set %hlpcode &lef $line 2
!if &seq %hlpcode ".."
set %hlptopic &mid $line 4 99
end-of-line
!force search-forward %hlptopic
beginning-of-line
2 forward-character
1 redraw-display
run helponhelp
!else
!force search-reverse "=>"
bind-to-key previous-page FN5
bind-to-key next-page FN6
bind-to-key beginning-of-file FNH
bind-to-key end-of-file FNF
!force delete-window
clear-message-line
!endif
!endif
set $discmd "TRUE"
!endm
bind-to-key execute-macro-40 M-?
bind-to-key execute-macro-40 FNP
bind-to-key beginning-of-file FNH
bind-to-key end-of-file FNF
; Help on Help
store-procedure helponhelp
!if &seq &rig $line 5 "INDEX"
write-message &cat "Select topic from list and press " %hlphelp
!else
write-message &cat "Use " &cat %hlpupdn &cat " to scan help file -- " &cat %hlphelp " to toggle help window"
!endif
!endm
; Previous help page
39 store-macro
!if &seq $cbufname "emacs.hlp"
beginning-of-line
!force search-reverse "=>"
2 forward-character
1 redraw-display
run helponhelp
!else
previous-page
!endif
!endm
; Next help page
38 store-macro
!if &seq $cbufname "emacs.hlp"
beginning-of-line
2 forward-character
!force search-forward "=>"
1 redraw-display
run helponhelp
!else
next-page
!endif
!endm
37 store-macro
beginning-of-file
!if &seq $cbufname "emacs.hlp"
execute-macro-39
!endif
!endm
36 store-macro
end-of-file
!if &seq $cbufname "emacs.hlp"
execute-macro-39
!endif
!endm
; Set up auto CMODE
35 store-macro
!if &seq &mid $cfname 1 7 "/tmp/Re"
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/.ed" 0
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/.let" 0
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/.art" 0
add-mode "wrap"
!return
!endif
!if &gre &sin $cfname "/nn." 0
add-mode "wrap"
!return
!endif
set %rctmp &sin $cfname "."
!if &equ %rctmp 0
!return
!endif
set %rctmp &mid $cfname &add %rctmp 1 5
!if &or &seq %rctmp "c" &seq %rctmp "h"
add-mode "cmode"
!endif
!if &or &seq %rctmp "txt" &or &seq %rctmp "doc" &or &seq %rctmp "tmp" &seq %rctmp "tex"
add-mode "wrap"
!endif
!endm
bind-to-key execute-macro-35 M-FNR
; Make cut-paste easier in window systems
bind-to-key newline ^J
!if &or &gre &sin $LANG "UTF-8" 0 &gre &sin $LANG "utf8" 0
add-global-mode "utf-8"
!endif
set $discmd "TRUE"