22

Is there a list of commands to choose Emacs modes? How can I know which modes are available on my platform? I mean the list of modes names you type after M-x.

4 Answers 4

23

type M-x *-mode <Tab> and emacs will list all interactive commands ending in -mode that are currently loaded.

I'm not sure you can easily see what modes are available after a require without first having loaded all the elisp files in your load path.

Sign up to request clarification or add additional context in comments.

2 Comments

The stock ones should all have autoloads defined, so you should be OK with this. Apropos (C-h a) is probably good here too.
@spong, also if you really wanted ones that weren't loaded yet you probably could write an elisp function to load everything in your load-path and then do this. This may or may not be a good idea though.
5

A function for listing major modes with some guess-work to avoid the listing of minor-modes and other functions that end in -mode:

(defun list-major-modes () "Returns list of potential major mode names (without the final -mode). Note, that this is guess work." (interactive) (let (l) (mapatoms #'(lambda (f) (and (commandp f) (string-match "-mode$" (symbol-name f)) ;; auto-loaded (or (and (autoloadp (symbol-function f)) (let ((doc (documentation f))) (when doc (and (let ((docSplit (help-split-fundoc doc f))) (and docSplit ;; car is argument list (null (cdr (read (car docSplit)))))) ;; major mode starters have no arguments (if (string-match "[mM]inor" doc) ;; If the doc contains "minor"... (string-match "[mM]ajor" doc) ;; it should also contain "major". t) ;; else we cannot decide therefrom )))) (null (help-function-arglist f))) (setq l (cons (substring (symbol-name f) 0 -5) l))))) (when (called-interactively-p 'any) (with-current-buffer (get-buffer-create "*Major Modes*") (clear-buffer-delete) (let ((standard-output (current-buffer))) (display-completion-list l) (display-buffer (current-buffer))))) l)) 

Comments

4
C-h a mode 

displays a summary of all modes

1 Comment

C-h a -mode$ RET would be better.
2

Here is the list : http://www.emacswiki.org/CategoryModes

1 Comment

some modes seem missing, e.g. zone isn't anywhere

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.