all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Edward O'Connor <hober0@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: fundamental-mode-hook
Date: Fri, 09 Feb 2007 00:05:01 +0100	[thread overview]
Message-ID: <45CBAC9D.4020007@gmail.com> (raw)
In-Reply-To: <86k5ysjm34.fsf@rakim.cfhp.org>

Edward O'Connor wrote:
> 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))))
> `----



Thanks, looks useful.

  reply	other threads:[~2007-02-08 23:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08  0:38 fundamental-mode-hook Lennart Borgman (gmail)
2007-02-08 10:06 ` fundamental-mode-hook Karl Fogel
2007-02-08  1:13   ` fundamental-mode-hook Lennart Borgman (gmail)
2007-02-08 19:46     ` fundamental-mode-hook Richard Stallman
2007-02-08 22:29       ` fundamental-mode-hook Lennart Borgman (gmail)
2007-02-08 22:50         ` fundamental-mode-hook Stefan Monnier
2007-02-08 23:03           ` fundamental-mode-hook Lennart Borgman (gmail)
2007-02-08 22:55         ` fundamental-mode-hook Edward O'Connor
2007-02-08 23:05           ` Lennart Borgman (gmail) [this message]
2007-02-09 14:23         ` fundamental-mode-hook Richard Stallman
2007-02-08  1:30   ` fundamental-mode-hook Juanma Barranquero
2007-02-08  1:40     ` fundamental-mode-hook Lennart Borgman (gmail)
2007-02-08 15:36       ` fundamental-mode-hook Karl Fogel
2007-02-08 18:25         ` fundamental-mode-hook Lennart Borgman (gmail)
2007-02-08 19:45         ` fundamental-mode-hook Richard Stallman
2007-02-09  5:56           ` fundamental-mode-hook Karl Fogel
2007-02-08 19:46 ` fundamental-mode-hook Richard Stallman
2007-02-08 22:44   ` fundamental-mode-hook Lennart Borgman (gmail)
2007-02-09 14:23     ` fundamental-mode-hook Richard Stallman

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=45CBAC9D.4020007@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=hober0@gmail.com \
    /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.