From 344b48f490416cb1200e19b28d356e7fb5b04387 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 2 Aug 2022 10:22:00 -0400 Subject: CEDET: Remove left-over uses of obsolete -child-p predicates Those predicates were still sometimes used in a few places, notably via `:type ... -child` which was never technically correct. * lisp/cedet/ede/config.el (ede-extra-config, ede-project-with-config): * lisp/cedet/ede/base.el (ede-project-placeholder): Avoid pseudo-type `-child`. * lisp/cedet/semantic/complete.el (semantic-displayer-focus-abstract): Move before use of `cl-typep` on it. (semantic-complete-current-match): * lisp/cedet/ede/speedbar.el (ede-speedbar-menu): Use `cl-typep` instead of `-child-p`. * lisp/cedet/semantic/db.el (semanticdb-get-buffer): Use `cl-defgeneric` for the main/default definition. (semantic-tag-parent-buffer): Add method. * lisp/cedet/semantic/tag-file.el (semantic-tag-parent-buffer): New generic function extracted from `semantic-go-to-tag`. This allows us to keep the semanticdb-table part in semantic/db and thus break a cyclic dependency. (semantic-go-to-tag): Use it. Demote to a plain `defun` since it's not overloaded anywhere. * lisp/cedet/semantic/util.el (semanticdb-abstract-table-child-p): Remove unused declaration. * lisp/cedet/srecode/compile.el (srecode-template-inserter-newline-child-p): Remove unused declaration. (srecord-compile-inserter-newline-p): New generic function, so we can move the `srecode-template-inserter-newline` case to `srecode/insert.el`, to avoid a cyclic dependency. * lisp/cedet/srecode/insert.el (srecord-compile-inserter-newline-p): New method. --- lisp/cedet/srecode/compile.el | 10 +++++----- lisp/cedet/srecode/insert.el | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'lisp/cedet/srecode') diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el index 37c83be8112..bed74861ca0 100644 --- a/lisp/cedet/srecode/compile.el +++ b/lisp/cedet/srecode/compile.el @@ -38,9 +38,6 @@ (require 'srecode/table) (require 'srecode/dictionary) -(declare-function srecode-template-inserter-newline-child-p "srecode/insert" - t t) - ;;; Code: ;;; Template Class @@ -378,8 +375,11 @@ It is hard if the previous inserter is a newline object." (while (and comp (stringp (car comp))) (setq comp (cdr comp))) (or (not comp) - (progn (require 'srecode/insert) - (srecode-template-inserter-newline-child-p (car comp))))) + (srecord-compile-inserter-newline-p (car comp)))) + +(cl-defgeneric srecord-compile-inserter-newline-p (_obj) + "Non-nil if OBJ is a newline inserter object." + nil) (defun srecode-compile-split-code (tag str STATE &optional end-name) diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el index 8dd5d251576..c0260c62a91 100644 --- a/lisp/cedet/srecode/insert.el +++ b/lisp/cedet/srecode/insert.el @@ -319,6 +319,10 @@ by themselves.") Specify the :indent argument to enable automatic indentation when newlines occur in your template.") +(cl-defmethod srecord-compile-inserter-newline-p + ((_ srecode-template-inserter-newline)) + t) + (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-newline) dictionary) "Insert the STI inserter." -- cgit v1.2.3