>>> =?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?= <neumann@...> seems to think that:
>Bonjour,
>
>I've tried quite a bit but I'm totally failing to get semantic to save a
>system database...
>
>in emacs, when I use (semanticdb-create-system-database ...) I get a nice
>file
>in ~/.semanticdb/ but with no tags whatsoever:
>
>...
> (semanticdb-table "xf86Parser.h"
> :major-mode 'c-mode
> :tags 'nil
> :file "xf86Parser.h"
> :unmatched-syntax 'nil
> )
>...
Hi,
Thanks for your email. You have pointed out two problems.
This first problem occurs due to a new bug. To speed up file
loading, tags are not parsed until the idle timer. The system
tagging script did not wait for the idle timer, and subsequently
never got the tags updated.
I don't do much C coding at home anymore so don't have much
opportunity to use this feature. :(
This patch should fix the problem.
*** semanticdb-system.el.~1.4.~ 2004-04-10 20:32:32.000000000 -0400
--- semanticdb-system.el 2005-01-27 18:35:52.000000000 -0500
***************
*** 1,6 ****
;;; semanticdb-system.el --- Build a file DB for some system files.
! ;;; Copyright (C) 2002, 2003, 2004 Eric M. Ludlam
;; Author: Eric M. Ludlam <zappo@...>
;; Keywords: tags
--- 1,6 ----
;;; semanticdb-system.el --- Build a file DB for some system files.
! ;;; Copyright (C) 2002, 2003, 2004, 2005 Eric M. Ludlam
;; Author: Eric M. Ludlam <zappo@...>
;; Keywords: tags
***************
*** 180,193 ****
(let ((table (semanticdb-file-table sysdb (car files)))
)
;; 1) Skip if loaded
! (unless table
;; 3) load the file.
(let ((b (get-file-buffer (car files))))
(save-excursion
(set-buffer (find-file-noselect (car files)))
;; At this point, standard semantic actions
;; have occured.
! ;; 4) Kill the buffer
(if (not b) (kill-buffer (current-buffer)))))
))
(setq files (cdr files)))
--- 180,195 ----
(let ((table (semanticdb-file-table sysdb (car files)))
)
;; 1) Skip if loaded
! (unless (and table (oref table tags))
;; 3) load the file.
(let ((b (get-file-buffer (car files))))
(save-excursion
(set-buffer (find-file-noselect (car files)))
+ ;; 4) Force a reparse
+ (semantic-fetch-tags)
;; At this point, standard semantic actions
;; have occured.
! ;; 5) Kill the buffer
(if (not b) (kill-buffer (current-buffer)))))
))
(setq files (cdr files)))
>when I use semanticdb-mk.el, the file are apparently successfully scanned
>but
>the program absolutely refuses to save in ~/.semanticdb. When I run it with
>
>sudo I get a semantic.cache file in the directory I scanned but when I run
>it
>as my user, it doesn't seem to create any kind of file despite not showing
>any errors.
>
>,,,
>Saving tag summaries...
>Saving tag summary for /opt/xorg/include/semantic.cache...
>Saving file /opt/xorg/include/semantic.cache...
>Directory /opt/xorg/include/ write-protected
>Saving tag summary for /opt/xorg/include/semantic.cache...done
>Saving tag summaries...done
[ ... ]
The semanticdb script was not meant for system files. It seems to me
that it would be useful to to allow systemdb scanning from the
command line also.
There are no loud errors because the code is usually run in
interactive mode, and an error would prevent you from exiting Emacs.
If anyone has a suggestion on how to trigger a system db instead of a
regular one, that would be useful. Perhaps if it sees a read-only
file it should save it as a system DB. Hmmm. That isn't as easy as
it sounds.
I'll have to think that one out more.
Eric
--
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
|