[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fundamental-mode-hook
From: |
Edward O'Connor |
Subject: |
Re: fundamental-mode-hook |
Date: |
Thu, 08 Feb 2007 17:55:43 -0500 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.3 (berkeley-unix) |
Lennart asked:
> What is the right way to find out if a function is a major mode?
Kevin Rodgers posted the following function to g.e.h or somewhere
similar some number of years ago. It's just a heuristic, but it works
well enough for my purposes.
,----
| (defun kr-major-mode-p (symbol)
| "Return non-nil if SYMBOL is a major mode."
| (and (fboundp symbol)
| (let ((function-name (symbol-name symbol)))
| (and (string-match "-mode\\'" function-name)
| (not (string-match "\\`turn-\\(on\\|off\\)-"
| function-name))))
| (not (assq symbol minor-mode-alist))))
`----
Ted
--
Edward O'Connor
address@hidden
Ense petit placidam sub libertate quietem.
Re: fundamental-mode-hook, Juanma Barranquero, 2007/02/07
- Re: fundamental-mode-hook, Lennart Borgman (gmail), 2007/02/07
- Re: fundamental-mode-hook, Karl Fogel, 2007/02/08
- Re: fundamental-mode-hook, Lennart Borgman (gmail), 2007/02/08
- Re: fundamental-mode-hook, Richard Stallman, 2007/02/08
- Re: fundamental-mode-hook, Karl Fogel, 2007/02/08
Re: fundamental-mode-hook, Richard Stallman, 2007/02/08