;;; semantic/db.el --- Semantic tag database manager
-;; Copyright (C) 2000-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: tags
If the buffer is not in memory, load it with `find-file-noselect'."
nil)
+;; This generic method allows for sloppier coding. Many
+;; functions treat "table" as something that could be a buffer,
+;; file name, or other. This makes use of table more robust.
+(defmethod semanticdb-full-filename (buffer-or-string)
+ "Fetch the full filename that BUFFER-OR-STRING refers to.
+This uses semanticdb to get a better file name."
+ (cond ((bufferp buffer-or-string)
+ (with-current-buffer buffer-or-string
+ (semanticdb-full-filename semanticdb-current-table)))
+ ((and (stringp buffer-or-string) (file-exists-p buffer-or-string))
+ (expand-file-name buffer-or-string))))
+
(defmethod semanticdb-full-filename ((obj semanticdb-abstract-table))
"Fetch the full filename that OBJ refers to.
Abstract tables do not have file names associated with them."
(let ((cache (oref table cache))
(obj nil))
(while (and (not obj) cache)
- (if (eq (eieio--object-class (car cache)) desired-class)
+ (if (eq (eieio-object-class (car cache)) desired-class)
(setq obj (car cache)))
(setq cache (cdr cache)))
(if obj
(let ((cache (oref db cache))
(obj nil))
(while (and (not obj) cache)
- (if (eq (eieio--object-class (car cache)) desired-class)
+ (if (eq (eieio-object-class (car cache)) desired-class)
(setq obj (car cache)))
(setq cache (cdr cache)))
(if obj
;;
;; Already in a buffer, just do it.
((semanticdb-in-buffer-p obj)
- (semanticdb-set-buffer obj)
- (semantic-fetch-tags))
+ (save-excursion
+ (semanticdb-set-buffer obj)
+ (semantic-fetch-tags)))
;;
;; Not in a buffer. Forcing a load.
(force
(interactive)
(unless noninteractive
(message "Saving tag summaries..."))
- (let ((semanticdb--inhibit-make-directory nil))
+ (let ((semanticdb--inhibit-make-directory noninteractive))
(mapc 'semanticdb-save-db semanticdb-database-list))
(unless noninteractive
(message "Saving tag summaries...done")))