emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Copy/Search Outline


From: Carsten Dominik
Subject: Re: [O] Copy/Search Outline
Date: Tue, 26 Jul 2011 12:10:47 +0200

On Jul 26, 2011, at 11:54 AM, Carsten Dominik wrote:

> 
> On Jul 26, 2011, at 11:30 AM, Florian Beck wrote:
> 
>> Christian Moe <address@hidden> writes:
>> 
>>>> Firstly, I want to copy the *visible* text (minus the …, but never mind
>>>> that);
>> 
>>> In other words: Begin exporting only the visible part with `C-c C-e 
>>> v', then press space at the prompt for output formats. This leaves you
>>> in a second buffer with a copy of the visible part (and yes, you do
>>> get rid of the ellipses). Then select all with `C-c h' (alternately,
>>> select the region of your choice) and copy. Kill the copy buffer when
>>> you're done with it.
>> 
>> Thanks. Seems like `org-export-visible' does exactly what I want.
>> 
>> I also wrote a function to copy the visible part of the region. For
>> those curious:
>> 
>> (defun copy-visible (beg end)
>> (interactive "r")
>> (let ((text "") s)
>>   (save-excursion
>>     (save-restriction
>>      (narrow-to-region beg end)
>>      (setq s (goto-char (point-min)))
>>      (while (not (= (point) (point-max)))
>>        (goto-char (org-find-invisible))
>>        (setq text (concat text (buffer-substring s (point))))
>>        (setq s (goto-char (org-find-visible))))))
>>   (kill-new text)))
> 
> This is a very useful function, thanks!  I have added it
> to org-mode as `org-copy-visible', currently without a key
> binding.

Ando now there is a key (C-c C-x v) and a menu entry,
and documentation in manual and refcard for it.

Thanks again.

- Carsten


> 
> To speed it up a bit, you made it collect the snippets into
> a list and then do the concat in one sweep - this might make a
> difference for large buffers.
> 
> Cheers
> 
> - Carsten

- Carsten






reply via email to

[Prev in Thread] Current Thread [Next in Thread]