- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用组织模式来处理多个文件中的任务和项目。
在每周议程中,可以使用 <TAB>
跳转到每个 TODO 条目的位置。或<RET>
。如果目标文件之前未打开,则会加载该文件,并将光标设置到正确的标题,并且整个文档展开,包括抽屉。
我非常希望只看到一棵稀疏的树,其中除了正确的标题之外的所有内容都被折叠(子树可见性并不重要)。
可以通过使用 C-u <TAB
循环全局可见性来折叠整个树。 ,但随后我必须再次找到标题。
我知道我可以通过缩小缓冲区来隐藏其余部分,如下所述: Emacs, How can I display only current task and hide others in org-mode?但随后我失去了上下文(父标题,轻松访问 sibling )并且抽屉仍然打开。
理想情况下,我希望有一个显示以下内容的命令:
编辑:
函数 user3173715 的稍微修改版本发布似乎可以解决问题:
(defun org-show-current-heading-tidily ()
"Show next entry, keeping other entries closed."
(if (save-excursion (end-of-line) (outline-invisible-p))
(progn (org-show-entry) (show-children))
(outline-back-to-heading)
(unless (and (bolp) (org-on-heading-p))
(org-up-heading-safe)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-show-entry)
(show-children)))
最佳答案
这是基于实际问题编辑中的答案。
如果对任何人有帮助:当我尝试将上面的内容绑定(bind)到热键时,我不断收到错误,命令错误的参数某事......事实证明必须添加(交互式)标志才能使其工作。下面是与 M-= 相关的函数示例
(defun org-show-current-heading-tidily ()
(interactive) ;Inteactive
"Show next entry, keeping other entries closed."
(if (save-excursion (end-of-line) (outline-invisible-p))
(progn (org-show-entry) (show-children))
(outline-back-to-heading)
(unless (and (bolp) (org-on-heading-p))
(org-up-heading-safe)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-show-entry)
(show-children)))
(global-set-key "\M-=" 'org-show-current-heading-tidily)
@Patrick.B 感谢您的编辑!
关于Emacs 组织模式 : How can i fold everything but the current headline?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25161792/
(按标题道歉,我不能做得更好) 我的问题是找到一些通用的结构或“标准”函数来执行下一件事: xmap :: (a -> b) -> f a -> g b 然后,我们不仅可以映射元素,还可以映射整个结构
我正在尝试构建一个分为首屏和非首屏部分的页面,让查看者有一种进入海底的印象。我遇到了一个绊脚石,因为当涉及到 CSS 定位的概念时,我的脑子里有些东西就是拒绝点击。 最终,我试图在折叠下方添加另一个部
我正在尝试使用 Rayon启动一系列顶级线程以递归调用模拟函数。该代码在使用 channel 发送和接收时有效,因此它是多线程兼容的,但它无法使用 par_iter() 进行编译。 fn simula
所以我的任务是在 Scheme 中使用 fold-left 或 fold-right 实现最基本版本的 'map' 函数和 'filter' 函数。我很难理解这些函数到底在做什么。这是我所拥有的: (
我的序列、数组等的顺序很重要。我曾尝试在 List、Seq 和 Array 之间进行转换,以查看是否存在差异,并且在每种情况下都将顺序颠倒。 例如,我有一个 [名词] [动词] [形容词] 的序列,它
我发现自己一遍又一遍地重复一个模式,我想把它抽象出来。我相当有信心 coq 具有足够的表现力来捕捉模式,但我在弄清楚如何做到这一点时遇到了一些麻烦。我正在定义一种编程语言,它具有表示句法术语的相互递归
我有一个类型如下的函数: union :: a -> a -> a 和a有 加性 属性(property)。所以我们可以看成union作为 (+) 的一个版本 比如说,我们有 [a] ,并希望执行并行
我编写了以下代码,它创建了一个无限的斐波那契数列: fibs = 1:1:fib 1 1 where fib a b = a+b:fib b (a+b) 上面的代码可以用foldl写吗?或 fol
(rust noob here;我试图理解在高阶函数情况下什么可以/不能/应该/不应该通过引用传递) let a = [1, 2, 3]; 此调用有效: let sum = a.iter().fold
我对 Haskell 基础知识之一有疑问:Fold + 匿名函数 我正在使用 foldl 开发 bin2dec 程序。 解决方案如下所示: bin2dec :: String -> Int bin2d
让我们假设 fn scan(int, int) -> int。 使用时 fn count(x: int, y: int) -> int { scan(x - 1, y - 1) + scan(
我正在尝试实现一个通用的缺点列表,它比本书第 15 章中使用的列表更高级: use std::fmt::Debug; #[derive(Debug)] enum List { Nil,
我有一个网站,顶部有一个水平的 ul/li 按钮。如果有人缩小窗口,按钮会向下折叠成两排。有点丑。 举个例子: http://www.redolog.com 我想知道是否有一个布局指令说“看,你必须至
我正在使用下面的代码,改编自 this线。我能够获取文件夹中的文件列表,但最后出现段错误。知道为什么会这样吗? 有没有办法在for循环中获取当前文件(完整路径)的std::string? boost
问题如何以编程方式确定“折叠”(浏览器显示多少垂直内容)? “折叠”定义为您再也看不到/必须滚动的地方。 我曾尝试使用 JavaScript 来简单地确定浏览器窗口大小来确定折叠;不幸的是 - 这不能
人们普遍认为 1024x768 浏览器是目标,960 - 980 像素的宽度是可以接受的。 (我个人更喜欢 960 的 chrome,但没有争论的意义。) 我的问题是 - 通常可以假设用户的窗口高度是
我正忙于学习 F# 并在玩弄 Seq.fold。任何人都可以解释为什么以下两个调用本质上不相同,一个错误而另一个错误。 这样调用: Seq.fold (fun state input -> state
我相信这是有充分理由的,但我没有看到。 Fold在(说)List返回 the result of applying fold operator op between all the elements
我的家庭作业进行得非常顺利,直到我偶然发现了最后一项任务。 首先,我必须定义一个自定义 List结构体: data List a = Nil | Cons a (List a) deriving Sh
因此,有一种称为“折叠的通用属性”的东西,确切地说如下: g [] = i; g (x:xs) = f x (g xs) g = fold f i 但是,正如您现在可能的那样,有像 dropWhil
我是一名优秀的程序员,十分优秀!