From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: [PATCH 1/2] Add new function derived-mode-parents Date: Tue, 8 Feb 2011 19:43:12 +0100 Message-ID: <1297190593-4585-1-git-send-email-julien@danjou.info> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1297190614 6978 80.91.229.12 (8 Feb 2011 18:43:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Feb 2011 18:43:34 +0000 (UTC) Cc: Julien Danjou To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 08 19:43:30 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PmsXB-0003Gi-Ox for ged-emacs-devel@m.gmane.org; Tue, 08 Feb 2011 19:43:29 +0100 Original-Received: from localhost ([127.0.0.1]:40255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmsXA-0001Vq-Tc for ged-emacs-devel@m.gmane.org; Tue, 08 Feb 2011 13:43:28 -0500 Original-Received: from [140.186.70.92] (port=57761 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmsX6-0001VX-0z for emacs-devel@gnu.org; Tue, 08 Feb 2011 13:43:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmsX4-0002Ut-Pz for emacs-devel@gnu.org; Tue, 08 Feb 2011 13:43:23 -0500 Original-Received: from prometheus.naquadah.org ([212.85.154.174]:39422 helo=mx1.naquadah.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmsX4-0002TZ-GY for emacs-devel@gnu.org; Tue, 08 Feb 2011 13:43:22 -0500 Original-Received: by mx1.naquadah.org (Postfix, from userid 8) id 864F35C1A0; Tue, 8 Feb 2011 19:43:19 +0100 (CET) Original-Received: from keller.adm.naquadah.org (unknown [192.168.2.14]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPS id 5E4F45C141; Tue, 8 Feb 2011 19:43:17 +0100 (CET) Original-Received: from jd by keller.adm.naquadah.org with local (Exim 4.72) (envelope-from ) id 1PmsWy-0001DI-Bx; Tue, 08 Feb 2011 19:43:16 +0100 X-Mailer: git-send-email 1.7.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.85.154.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135764 Archived-At: Signed-off-by: Julien Danjou --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/derived.el | 7 +++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3b8d52..3ea0487 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-02-08 Julien Danjou + + * emacs-lisp/derived.el (derived-mode-parents): New function. + 2011-02-07 Jay Belanger * calc/calc-units.el (math-logunits-quant): Add support for diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 425a77e..5adba0e 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -277,6 +277,13 @@ is not very useful." mode) (make-obsolete 'derived-mode-class 'derived-mode-p "22.1") +(defun derived-mode-parents (mode) + "Return the list of ancestors for MODE. +MODE is included in the result." + (loop with mode = major-mode + while mode + collect mode + do (setq mode (get mode 'derived-mode-parent)))) ;;; PRIVATE -- 1.7.2.3