all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Julien Danjou <julien@danjou.info>
To: emacs-devel@gnu.org
Cc: Julien Danjou <julien@danjou.info>
Subject: [PATCH 1/2] Add new function derived-mode-parents
Date: Tue,  8 Feb 2011 19:43:12 +0100	[thread overview]
Message-ID: <1297190593-4585-1-git-send-email-julien@danjou.info> (raw)

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 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  <julien@danjou.info>
+
+	* emacs-lisp/derived.el (derived-mode-parents): New function.
+
 2011-02-07  Jay Belanger  <jay.p.belanger@gmail.com>
 
 	* 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))))
 \f
 ;;; PRIVATE
 
-- 
1.7.2.3




             reply	other threads:[~2011-02-08 18:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 18:43 Julien Danjou [this message]
2011-02-08 18:43 ` [PATCH 2/2] Make font-lock honor parents mode of current major-mode Julien Danjou
2011-02-09 16:37   ` Stefan Monnier
2011-02-09 17:15     ` Julien Danjou
2011-02-09 21:47       ` Stefan Monnier
2011-02-10  9:25         ` Julien Danjou
2011-02-10 18:16           ` Stefan Monnier
2011-02-08 21:12 ` [PATCH 1/2] Add new function derived-mode-parents Stefan Monnier
2011-02-08 21:19   ` Julien Danjou

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=1297190593-4585-1-git-send-email-julien@danjou.info \
    --to=julien@danjou.info \
    --cc=emacs-devel@gnu.org \
    /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.