-
Notifications
You must be signed in to change notification settings - Fork 7
/
emacs.rc
156 lines (134 loc) · 2.92 KB
/
emacs.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
; .emacsrc -- Startup file for µEMACS 4.2
;
; This file is executed every time the editor is entered.
set $discmd FALSE
!if ¬ &seq $progname µEMACS
; uemacs/PK and MicroEMACS
set $discmd TRUE
!return
!endif
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
set %F1 FNP
set %Home FNH
set %End FNF
!endif
!store 40
set $discmd FALSE
!if ¬ &seq $cbufname "emacs.hlp"
write-message "(Loading Help)"
!force help
!if ¬ &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 %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
!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 %Home
bind-to-key end-of-file %End
!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 %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
!store 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
!store 39
!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
!store 38
!if &seq $cbufname "emacs.hlp"
beginning-of-line
2 forward-character
!force search-forward "=>"
1 redraw-display
run helponhelp
!else
next-page
!endif
!endm
!store 37
beginning-of-file
!if &seq $cbufname "emacs.hlp"
execute-macro-39
!endif
!endm
!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-35 M-FNR
## Make cut-paste easier in window systems
bind-to-key newline ^J
!if &or &sin $LANG "UTF-8" &sin $LANG "utf8"
add-global-mode "utf-8"
!endif
set $discmd TRUE