File: loaderrs.rc

package info (click to toggle)
vile 9.5-i1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,248 kB
  • ctags: 8,023
  • sloc: ansic: 86,640; lex: 8,291; sh: 3,073; perl: 2,926; cpp: 2,891; makefile: 779; awk: 276
file content (40 lines) | stat: -rw-r--r-- 1,218 bytes parent folder | download | duplicates (2)
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
; $Header: /usr/build/vile/vile/macros/RCS/loaderrs.rc,v 1.1 2002/06/25 11:20:39 tom Exp $
; A macro that prepends user's error-patterns to [Error Expressions].  The
; user-defined patterns are in a file ".vile-errs" or "vile-errs".  The macro
; binds ^X^X to LoadErrorExprs temporarily, then the first time it is run,
; ^X^X, it builds the combined list of patterns and resets the binding to the
; normal one.

store-procedure LoadErrorExprs
	~local $buffer-hook
	unsetv $buffer-hook
	~local %file
	setv %file=&lookup r+home+startup '.vile-errs'
	~if &seq %file ''
		setv %file=&lookup r+startup 'vile-errs'
	~endif
	~if &not &seq %file ''
		~local %oldbuffer %imply
		setv %oldbuffer=$cbufname
		setv %imply=$implybuffer
		set noimplybuffer
		; make sure it exists
		compile-error-expressions
		; kill the current contents
		kill-buffer '[Error Expressions]'
		; create it, so we can modify it
		compile-error-expressions
		edit-file '[Error Expressions]'
		unsetl view
		goto-beginning-of-file
		0 insert-file %file
		unmark
		setl view
		buffer %oldbuffer
		compile-error-expressions
		setv $implybuffer=%imply
		bind-key find-next-error ^X-^X
		~hidden find-next-error
	~endif
~endm
bind-key LoadErrorExprs ^X-^X