Re: Bugs introduced that affected jde-import-all(insert semantic tag)

"Jeff Peck" <[email protected]>
Newsgroups gmane.emacs.jdee.devel
Message-ID <88F3CDC779124D62AEFD463684F4F865@blue>
In partial answer to my own question, i find this works!
(defadvice jde-import-all (around reparse-after-import first activate)
  ad-do-it
  (semantic-fetch-tags)
  ;;(message "advice on jde-import-all sft=%s" )
  (semantic-edits-incremental-parser)
  )

With both the (semantic-fetch-tags) 
and (semantic-edits-incremental-parser)
in the advice, the reparse happens, and successive jde-import-all
finds the inserted imports and does not re-import.

Likewise, a simple patch to jde-import-insert-imports-into-buffer
solves the proximal problem, but is there a better way?

Index: lisp/jde-import.el
===================================================================
--- lisp/jde-import.el (revision 191)
+++ lisp/jde-import.el (working copy)
@@ -410,12 +412,17 @@
    (when (> (length new-import) 0) ;; added to avoid insert empty import statements.
      (insert
       (concat "import " new-import ";\n"))
+;;     (let ((tag (semantic-tag-new-include new-import nil)))
+;;       (message "made tag: %s" tag))
      (message "Imported %s" new-import)))
     (if jde-import-auto-collapse-imports
  (let (jde-import-auto-collapse-imports) ;; setting this to avoid infinite recursion
    (jde-import-collapse-imports)))
     (if jde-import-auto-sort
- (funcall jde-import-auto-sort-function))))
+ (funcall jde-import-auto-sort-function))
+    (semantic-fetch-tags)
+    (semantic-parse-changes)
+    ))
 
 
 (defun jde-import-already-imports-class (class-name existing-imports)



> Eric, this is encouraging.
> Without going all the way to srecode templates *today*,
> Can you say what is the appropriate incantation to insert a tag into the 
> 'database'?
> I can do: (semantic-tag-new-include new-import nil) to create the tag,
> but how to i make that tag visible to the rest of semantic?
> [so it will be found by: (semantic-brute-find-tag-by-class 'include 
> (semantic-fetch-tags)) ]
> 
>> srecode specifically knows how to insert tags, so you could do this:
>>
>> (srecode-insert-tag (semantic-tag-new-include "myInclude" nil))
> I'm using cedet-1.0pre6 and do not find a "srecode-insert-tag"
> 
>> ... I have a rough template already that would probably need a real java 
>> programmer to improve it.
> 
> If you have something, send it along!
> 
> Also, if you have any theory why doing a (semantic-parse-changes) works
> when evaluated as a separate command, but not as around/after advice,
> that might also be helpful information.
> 
> CEDET is really great stuff, but I haven't found the magic decoder ring
> to explain the design/threory behind it; and there is so much there, with
> many levels of tools and abstraction that it is difficult to 'discover' a 
> way in.
> 
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> jdee-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jdee-devel

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
jdee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdee-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.