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
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.
2 Comments
clstrfsck
The stock ones should all have autoloads defined, so you should be OK with this. Apropos (
C-h a) is probably good here too.tobyodavies
@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.
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
C-h a mode displays a summary of all modes
1 Comment
Michel de Ruiter
C-h a -mode$ RET would be better.Here is the list : http://www.emacswiki.org/CategoryModes
1 Comment
cnst
some modes seem missing, e.g. zone isn't anywhere