]> git.eshelyaron.com Git - emacs.git/commit
Use `derived-mode-add-parents` in remaining uses of `derived-mode-parent`
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 7 Nov 2023 00:05:40 +0000 (19:05 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 9 Nov 2023 05:33:52 +0000 (00:33 -0500)
commit8323394bc801e01dedd95e0ff8d573dd1f5e34ba
treea895207eafd180e6c9b7ff056e04b74ff1ab495d
parent5afa55a946a0271c624359e9de5d62bcaf39729b
Use `derived-mode-add-parents` in remaining uses of `derived-mode-parent`

Until now multiple inheritance wasn't really used, but some ad-hoc
code went a bit beyond the normal uses of the mode hierarchy.
Use the new multiple inheritance code to replace that ad-hoc code,
thereby eliminating basically all remaining direct uses of the
`derived-mode-parent` property.

CEDET had its own notion of mode hierrchy using `derived-mode-parent`
as well as its own `mode-local-parent` property set via
`define-child-mode`.
`derived-mode-add-parents` lets us reimplement `define-child-mode`
such that CEDET can now use the normal API functions.

* lisp/locate.el (locate-mode): Use `derived-mode-add-parents`.

* lisp/cedet/mode-local.el (get-mode-local-parent): Declare obsolete.
(mode-local-equivalent-mode-p, mode-local-use-bindings-p): Make them
obsolete aliases.
(mode-local--set-parent): Rewrite to use `derived-mode-add-parents`.
Declare as obsolete.
(mode-local-map-mode-buffers): Use `derived-mode-p`.
(mode-local-symbol, mode-local--activate-bindings)
(mode-local--deactivate-bindings, mode-local-describe-bindings-2):
Use `derived-mode-all-parents`.

* lisp/cedet/srecode/table.el (srecode-get-mode-table):
* lisp/cedet/srecode/find.el (srecode-table, srecode-load-tables-for-mode)
(srecode-all-template-hash): Use `derived-mode-all-parents`.

* lisp/cedet/srecode/map.el (srecode-map-entries-for-mode):
* lisp/cedet/semantic/db.el (semanticdb-equivalent-mode):
Use `provided-mode-derived-p` now that it obeys `define-child-mode`.
lisp/cedet/mode-local.el
lisp/cedet/semantic/db.el
lisp/cedet/semantic/grammar.el
lisp/cedet/semantic/lex-spp.el
lisp/cedet/srecode/find.el
lisp/cedet/srecode/map.el
lisp/cedet/srecode/table.el
lisp/locate.el