2008年12月30日星期二

emacs outline

outline 有 major-mode 和 minor-mode 两种
一般major-mode,很少应用.通常我们用c-mode,lisp 等作为主模式, outline作为 minor-mode 来使用
默认的minor-mode 下的命令前缀 C-c @ ,比较傻,可做如下设置

(setq outline-minor-mode-prefix [(control o)])
(global-set-key [(meta o)] 'open-line)

可以挂到其他主模式下使用
(add-hook 'php-mode-hook
'(lambda ()
(c-set-style "Stroustrup")
(outline-minor-mode "t")))



sublevels ( C-c @ C-q.
This collapses the whole tree, showing only the topmost heading lines. Given a numeric prefix, this command shows deeply nested sublevels. M-3 C-c @ C-q thus shows the top most heading lines and two more levels of heading lines.

body ( C-c @ C-t.
This hides all the body lines of the document--that is, showing only the heading lines. This is a very convenient way to get an overview of the whole document.

other ( C-c @ C-o.
This hides everything except the body lines in which point is located and the branches above it. The body lines of the branches above the line with point are also hidden. Note this does not seem to work in GNU Emacs 20.


Hide--Subtree

entry ( C-c @ C-c.
This hides the body lines of the given headline, but not its subbranches.

leaves ( C-c @ C-l.
This hides all the body lines of the subtree rooted in the given headline, but not the branches. This is equivalent to hide body described previously, but only for the given subtree.

subtree ( C-c @ C-d.
This hides all body lines and branches in the subtree located at the given headline.


Show--Whole Document

all ( C-c @ C-a.
This shows the whole tree. That is, it unfolds anything hidden by any of the outline functions.


Show--Subtree

entry ( C-c @ C-e.
This shows the body lines of the given headline. That is, neither the branches nor any of their content.

children ( C-c @ C-i.
This shows the immediate branches of this headline. Section heading lines will be shown for a chapter, but subsections, subsubsections, and body lines are not shown.

branches ( C-c @ C-k.
This shows all branches in the subtree for the given headline.

subtree ( C-c @ C-s.
This shows the whole subtree for the given headline. That is, all heading lines and body lines below the given headline.

没有评论: