组织模式:从稀疏树返回到以前的可见性 [英] org-mode: go back from sparse tree to previous visibility

查看:107
本文介绍了组织模式:从稀疏树返回到以前的可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将文档过滤到稀疏树后,如何撤消过滤器,返回上一个视图/可见性?因为我没有弄清楚如何做到这一点,我必须使所有可见的东西,这在大文件是不好的。似乎一定很明显,但我找不到答案...

After filtering my document to a sparse tree, how do I undo the filter, going back to the previous view/visibility? Because I haven't worked out how to do this out I have to make everything visible, which isn't nice in big documents. Seems like it must be obvious but I can't find the answer...

推荐答案

这看起来可能是我。在下面的代码中,我使用一些建议来在生成稀疏树之前保存轮廓状态,并通过C-c C-c清除轮廓状态。

This looks like it might be possible to me. In the following code I use some advice to save the outline state before generating the sparse tree, and to restore it when it is cleared via C-c C-c.

(setq lexical-binding t)

(let ((*outline-data* nil))
  (defun org-save-outline-state (&optional arg type)
    (setq *outline-data* (org-outline-overlay-data t)))

  (defun org-restore-outline-state (&optional arg)
    (when *outline-data*
      (org-set-outline-overlay-data *outline-data*)
      (setq *outline-data* nil))))

(advice-add 'org-sparse-tree :before 'org-save-outline-state)
(advice-add 'org-match-sparse-tree :before 'org-save-outline-state)
(advice-add 'org-ctrl-c-ctrl-c :after 'org-restore-outline-state)

似乎做你想要的。

这篇关于组织模式:从稀疏树返回到以前的可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆