简体   繁体   English

如何在组织模式缓冲区中仅复制折叠状态下的可见文本?

[英]How do you copy just the visible text from the folded state in an org-mode buffer?

How to copy org file to other buffer, if source is: 如果源是:如何将组织文件复制到其他缓冲区

** 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 ? 我怎么能这样做?

As per Hendy's comment, in current versions of org-mode you use org-copy-visible ( Cc Cx v ) to copy the visible content of the current region to the kill ring. 根据Hendy的评论,在org-mode的当前版本中,您使用org-copy-visibleCc Cx v )将当前区域的可见内容复制到kill ring。 ( Cx h can be used first to mark the entire buffer, as usual.) (像往常一样,可以首先使用Cx h来标记整个缓冲区。)

In addition, note that the export dispatch menu ( Cx Ce ) provides a "Visible only" switch, if you want to export that content to a different format. 此外,请注意,如果要将该内容导出为其他格式,导出调度菜单( Cx Ce )将提供“仅可见”开关。

For older versions of org-mode, the original answer below should still apply: 对于旧版本的组织模式,以下原始答案仍然适用:


Mx org-export-visible RET SPC will copy only the currently-visible text of your org-mode buffer into a new buffer. Mx org-export-visible RET SPC将仅将组织模式缓冲区的当前可见文本复制到新缓冲区中。

org-export-visible is an interactive compiled Lisp function in `org-exp.el'. org-export-visible是`org-exp.el'中的交互式编译Lisp函数。

(org-export-visible TYPE ARG) (org-export-visible TYPE 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 `Cc Ce' export dispatcher. TYPE是最终键(作为字符串),它还在`Cc Ce'导出调度程序中选择导出命令。 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. 作为一种特殊情况,如果您在提示符下键入SPC,则不会删除临时组织模式文件,而是呈现给您,以便您可以继续使用它。 The prefix arg ARG is passed through to the exporting command. 前缀arg ARG传递给导出命令。

If you wanted to bind that (to Cc o in this example), you could use the following: 如果你想绑定它(在这个例子中为Cc o ),你可以使用以下代码:

(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)))))

org-copy-visible ,应该完全符合您的需要。

Try Mx org-todo-list (or Cc at ). 尝试Mx org-todo-list (或Cc at )。 This brings up a list of TODO entries (in the files listed in agenda file list) in the *Org Agenda* buffer. 这将在* Org Agenda *缓冲区中显示TODO条目列表(在议程文件列表中列出的文件中)。

You may need to add your current file to the agenda file list. 您可能需要将当前文件添加到议程文件列表中。 From org-agenda documentation: org-agenda文件:

If the current buffer is in Org-mode and visiting a file, you can also first press '<' once to indicate that the agenda should be temporarily (until the next use of Cc a) restricted to the current file. 如果当前缓冲区处于组织模式并访问文件,您也可以先按“<”一次,以指示议程应暂时(直到下次使用Cc a)限制在当前文件中。 Pressing '<' twice means to restrict to the current subtree or region (if active). 按“<”两次表示限制为当前子树或区域(如果处于活动状态)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM