1 ;;; semanticdb-mk.el --- Command line database builder
3 ;;; Copyright (C) 2002, 2004 Eric M. Ludlam
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
7 ;; X-RCS: $Id: semanticdb-mk.el,v 1.1 2007-11-26 15:10:47 michaels Exp $
9 ;; This file is not part of GNU Emacs.
11 ;; Semanticdb is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; This software is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
28 ;; For use by semanticdb.sh for building tag files.
33 (if (not noninteractive)
34 (error "You should not load semanticdb-mk interactivly."))
36 ;; Find our source directory
37 (let (fname semanticdir cedetdir loadfile)
39 (setq fname load-file-name)
40 (setq semanticdir (file-name-directory fname))
41 (setq cedetdir (expand-file-name (concat semanticdir "../common/")))
42 (setq loadfile (concat cedetdir "cedet.el"))
47 (global-semanticdb-minor-mode 1)
49 ;; Process loaded buffers from the command line.
50 (let ((args command-line-args))
51 ;; Move past this load file being loaded.
55 ;(message "Compare %s to %s" (car args) "-l")
56 (string= (car args) "-l"))))
57 (setq args (cdr args)))
59 (setq args (cdr (cdr args)))
60 ;; Grab the rest of the file names.
61 ;; For each file, load it in, let semantic evaluate it for tags.
63 (princ (concat "Loading " (car args) "... "))
64 (save-window-excursion
65 (let* ((buffer (find-file-noselect (car args)))
68 (setq tags (semantic-fetch-tags))
70 (princ " tags found .\n"))
71 (setq args (cdr args))))
74 ;; Save the databases.
75 (semanticdb-save-all-db)