diff options
Diffstat (limited to 'lisp/cedet/semantic/db.el')
-rw-r--r-- | lisp/cedet/semantic/db.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index 76a49ddc548..0732f225779 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el @@ -124,6 +124,18 @@ for a new table not associated with a buffer." 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." @@ -469,7 +481,7 @@ other than :table." (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 @@ -520,7 +532,7 @@ other than :table." (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 |