Mercurial > emacs
comparison lisp/cedet/semantic/db.el @ 106568:a54ddff7ac90
* cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
(semantic-mru-bookmark-mode): Doc fixes.
* cedet/semantic/db.el (semanticdb-cache-get): Use error instead
of assert.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 14 Dec 2009 04:17:00 +0000 |
parents | 83dde921cc1b |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
106567:c59fc4a754cc | 106568:a54ddff7ac90 |
---|---|
448 (defmethod semanticdb-cache-get ((table semanticdb-abstract-table) | 448 (defmethod semanticdb-cache-get ((table semanticdb-abstract-table) |
449 desired-class) | 449 desired-class) |
450 "Get a cache object on TABLE of class DESIRED-CLASS. | 450 "Get a cache object on TABLE of class DESIRED-CLASS. |
451 This method will create one if none exists with no init arguments | 451 This method will create one if none exists with no init arguments |
452 other than :table." | 452 other than :table." |
453 (assert (child-of-class-p desired-class 'semanticdb-abstract-cache)) | 453 (unless (child-of-class-p desired-class 'semanticdb-abstract-cache) |
454 (error "Invalid SemanticDB cache")) | |
454 (let ((cache (oref table cache)) | 455 (let ((cache (oref table cache)) |
455 (obj nil)) | 456 (obj nil)) |
456 (while (and (not obj) cache) | 457 (while (and (not obj) cache) |
457 (if (eq (object-class-fast (car cache)) desired-class) | 458 (if (eq (object-class-fast (car cache)) desired-class) |
458 (setq obj (car cache))) | 459 (setq obj (car cache))) |
498 (defmethod semanticdb-cache-get ((db semanticdb-project-database) | 499 (defmethod semanticdb-cache-get ((db semanticdb-project-database) |
499 desired-class) | 500 desired-class) |
500 "Get a cache object on DB of class DESIRED-CLASS. | 501 "Get a cache object on DB of class DESIRED-CLASS. |
501 This method will create one if none exists with no init arguments | 502 This method will create one if none exists with no init arguments |
502 other than :table." | 503 other than :table." |
503 (assert (child-of-class-p desired-class 'semanticdb-abstract-db-cache)) | 504 (unless (child-of-class-p desired-class 'semanticdb-abstract-cache) |
505 (error "Invalid SemanticDB cache")) | |
504 (let ((cache (oref db cache)) | 506 (let ((cache (oref db cache)) |
505 (obj nil)) | 507 (obj nil)) |
506 (while (and (not obj) cache) | 508 (while (and (not obj) cache) |
507 (if (eq (object-class-fast (car cache)) desired-class) | 509 (if (eq (object-class-fast (car cache)) desired-class) |
508 (setq obj (car cache))) | 510 (setq obj (car cache))) |