[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#57481: elisp code utilising derived-mode-parent
From: |
Christopher Dimech |
Subject: |
bug#57481: elisp code utilising derived-mode-parent |
Date: |
Tue, 30 Aug 2022 13:33:13 +0200 |
> Sent: Tuesday, August 30, 2022 at 6:37 PM
> From: "Phil Sainty" <psainty@orcon.net.nz>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: 57481@debbugs.gnu.org
> Subject: bug#57481: elisp code utilising derived-mode-parent
>
> You can derive (as it were) such a function from the code of
> `provided-mode-derived-p' like so:
>
>
> (defun derived-mode-chain (mode)
> "Return the chain of derived modes for MODE."
> (let (chain)
> (while (progn (push mode chain)
> (let* ((parent (get mode 'derived-mode-parent))
> (parentfn (symbol-function parent)))
> (setq mode (if (and parentfn (symbolp parentfn))
> parentfn
> parent)))))
> (nreverse chain)))
>
>
> (derived-mode-chain 'latex-mode)
> => (latex-mode tex-mode text-mode)
We are getting somewhere, but am only getting (latex-mode) on Emacs 27.2
- bug#57481: elisp code utilising derived-mode-parent, Christopher Dimech, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Phil Sainty, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent,
Christopher Dimech <=
- bug#57481: elisp code utilising derived-mode-parent, Christopher Dimech, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Phil Sainty, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Christopher Dimech, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Eli Zaretskii, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Christopher Dimech, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Phil Sainty, 2022/08/30
- bug#57481: elisp code utilising derived-mode-parent, Christopher Dimech, 2022/08/31
bug#57481: elisp code utilising derived-mode-parent, Christopher Dimech, 2022/08/31
bug#57481: elisp code utilising derived-mode-parent, Lars Ingebrigtsen, 2022/08/30