>>> Igor Lautar <igor.lautar@...> seems to think that:
>Eric M. Ludlam <mailto:eric@...> wrote:
><cut>
>
>> Hi,
>>
>> Here is a patch to sematnicdb-mk.el that should get you going.
>> There seemed to be something strange about how the load-file-path was
>> calculated on my version of Emacs. Hopefully it is safer now to.
>>
>> If needed, you can download the file from CVS directly instead.
>
>I've applied the patch and it works, partially. Example:
>I have an dir with some dirs that contain source files.
>--dir
> |-subdir1
> | |-files1
> |-subdir2
> | |-files2
>and so on...
>
>I do the following in dir:
>find . -name '*.[c|h]' | xargs > file_list
>
>then emacs <parms to launch semanticdb-mk.el> <contents of file_list>
>
>it works ok, loads all files listed but semantic.cache is not created for
>every subdir.
I've managed to verify this behavior. It seems only the very first
file in the list gets the correct answer when subdirectories are
involved. If I CD into each directory and re-run, it seems to get
the right answer.
I've fixed semanticdb-mk.el, and attack a patch (against my
previously fixed version) below.
>also, if I create semantic.cache for subdir1 and subdir2,
>and semanticdb-project-roots is dir, then open file in subdir2,
>I cannot semantic-complete-jump to tag in subdir1.
>
>How can emacs (semantic) be forced to read all semantic.cache files
>of the project? Can I list all semantic.cache files in .emacs ?
I have verified that this "works for me" in my C project "gnutalk".
(Also on sourceforge.) The default value part had an issue fixed by
the second patch below. My steps are below:
1) In gnutalk/src/ run fixed semanticdb.sh on */*.c
2) Start fresh emacs, load gtalkd/gtd_ann.c
3) go to a call to HOST_somethingidontremember
4) C-c , J
At this point, the default is where I go and fixed semantic-complete
finds it in the correct buffer. If I type it, the conveniences there
also work on that symbol found in a different directory.
My sample (now that I have one ready to go to test against) seems to
have issues with the summary/autocompletion mode that I still need to
look into. Strangely, this feature works on what I do at work which
is much more complex. I still need to look into that.
>I'm aware semantic searches one level into include files, can
>this be increased?
Yes. See semanticdb-find.el, around line 237. If anyone wants to
figure out a good way to fix it, that would be grand.
Eric
-----------
*** semanticdb-mk.el.~1.2.~ 2004-08-02 21:38:18.000000000 -0400
--- semanticdb-mk.el 2004-08-08 22:21:35.000000000 -0400
***************
*** 52,58 ****
(while (and args
(not
(progn
! (message "Compare %s to %s" (car args) "-l")
(string= (car args) "-l"))))
(setq args (cdr args)))
(when args
--- 52,58 ----
(while (and args
(not
(progn
! ;(message "Compare %s to %s" (car args) "-l")
(string= (car args) "-l"))))
(setq args (cdr args)))
(when args
***************
*** 60,69 ****
;; Grab the rest of the file names.
;; For each file, load it in, let semantic evaluate it for tags.
(while args
! (message "Loading %s" (car args))
! (find-file (car args))
! (semantic-fetch-tags)
! (setq args (cdr args)))
))
;; Save the databases.
--- 60,74 ----
;; Grab the rest of the file names.
;; For each file, load it in, let semantic evaluate it for tags.
(while args
! (princ (concat "Loading " (car args) "... "))
! (save-window-excursion
! (let* ((buffer (find-file-noselect (car args)))
! (tags nil))
! (set-buffer buffer)
! (setq tags (semantic-fetch-tags))
! (princ (length tags))
! (princ " tags found .\n"))
! (setq args (cdr args))))
))
;; Save the databases.
-----------
*** semantic-complete.el.~1.35.~ 2004-08-02 21:46:04.000000000 -0400
--- semantic-complete.el 2004-08-08 22:33:49.000000000 -0400
***************
*** 302,308 ****
semantic-completion-collector-engine)))
(when ml
;; We don't care about uniqueness. Just guess for convenience
! (setq tag (car (semanticdb-find-result-nth ml 0)))))
;; save it
(setq semantic-complete-active-default tag)
;; Return it.. .whatever it may be
--- 302,308 ----
semantic-completion-collector-engine)))
(when ml
;; We don't care about uniqueness. Just guess for convenience
! (setq tag (semanticdb-find-result-nth-in-buffer ml 0))))
;; save it
(setq semantic-complete-active-default tag)
;; Return it.. .whatever it may be
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
|