Emacs的股票主要模式列表
答
类型M-x *-mode <Tab>
和emacs将列出以-mode
结尾的所有交互式命令,它们当前已加载。
我不知道,你可以很容易地看到什么模式是require
后可用,而没有首先加载都在你的负载路径的elisp文件。
答
一种列出了一些猜测的工作主要模式,以避免轻微-模式等功能,在-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))
答
C-h a mode
显示所有模式
+0
'C-h的-mode $ RET'会更好。 – 2016-04-25 20:39:13
股票的人都应该有定义自动加载,所以你应该与此行的总结。 Apropos('C-h a')在这里也许很好。 – msandiford 2011-04-04 09:09:52
@spong,还当你确实想那些都没有载入你也许可以写一个elisp的功能加载在负载路径上的一切,然后做到这一点。不过这可能也可能不是一个好主意。 – tobyodavies 2011-04-04 09:11:23
谢谢!!!!!!!!!! – pic11 2011-04-04 09:21:20