Well... for example, here's a quick script (minimally tested, I'm
afraid - I haven't used emacs significantly in quite some time) to
generate emacs style tags.

Usage:
   etags filenamelist

where filenamelist is paths to the *.ijs files you want to re-index.

FOLDCASE=: 0
NB. set this to 1 if you have issues caused by the file system
ignoring upper/lowercase

normalizepaths=:3 :0
  tolower^:FOLDCASE@rplc&'\/'L:0 y
)

extractdirs=:3 :0 L:0
  (('/',y)i:'/'){.y
)

etags=:3 :0
  paths=. normalizepaths boxopen y
  dirs=. extractdirs paths
  delims=. FF,LF
  for_dir.~.dirs do.
    TAGS=. (fread (;dir),'TAGS')-._1
    assert. delims-:2{.TAGS,delims
    Tfiles=. (0{::<;._2@,&',')L:0 (0{<;._1);._1 TAGS
    files=. (dir=dirs)#paths
    fnames=. (}.~ #@extractdirs)&.> files
    keep=. -.Tfiles e. fnames
    (;(keep#<;.1 TAGS),fnames etagsBlock&.> files) fwrite (;dir),'TAGS'
  end.
)

etagsBlock=:4 :0
  content=. (fread y)-._1
  if. 0=#content do.'' return.end.
  lns=. I.content=LF
  NB. in this draft assume all instances of =: are valid and relevant
definitions
  dfns=. I. '=:' E. content
  lnums=. <:lns I. dfns
  pfxs=. content (<@:{~ (+i.)~/)"1 -/\."1 (2+dfns),.1+lnums{lns
  detail=. ;LF,&.>~pfxs,&.>DEL,&.>lnums(,','&,)&":&.>lnums{lns
  FF,LF,x,',',(":#detail),LF,detail
)

I could do better here, about rejecting irrelevant definitions, if I
had it actually load up the scripts in question and then used 4!:5,
4!:4 and 4!:3 to determine which names are significant for each file.
Presumably I would do this in a throw-away session. This would also
suggest I should treat file names differently. But those complications
aren't really necessary to show the basic idea...

Anyways...  if you want to use this and it doesn't work for you, let
me know about that and I can try to debug.

Thanks,

-- 
Raul


On Sat, Dec 2, 2017 at 5:49 PM, Scott Locklin <[email protected]> wrote:
> Dec 01, 2017; 8:46pmbill-lam-2 wrote:
> <http://jsoftware.2058.n7.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=21>
>>Qt ide dropped support for jtag. Use find in file should be more intuitive
>>in ide.
>>If you use jconsole, then jtag may be useful.
>
> Yeah, I'm working with emacs most of the time (I work with 4-5 different
> languages, keeping the editor/IDE the same is a big help for me -hoping
> to narrow down to 2-3 at some point). Does the old jtags stuff sit on a
> public repo where I could submit a pull request if I get it working?
> Anyway, copied to here from j701 for future reference; I will try to
> make it work at some point:
> https://github.com/locklin/jtags
>
> -Scott
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to