Loading ...
Sorry, an error occurred while loading the content.

RE: [jasspa] some ME macros question

Expand Messages
  • lechee lai
    petty help Steve, here is my fte.grp ... File: /usr/share/jasspa/macros/vgrep.emf 3:; Synopsis: vgrep command handling 11:define-macro vgrep 40:
    Message 1 of 3 , Jul 23, 2008
    • 0 Attachment
      petty help Steve,
      here is my fte.grp
      -----------------------------------------
      File: /usr/share/jasspa/macros/vgrep.emf
      3:; Synopsis: "vgrep" command handling
      11:define-macro vgrep
      40: pipe-shell-command &spr "vgrep --grep %s %s \\%s i" #l0 #l2 #l1
      File: /usr/share/jasspa/macros/hkgrp.emf
      16:;set-variable .fhook-grp.name "vGREP"
      --------------------------------------------
      so I've try my jkgrp.emf

      ; -!- 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"

      ------
      I've use another vlist vgrep.eml open the fte.grp
      define-macro vlist
      view-file "/home/foo/fte.grp"
      !emacro

      --------------------------------------
      here is dirty work,I want to use C-j instead key return in this fte.grp buffer I'm not clear how to hook return and unhook when leave the buffer :-)


      Lechee



      _______________________________________________________________________________________________________
      總會在某些時刻,突然想起舊情人?他 現在過得還好嗎?
      http://sev.search.yahoo.net
    Your message has been successfully submitted and would be delivered to recipients shortly.