; -!- emf -!- ; This is part of the JASSPA MicroEmacs macro files ; Copyright (C) 2000-2006 JASSPA (www.jasspa.com) ; See the file me.emf for copying and conditions. ; ; Created: 2oo8 ; Synopsis: Hilighting for GRP files ; Authors: Lechee Lai ; ; !if ¬ &exi .hilight.grp set-variable .hilight.grp &pinc .hilight.next 1 !endif ; buffer-init variables ;set-variable .fhook-grp.name "vGREP" ;set-variable .fhook-grp.command-kbind "|return|" ;$buffer-bhook !if &band .hilight.flags 0x02 0 hilight .hilight.grp 0 $global-scheme ; Gnu grp utility, uses --context hilight .hilight.grp 0x101 "\\d+" .scheme.constant ; Common hilight .hilight.grp 0x102 "File" .scheme.comment !endif define-macro le-grp !if &seq $buffer-bname "fte.grp" set-variable #l0 &left @wl 5 !if &seq #l0 "File:" set-variable #l2 @wl set-variable #l3 "FILE" !endif !if &seq #l3 "FILE" set-variable #l3 &right @wl 6 ml-write #l3 find-file #l3 !else set-variable #l1 @wl !if &gre &set #l4 &rsin ":" #l1 1 set-variable #l0 &lef #l1 &sub #l4 1 !else set-variable #l2 #l1 !endif ml-write #l0 ; find filename set-variable #l9 "0" !repeat backward-line set-variable #l1 &left @wl 5 !if &seq #l1 "File:" set-variable #l2 @wl set-variable #l3 "FILE" !if &seq #l3 "FILE" set-variable #l3 &right @wl 6 ml-write #l3 set-variable #l9 "FOUNDED" !endif !endif !until &seq #l9 "FOUNDED" !if &seq #l9 "FOUNDED" find-file #l3 goto-line #l0 !endif !endif !else newline !endif !emacro define-macro fhook-grp ; Set up the buffer modes -1 buffer-mode "time" !if &band .hilight.flags 0x02 set-variable $buffer-hilight .hilight.grp !endif buffer-init-hooks !emacro global-bind-key "le-grp" "C-j" buffer-bind-key "le-grp" "return" buffer-init-fhook "grp"