如何在组织模式缓冲区中复制可折叠状态的可见文本? [英] How do you copy just the visible text from the folded state in an org-mode buffer?

查看:136
本文介绍了如何在组织模式缓冲区中复制可折叠状态的可见文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果来源为:

** TODO task #1
   - some text for task #1
** TODO task #2 
   - some text for task #2

,但是当您折叠所有任务时,将看起来像

but when you collapse all tasks it will look like

** TODO task #1 ...
** TODO task #2 ...

我想标记所有任务和复制到另一个缓冲区,它必须看起来像第二个变体。不要为每个任务中存储的任务包含文本。
我该怎么做?

I want to mark all tasks and copy to another buffer and it must look like a second variant. Don't include texts for tasks which stored inside every task. How i can to do it ?

推荐答案

根据Hendy的评论,在当前版本的组织模式下,您使用 org-copy-visible Cc Cx v )将当前区域的可见内容复制到杀死环。 ( Cx h 可以像往常一样用来标记整个缓冲区。)

As per Hendy's comment, in current versions of org-mode you use org-copy-visible (C-c C-x v) to copy the visible content of the current region to the kill ring. (C-x h can be used first to mark the entire buffer, as usual.)

另外,请注意如果您要将该内容导出为不同的格式,则出口发送菜单( Cx Ce )将提供仅可见开关。

In addition, note that the export dispatch menu (C-x C-e) provides a "Visible only" switch, if you want to export that content to a different format.

对于旧版本的组织模式,以下原始答案仍然适用:

For older versions of org-mode, the original answer below should still apply:

Mx org-export-visible RET SPC 将仅将您的组织模式缓冲区的当前可见文本复制到新的缓冲区。

M-x org-export-visible RET SPC will copy only the currently-visible text of your org-mode buffer into a new buffer.


org-export-visible是
`org-exp.el'中的交互式编译Lisp函数。

org-export-visible is an interactive compiled Lisp function in `org-exp.el'.

(org-export-visible TYPE ARG)

(org-export-visible TYPE ARG)

创建当前缓冲区的可见部分的副本,并将其导出。
该副本是在临时缓冲区中创建的,并在使用后删除。
TYPE是最后一个键(作为一个字符串),它还在
中选择了'c-c C-e'导出调度程序的export命令。
作为一个特殊情况,如果您在提示符下键入SPC,临时
组织模式文件将不会被删除,但会提交给您,以便
继续使用它。前缀arg ARG被传递到导出的
命令。

Create a copy of the visible part of the current buffer, and export it. The copy is created in a temporary buffer and removed after use. TYPE is the final key (as a string) that also select the export command in the `C-c C-e' export dispatcher. As a special case, if the you type SPC at the prompt, the temporary org-mode file will not be removed but presented to you so that you can continue to use it. The prefix arg ARG is passed through to the exporting command.

如果你想绑定( Cc o ,您可以使用以下内容:

If you wanted to bind that (to C-c o in this example), you could use the following:

(add-hook 'org-mode-hook 'my-org-mode-hook)
(defun my-org-mode-hook ()
  "Custom behaviours when entering org-mode."
  (local-set-key (kbd "C-c o") (function (lambda () (interactive)
                                           (org-export-visible ?\s nil)))))

这篇关于如何在组织模式缓冲区中复制可折叠状态的可见文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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