Emacs股票主要模式列表

pic*_*c11 19 emacs

是否有选择Emacs模式的命令列表?我怎么知道我的平台上有哪些模式可用?我的意思是你输入的模式名称列表M-x.

tob*_*ies 21

type M-x *-mode <Tab>和emacs将列出-mode 当前加载的所有交互式命令.

我不确定您是否可以在require没有首先加载加载路径中的所有elisp文件之后轻松查看可用的模式.


Tob*_*ias 5

用于列出带有一些猜测工作的主要模式的函数,以避免列出以 -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))
Run Code Online (Sandbox Code Playgroud)