From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.bugs Subject: bug#57481: elisp code utilising derived-mode-parent Date: Tue, 30 Aug 2022 14:08:31 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34167"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57481@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 30 14:09:42 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT03q-0008fR-DP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 14:09:42 +0200 Original-Received: from localhost ([::1]:33534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT03o-0008DL-Qm for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 08:09:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT03E-00088a-El for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 08:09:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45268) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oT03C-0006GL-7P for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 08:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oT03C-0002G0-31 for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 08:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Dimech Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Aug 2022 12:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57481 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 57481-submit@debbugs.gnu.org id=B57481.16618613288659 (code B ref 57481); Tue, 30 Aug 2022 12:09:02 +0000 Original-Received: (at 57481) by debbugs.gnu.org; 30 Aug 2022 12:08:48 +0000 Original-Received: from localhost ([127.0.0.1]:35017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT02x-0002Fb-UZ for submit@debbugs.gnu.org; Tue, 30 Aug 2022 08:08:48 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:48721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT02t-0002FK-Th for 57481@debbugs.gnu.org; Tue, 30 Aug 2022 08:08:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661861311; bh=RhNL5AbtaCLCNyK96UXsAROZ8zN/isz1g7QBBXlxgow=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=eB2KjwMuvILFUn/8Tcc6RkmOiCjGvrCFcSzaA4L4NR0NL6BuBK3wOdfmsomsjPuyY YAPkN+7sA36e3CcRqRqvyFlxqlNvIYByDteX7rXGcI9SkVen7k3DxfKQNWr5z0GP2J pvpH0+nRt5zjhg9HBMVyJz29p/RHGZr7MMpxniJ8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [92.251.127.164] ([92.251.127.164]) by web-mail.gmx.net (3c-app-mailcom-bs10.server.lan [172.19.170.178]) (via HTTP); Tue, 30 Aug 2022 14:08:31 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:0Uly4my2a0hoyhi03yF0Utjy+patax2T0zi33fRXdIS49r5vCm2vBQaPt8td4Mmt+pJSh I+b7Pcts/PSNRg/jR3NL1JaUdRnB8DPkGTDIQzUNeijW2Y7YvgkfUx701RK8ks+pFQyN/cxtAh4a FFF2/0jmUcGDVW05AxJjuTNZzokx1DJ0bkI2vdHQagiFxThxvv1EDs4vlJITWhqP4V2Y+PdrVqWE gZY2akxXxLnC0u0TsEbd6quPqexU5/MEvTJoSl5MRafF4Z1fTOtqkNiE4cOetkAd8NhN/9BYFDuH oU= X-UI-Out-Filterresults: notjunk:1;V03:K0:vNmEmv7r+HY=:L8E7fAfyyTwm9jmCvrrTaB TMVQbzNvFNWbaYNjiFH69TTAVihra/dc5gVu8oqUPbQ9XvNcEal/UdeDHUMI8/DWk/n2wVieC It8xS0HwpPgMK9OE52ytvHVrD9Odj/MWoaO3qbwJEH1XiXrbuijfg3j4SraUrWNj1MOsKcSz9 mh1xg+wRlTGmv0JIzhZUTWQkzRTabFq9CBA6dGgk/eKL+pYe777Uuk52RKrIUv/R2vyDh9MVM IJrYMj2LyfiSa5gmGCjQEWsGmZGYL01xD7zuqOftPpirfQPvZwzQEFJyUH3p+u38Shkwfil8D l1nqKCIi1fRA6aJxqWKeA2wuyiFT5G1ITM0qUW9s6eC7sF9HpZzeI/vyAiQiGeJKvoGAO+5H2 iOoej3WSbJ5awijzuWaBycy+L3K/AgFcKg1vCN/0bUaOUKAze5DQXe+m4FhcWmMp/ly7ZXF13 0rBct6P2pYk9pDWsraX4wcbIZPh86o8Yi3aA+jRI0lXDGRwEw2MUdREr7YXr3muUtSLMXcvtB l4vbvpHlHlR6iO7F5XE8TBsYifB28li8ow/J7zPurs7rY6ayX88SrvpL+D6AWiNLn3QBSHy9P QKiqCTOWBUVGgDvEj5zD6dhyAuemYV/FId8bhZXVMrJ5QM/QjrUxdWG5xUkJnShk12wmiOTh1 XnLpiSJadXbZYBu/kyP3WAQyet/+PFvjw4vod3fbpoUn5sD9VFebZqwrv2Ae4uidQydAZ7nUd at1kiwchKOa7NcGR4vmRqcB2bKTgxhEIwpIi5RHc3sbTFCKkjX87vznXlfiptT+YDzeqpZga X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241119 Archived-At: > Sent: Tuesday, August 30, 2022 at 6:37 PM > From: "Phil Sainty" > To: "Christopher Dimech" > 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) > =3D> (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?