Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun provided-mode-derived-p (mode &rest modes)
- "Non-nil if MODE is derived from one of MODES.
- Uses the `derived-mode-parent' property of the symbol to trace backwards.
- If you just want to check `major-mode', use `derived-mode-p'."
- (while (and (not (memq mode modes))
- (let ((parent (get mode 'derived-mode-parent))
- (parentfn (symbol-function (get mode 'derived-mode-parent))))
- (setq mode (if (and parentfn (symbolp parentfn))
- parentfn
- parent)))
- mode)
Add Comment
Please, Sign In to add comment