unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] Add new function derived-mode-parents
@ 2011-02-08 18:43 Julien Danjou
  2011-02-08 18:43 ` [PATCH 2/2] Make font-lock honor parents mode of current major-mode Julien Danjou
  2011-02-08 21:12 ` [PATCH 1/2] Add new function derived-mode-parents Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Danjou @ 2011-02-08 18:43 UTC (permalink / raw)
  To: emacs-devel; +Cc: Julien Danjou

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




^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-10 18:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-08 18:43 [PATCH 1/2] Add new function derived-mode-parents Julien Danjou
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).