File: loaderrs.rc

package info (click to toggle)
vile 9.8za-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,644 kB
  • sloc: ansic: 120,894; lex: 14,981; sh: 4,478; perl: 3,511; cpp: 3,180; makefile: 1,425; awk: 271
file content (40 lines) | stat: -rw-r--r-- 1,198 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
; $Id: loaderrs.rc,v 1.3 2007/08/07 00:32:16 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=&pquote &lookup r+home+startup '.vile-errs'
	~if &seq %file ''
		setv %file=&pquote &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