;		TeX
;		Schaltet TeX-Modus ein
;
store-procedure sharps
	insert-string "{\ss}"
!endm

store-procedure ae
	insert-string &cat &cat "{\" &chr 34 "a}"
!endm

store-procedure oe
	insert-string &cat &cat "{\" &chr 34 "o}"
!endm

store-procedure ue
	insert-string &cat &cat "{\" &chr 34 "u}"
!endm

store-procedure Ae
	insert-string &cat &cat "{\" &chr 34 "A}"
!endm

store-procedure Oe
	insert-string &cat &cat "{\" &chr 34 "O}"
!endm

store-procedure Ue
	insert-string &cat &cat "{\" &chr 34 "U}"
!endm

store-procedure tex
	set %rctmpt $discmd
	set $discmd FALSE
!force	unbind-key 
	macro-to-key sharps 
	macro-to-key ae 
	macro-to-key oe 
	macro-to-key ue 
	macro-to-key Ae 
	macro-to-key Oe 
	macro-to-key Ue 
	set $discmd %rctmpt
!endm

store-procedure untex
	set %rctmpt $discmd
	set $discmd FALSE
!force	unbind-key 
;	bind-to-key execute-macro-31	
!force	unbind-key 
!force	unbind-key 
!force	unbind-key 
!force	unbind-key 
!force	unbind-key 
!force	unbind-key 
	set $discmd %rctmpt
!endm

30	store-macro
	run untex
!endm

31  store-macro
   	set %rctmp &sin $cfname "."
	!if &equ %rctmp 0
		!return
	!endif
	set %rctmp &mid $cfname &add %rctmp 1 5
	!if &seq %rctmp "tex"
		run tex
	!endif
!endm

	set $exbhook execute-macro-30
	set $bufhook execute-macro-31
	add-mode "wrap"
