diff options
| -rw-r--r-- | lisp/cedet/semantic/db-el.el | 28 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-global.el | 8 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db.el | 44 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio.el | 9 |
4 files changed, 51 insertions, 38 deletions
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el index 5375623c132..39d61fe789b 100644 --- a/lisp/cedet/semantic/db-el.el +++ b/lisp/cedet/semantic/db-el.el | |||
| @@ -53,10 +53,13 @@ It does not need refreshing." | |||
| 53 | "Return nil, we never need a refresh." | 53 | "Return nil, we never need a refresh." |
| 54 | nil) | 54 | nil) |
| 55 | 55 | ||
| 56 | (cl-defmethod object-print ((obj semanticdb-table-emacs-lisp) &rest strings) | 56 | (cl-defmethod semanticdb-debug-info ((obj semanticdb-table-emacs-lisp)) |
| 57 | "Pretty printer extension for `semanticdb-table-emacs-lisp'. | 57 | (list "(proxy)")) |
| 58 | Adds the number of tags in this file to the object print name." | 58 | |
| 59 | (apply #'cl-call-next-method obj (cons " (proxy)" strings))) | 59 | (cl-defmethod cl-print-object ((obj semanticdb-table-emacs-lisp) stream) |
| 60 | "Pretty printer extension for `semanticdb-table-emacs-lisp'." | ||
| 61 | (princ (eieio-object-name obj (semanticdb-debug-info obj)) | ||
| 62 | stream)) | ||
| 60 | 63 | ||
| 61 | (defclass semanticdb-project-database-emacs-lisp | 64 | (defclass semanticdb-project-database-emacs-lisp |
| 62 | (semanticdb-project-database eieio-singleton) | 65 | (semanticdb-project-database eieio-singleton) |
| @@ -67,14 +70,19 @@ Adds the number of tags in this file to the object print name." | |||
| 67 | ) | 70 | ) |
| 68 | "Database representing Emacs core.") | 71 | "Database representing Emacs core.") |
| 69 | 72 | ||
| 70 | (cl-defmethod object-print ((obj semanticdb-project-database-emacs-lisp) &rest strings) | 73 | (cl-defmethod semanticdb-debug-info ((obj |
| 71 | "Pretty printer extension for `semanticdb-table-emacs-lisp'. | 74 | semanticdb-project-database-emacs-lisp)) |
| 72 | Adds the number of tags in this file to the object print name." | ||
| 73 | (let ((count 0)) | 75 | (let ((count 0)) |
| 74 | (mapatoms (lambda (_sym) (setq count (1+ count)))) | 76 | (mapatoms (lambda (_sym) (setq count (1+ count)))) |
| 75 | (apply #'cl-call-next-method obj (cons | 77 | (append (cl-call-next-method obj) |
| 76 | (format " (%d known syms)" count) | 78 | (list (format "(%d known syms)" count))))) |
| 77 | strings)))) | 79 | |
| 80 | (cl-defmethod cl-print-object ((obj semanticdb-project-database-emacs-lisp) | ||
| 81 | stream) | ||
| 82 | "Pretty printer extension for `semanticdb-table-emacs-lisp'. | ||
| 83 | Adds the number of tags in this file to the object print name." | ||
| 84 | (princ (eieio-object-name obj (semanticdb-debug-info obj)) | ||
| 85 | stream)) | ||
| 78 | 86 | ||
| 79 | ;; Create the database, and add it to searchable databases for Emacs Lisp mode. | 87 | ;; Create the database, and add it to searchable databases for Emacs Lisp mode. |
| 80 | (defvar-mode-local emacs-lisp-mode semanticdb-project-system-databases | 88 | (defvar-mode-local emacs-lisp-mode semanticdb-project-system-databases |
diff --git a/lisp/cedet/semantic/db-global.el b/lisp/cedet/semantic/db-global.el index 7592b004e4e..0fff96d0c6a 100644 --- a/lisp/cedet/semantic/db-global.el +++ b/lisp/cedet/semantic/db-global.el | |||
| @@ -114,10 +114,14 @@ if optional DONT-ERR-IF-NOT-AVAILABLE is non-nil; else throw an error." | |||
| 114 | ) | 114 | ) |
| 115 | "A table for returning search results from GNU Global.") | 115 | "A table for returning search results from GNU Global.") |
| 116 | 116 | ||
| 117 | (cl-defmethod object-print ((obj semanticdb-table-global) &rest strings) | 117 | (cl-defmethod semanticdb-debug-info ((obj semanticdb-table-global)) |
| 118 | (list "(proxy)")) | ||
| 119 | |||
| 120 | (cl-defmethod cl-print-object ((obj semanticdb-table-global) stream) | ||
| 118 | "Pretty printer extension for `semanticdb-table-global'. | 121 | "Pretty printer extension for `semanticdb-table-global'. |
| 119 | Adds the number of tags in this file to the object print name." | 122 | Adds the number of tags in this file to the object print name." |
| 120 | (apply #'cl-call-next-method obj (cons " (proxy)" strings))) | 123 | (princ (eieio-object-name obj (semanticdb-debug-info obj)) |
| 124 | stream)) | ||
| 121 | 125 | ||
| 122 | (cl-defmethod semanticdb-equivalent-mode ((table semanticdb-table-global) &optional buffer) | 126 | (cl-defmethod semanticdb-equivalent-mode ((table semanticdb-table-global) &optional buffer) |
| 123 | "Return t, pretend that this table's mode is equivalent to BUFFER. | 127 | "Return t, pretend that this table's mode is equivalent to BUFFER. |
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index 1987bc07e29..33ad4701769 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el | |||
| @@ -171,18 +171,6 @@ based on whichever technique used. This method provides a hook for | |||
| 171 | them to convert TAG into a more complete form." | 171 | them to convert TAG into a more complete form." |
| 172 | (cons obj tag)) | 172 | (cons obj tag)) |
| 173 | 173 | ||
| 174 | (cl-defmethod object-print ((obj semanticdb-abstract-table) &rest strings) | ||
| 175 | "Pretty printer extension for `semanticdb-abstract-table'. | ||
| 176 | Adds the number of tags in this file to the object print name." | ||
| 177 | (if (or (not strings) | ||
| 178 | (and (= (length strings) 1) (stringp (car strings)) | ||
| 179 | (string= (car strings) ""))) | ||
| 180 | ;; Else, add a tags quantifier. | ||
| 181 | (cl-call-next-method obj (format " (%d tags)" (length (semanticdb-get-tags obj)))) | ||
| 182 | ;; Pass through. | ||
| 183 | (apply #'cl-call-next-method obj strings) | ||
| 184 | )) | ||
| 185 | |||
| 186 | ;;; Index Cache | 174 | ;;; Index Cache |
| 187 | ;; | 175 | ;; |
| 188 | (defclass semanticdb-abstract-search-index () | 176 | (defclass semanticdb-abstract-search-index () |
| @@ -321,13 +309,18 @@ If OBJ's file is not loaded, read it in first." | |||
| 321 | (oset obj dirty t) | 309 | (oset obj dirty t) |
| 322 | ) | 310 | ) |
| 323 | 311 | ||
| 324 | (cl-defmethod object-print ((obj semanticdb-table) &rest strings) | 312 | (cl-defmethod semanticdb-debug-info ((obj semanticdb-table)) |
| 313 | (list (format "(%d tags)%s" | ||
| 314 | (length (semanticdb-get-tags obj)) | ||
| 315 | (if (oref obj dirty) | ||
| 316 | ", DIRTY" | ||
| 317 | "")))) | ||
| 318 | |||
| 319 | (cl-defmethod cl-print-object ((obj semanticdb-table) stream) | ||
| 325 | "Pretty printer extension for `semanticdb-table'. | 320 | "Pretty printer extension for `semanticdb-table'. |
| 326 | Adds the number of tags in this file to the object print name." | 321 | Adds the number of tags in this file to the object print name." |
| 327 | (apply #'cl-call-next-method obj | 322 | (princ (eieio-object-name obj (semanticdb-debug-info obj)) |
| 328 | (format " (%d tags)" (length (semanticdb-get-tags obj))) | 323 | stream)) |
| 329 | (if (oref obj dirty) ", DIRTY" "") | ||
| 330 | strings)) | ||
| 331 | 324 | ||
| 332 | ;;; DATABASE BASE CLASS | 325 | ;;; DATABASE BASE CLASS |
| 333 | ;; | 326 | ;; |
| @@ -380,16 +373,17 @@ where it may need to resynchronize with some persistent storage." | |||
| 380 | (setq tabs (cdr tabs))) | 373 | (setq tabs (cdr tabs))) |
| 381 | dirty)) | 374 | dirty)) |
| 382 | 375 | ||
| 383 | (cl-defmethod object-print ((obj semanticdb-project-database) &rest strings) | 376 | (cl-defmethod semanticdb-debug-info ((obj semanticdb-project-database)) |
| 377 | (list (format "(%d tables%s)" | ||
| 378 | (length (semanticdb-get-database-tables obj)) | ||
| 379 | (if (semanticdb-dirty-p obj) | ||
| 380 | " DIRTY" "")))) | ||
| 381 | |||
| 382 | (cl-defmethod cl-print-object ((obj semanticdb-project-database) stream) | ||
| 384 | "Pretty printer extension for `semanticdb-project-database'. | 383 | "Pretty printer extension for `semanticdb-project-database'. |
| 385 | Adds the number of tables in this file to the object print name." | 384 | Adds the number of tables in this file to the object print name." |
| 386 | (apply #'cl-call-next-method obj | 385 | (princ (eieio-object-name obj (semanticdb-debug-info obj)) |
| 387 | (format " (%d tables%s)" | 386 | stream)) |
| 388 | (length (semanticdb-get-database-tables obj)) | ||
| 389 | (if (semanticdb-dirty-p obj) | ||
| 390 | " DIRTY" "") | ||
| 391 | ) | ||
| 392 | strings)) | ||
| 393 | 387 | ||
| 394 | (cl-defmethod semanticdb-create-database ((dbc (subclass semanticdb-project-database)) directory) | 388 | (cl-defmethod semanticdb-create-database ((dbc (subclass semanticdb-project-database)) directory) |
| 395 | "Create a new semantic database of class DBC for DIRECTORY and return it. | 389 | "Create a new semantic database of class DBC for DIRECTORY and return it. |
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 7ad44b6d26c..5bb08ee3e37 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el | |||
| @@ -398,7 +398,14 @@ contents of field NAME is matched against PAT, or they can be of | |||
| 398 | If EXTRA, include that in the string returned to represent the symbol." | 398 | If EXTRA, include that in the string returned to represent the symbol." |
| 399 | (cl-check-type obj eieio-object) | 399 | (cl-check-type obj eieio-object) |
| 400 | (format "#<%s %s%s>" (eieio-object-class obj) | 400 | (format "#<%s %s%s>" (eieio-object-class obj) |
| 401 | (eieio-object-name-string obj) (or extra ""))) | 401 | (eieio-object-name-string obj) |
| 402 | (cond | ||
| 403 | ((null extra) | ||
| 404 | "") | ||
| 405 | ((listp extra) | ||
| 406 | (concat " " (mapconcat #'identity extra " "))) | ||
| 407 | (t | ||
| 408 | extra)))) | ||
| 402 | (define-obsolete-function-alias 'object-name #'eieio-object-name "24.4") | 409 | (define-obsolete-function-alias 'object-name #'eieio-object-name "24.4") |
| 403 | 410 | ||
| 404 | (cl-defgeneric eieio-object-set-name-string (obj name) | 411 | (cl-defgeneric eieio-object-set-name-string (obj name) |