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

Re: me find-tag

Expand Messages
  • Lechee.Lai
    this version should working ... ; -!- emf -!- ; Created: 2oo8 ; Synopsis: Another TAGs with tag-back ; Authors: Lechee Lai 0 define-macro save-tagname
    Message 1 of 5 , Jul 29, 2008
    • 0 Attachment
      this version should working
      -----
      ; -!- emf -!-
      ; Created: 2oo8
      ; Synopsis: Another TAGs with tag-back
      ; Authors: Lechee Lai

      0 define-macro save-tagname
      set-variable #l8 &cat $home "fte.idx"
      find-file #l8
      end-of-buffer
      set-variable #l9 &spr "%s %s\n" %tagname %tagline
      insert-string #l9
      0 save-buffer
      !force 0 delete-buffer "fte.idx"
      ml-write "stack saved"
      !emacro

      define-macro atags-next
      set-variable %tagname $buffer-fname
      set-variable %tagline $window-line
      save-tagname
      4 find-tag
      !emacro

      define-macro atags
      set-variable %tagname $buffer-fname
      set-variable %tagline $window-line
      !if &inw @wc
      set-variable #l0 $window-col
      forward-char
      backward-word
      set-variable #l1 $window-col
      forward-word
      set-variable .osd.pat-cur &mid @wl #l1 &sub $window-col #l1
      set-variable $window-col #l0
      !else
      set-variable .osd.pat-cur ""
      !endif

      set-variable #l1 @ml1 "Atags" .osd.pat-cur
      !if &less &len #l1 1
      ml-write "Atags Cancel!"
      !return
      !endif
      find-file %tag-file
      set-position "\x88"
      goto-line 1
      set-variable #l0 @wl
      goto-position "\x88"
      !if &gre &len #l0 10
      ml-write "right TAGs"
      !else
      !force 0 delete-buffer "tags"
      ml-write "no *tags* founded..."
      !return
      !endif
      set-variable #l2 &spr "^%s" #l1
      !force search-buffer "em" #l2
      !if $status
      ; found string
      save-tagname ; store in %tagname %tagline
      set-variable #l0 @wl
      !if &gre &set #l6 &rsin "/^" #l0 1
      set-variable #l4 &lef #l0 &sub #l6 1
      set-variable #l5 &rig #l0 &sub #l6 1
      !else
      set-variable #l4 #l0
      set-variable #l5 ""
      !endif
      forward-word
      !force search-buffer "em" #l2
      !if $status
      ml-write "Duplicate founded C-n for Next".
      !force 0 delete-buffer "tags"
      !else
      !force 0 delete-buffer "tags"
      !endif
      2 find-tag #l1
      delete-other-windows
      !else
      ; not found
      !force 0 delete-buffer "tags"
      ml-write "Symbol not founded..."
      !endif
      !emacro

      define-macro getline
      set-variable #l0 &cat $home "fte.idx"
      find-file #l0
      end-of-buffer
      !if &gre $window-line 1
      backward-line
      !else
      !force 0 delete-buffer "fte.idx"
      set-variable %tagback ""
      ml-write "Empty Stack"
      !return
      !endif
      set-variable %tagback ""
      ml-write $window-line
      !if &gre $window-line 1
      set-variable %tagback @wl
      beginning-of-line
      1 kill-line
      0 save-buffer
      !force 0 delete-buffer "fte.idx"
      ml-write "tagback"
      !else
      set-variable #l0 @wl
      !if &len #l0 5
      set-variable %tagback @wl
      beginning-of-line
      1 kill-line
      0 save-buffer
      !force 0 delete-buffer "fte.idx"
      ml-write "tagback 0"
      !else
      ml-write "Empty Stack"
      set-variable %tagback ""
      !force 0 delete-buffer "fte.idx"
      !return
      !endif
      !endif
      !emacro

      define-macro back-tag
      getline
      !if &len %tagback 1
      set-variable #l3 %tagback
      !else
      !return
      !endif
      !if &gre &len #l3 1
      !if &gre &set #l6 &rsin " " #l3 1
      set-variable #l4 &lef #l3 &sub #l6 1
      set-variable #l5 &rig #l3 &sub #l6 1
      !endif
      find-file #l4
      goto-line #l5
      !else
      ml-write "no more TAG stack"
      !return
      !endif
      !emacro
    • Lechee.Lai
      my goal hope duplicate tags should have selection :-p
      Message 2 of 5 , Jul 30, 2008
      • 0 Attachment
        my goal hope duplicate tags should have selection :-p
      Your message has been successfully submitted and would be delivered to recipients shortly.