File: elvis.arf

package info (click to toggle)
elvis 2.1i-3
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 4,120 kB
  • ctags: 5,838
  • sloc: ansic: 53,854; sh: 811; makefile: 263
file content (47 lines) | stat: -rw-r--r-- 1,689 bytes parent folder | download
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" SAVE THE CURRENT STATE OF THE "saveregexp" OPTION
let s=saveregexp
set nosaveregexp
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TAKE A GUESS AT THE BUFFER'S PREFERRED DISPLAY MODE
let e=tolower(dirext(filename))
if knownsyntax(filename)
then set! bufdisplay=syntax
if os=="unix" && buflines >= 1
then 1s/^#! *[^ ]*\/\([^ ]\+\).*/set! bufdisplay="syntax \1"/x
if !newfile
then {
 if readeol=="binary" && bufdisplay=="normal"
 then set! bufdisplay=hex
 if e==".man"
 then set! bufdisplay=man
 if strlen(e)==2 && isnumber(e>>1) && buflines>=1
 then 1s/^\./set! bufdisplay=man/x
 if e==".tex"
 then set! bufdisplay=tex
 if e<<4==".htm"
 then set! bufdisplay=html
 if buflines >= 1 && bufdisplay=="hex"
 then 1s/^<[HIThit!]/set! bufdisplay=html/x
 if (filename<<5=="http:" || filename<<4=="ftp:") && strlen(e)<4 && bd=="hex"
 then set! bufdisplay=normal
 if bufdisplay=="normal" && buflines >= 1
 then 1s/^From .*/set! bufdisplay="syntax email"/x
 if dirdir(filename)=="/tmp" || dirdir(filename)=="/var/tmp"
 then set! bufdisplay="syntax email"
}
set e=""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" EXECUTE MODELINES, IF "modeline" OPTION IS SET
if modeline && buflines >= 1 && buflines <= modelines * 2
then %s/ex:\(.*\):/\1/x
if modeline && buflines > modelines * 2
then {
 eval 1,(modelines)s/[ev][xi]:\\\(.*\\\):/\1/x
 eval (buflines - modelines + 1),(buflines)s/[ev][xi]:\\\(.*\\\):/\1/x
}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" RESTORE THE "saveregexp" OPTION
if s
then set saveregexp
set s=""