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

2345Re: me find-tag

Expand Messages
  • Lechee.Lai
    Jul 24, 2008
    • 0 Attachment
      here work around for tag-back support
      ----
      ; -!- emf -!-
      ; Created: 2oo8
      ; Synopsis: Another TAGs
      ; Authors: Lechee Lai

      define-macro atags-next
      set-variable #l8 $buffer-fname
      set-variable #l9 $window-line
      set-variable #l7 &spr "vgrep --sinfo %s %s" #l8 #l9
      shell-command #l7
      4 find-tag
      !emacro

      define-macro atags
      set-variable #l8 $buffer-fname
      set-variable #l9 $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
      set-variable #l7 &spr "vgrep --sinfo %s %s" #l8 #l9
      shell-command #l7
      ml-write "stack saved"
      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
      set-variable #l3 1
      ml-write "Duplicate founded C-n for Next".
      !force 0 delete-buffer "tags"
      !else
      set-variable #l3 0
      !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 back-tag
      shell-command "vgrep --gline"
      find-file "/tmp/!!tagname"
      set-position "\x88"
      goto-line 1
      set-variable #l0 @wl
      goto-position "\x88"
      !if &gre &len #l0 5
      end-of-buffer
      backward-line
      set-variable #l3 @wl
      !if &gre &set #l6 &rsin " " #l3 1
      set-variable #l4 &lef #l3 &sub #l6 1
      set-variable #l5 &rig #l3 &sub #l6 1
      !endif
      !force 0 delete-buffer "!!tagname"
      find-file #l4
      goto-line #l5
      shell-command "vgrep --rline"
      !else
      !force 0 delete-buffer "!!tagname"
      ml-write "no more TAG stack"
      !return
      !endif
      !emacro
      --------------------------------------------------------------
      Since I don't know some function in macro so vgrep as dummy for patch
      1. how to check the file is exist or zero file
      2. --sinfo %s %s -- store current $buffer-fname and line number
      3. --rline -- remove last line from foo.idx
      4. --gline -- get last line from foo.idx and copy to
      /tmp/!!tagname



      --- In jasspa@yahoogroups.com, "Phillips, Steven" <sphillips@...> wrote:
      >
      > Use Tools -> <file-type> Tools -> Generate Tags File to generate a
      tags
      > file, if this is not available you will need to generate a tags file
      via
      > another route. Once you have a tags file put the cursor on any
      function
      > name, type etc and execute find-tag (usually bound to 'esc t'), to go
      to
      > the next duplicate tag execute find-tag with a numeric argument of 4,
      > i.e. esc 4 esc x find-tag (usually bound to 'esc C-t'). ME does not
      > currently support going backwards.
      >
      > See help page on the find-tag command form more information.
      >
      > Steve
      >
      >
      > ________________________________
      >
      > From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com] On
      > Behalf Of Lechee.Lai
      > Sent: 22 July 2008 00:51
      > To: jasspa@yahoogroups.com
      > Subject: [jasspa] me find-tag
      >
      >
      >
      > does me fans can hint me how to use find-tag
      > how find-tag for duplication tag, where is find-tag-back? or how
      > to
      > use me for source code browsing :-)
      >
      > thanks
      > Lechee
      >
    • Show all 5 messages in this topic