From: Christopher Dimech <dimech@gmx.com>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: 57481@debbugs.gnu.org
Subject: bug#57481: elisp code utilising derived-mode-parent
Date: Tue, 30 Aug 2022 14:08:31 +0200 [thread overview]
Message-ID: <trinity-9f6a272c-c8fe-49c7-ad4c-f8ce36c75ec0-1661861311145@3c-app-mailcom-bs10> (raw)
In-Reply-To: <fbf558ae2cfa79fb8765a55f06c50d67@webmail.orcon.net.nz>
> 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: Re: 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)
Can one do something that can be run in elisp code and in
lisp-interaction-mode without requirement that the mode one
is interested in has been loaded?
next prev parent reply other threads:[~2022-08-30 12:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 5:44 bug#57481: elisp code utilising derived-mode-parent Christopher Dimech
2022-08-30 6:37 ` Phil Sainty
2022-08-30 11:33 ` Christopher Dimech
2022-08-30 12:02 ` Phil Sainty
2022-08-30 12:08 ` Christopher Dimech [this message]
2022-08-30 12:38 ` Phil Sainty
2022-08-30 12:46 ` Christopher Dimech
2022-08-30 13:02 ` Eli Zaretskii
2022-08-30 13:16 ` Christopher Dimech
2022-08-30 22:07 ` Phil Sainty
2022-08-31 6:24 ` Christopher Dimech
2022-08-31 11:31 ` Christopher Dimech
2022-08-30 10:36 ` Lars Ingebrigtsen
2022-08-30 11:48 ` Christopher Dimech
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-9f6a272c-c8fe-49c7-ad4c-f8ce36c75ec0-1661861311145@3c-app-mailcom-bs10 \
--to=dimech@gmx.com \
--cc=57481@debbugs.gnu.org \
--cc=psainty@orcon.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.