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

RE: [jasspa] me find-tag

Expand Messages
  • Phillips, Steven
    Use Tools - 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.
    Message 1 of 5 , Jul 23, 2008
      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

    • Lechee.Lai
      here work around for tag-back support ... ; -!- emf -!- ; Created: 2oo8 ; Synopsis: Another TAGs ; Authors: Lechee Lai define-macro atags-next set-variable #l8
      Message 2 of 5 , Jul 24, 2008
        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
        >
      • Lechee.Lai
        this version should working ... ; -!- emf -!- ; Created: 2oo8 ; Synopsis: Another TAGs with tag-back ; Authors: Lechee Lai 0 define-macro save-tagname
        Message 3 of 5 , Jul 29, 2008
          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 4 of 5 , Jul 30, 2008
            my goal hope duplicate tags should have selection :-p
          Your message has been successfully submitted and would be delivered to recipients shortly.