From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Copy/Search Outline Date: Tue, 26 Jul 2011 12:10:47 +0200 Message-ID: References: <87d3h2xe2t.fsf@sophokles.streitblatt.de> <4E2E6027.5070906@christianmoe.com> <87y5zlcrtn.fsf@sophokles.streitblatt.de> <7123590C-F698-47FD-997E-CC7DEE3F7170@gmail.com> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlebE-00067l-LG for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 06:10:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlebD-0002LE-Af for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 06:10:52 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:63701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlebD-0002L3-0z for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 06:10:51 -0400 Received: by eyx24 with SMTP id 24so622494eyx.19 for ; Tue, 26 Jul 2011 03:10:50 -0700 (PDT) In-Reply-To: <7123590C-F698-47FD-997E-CC7DEE3F7170@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org, Florian Beck , mail@christianmoe.com On Jul 26, 2011, at 11:54 AM, Carsten Dominik wrote: >=20 > On Jul 26, 2011, at 11:30 AM, Florian Beck wrote: >=20 >> Christian Moe writes: >>=20 >>>> Firstly, I want to copy the *visible* text (minus the =85, but = never mind >>>> that); >>=20 >>> In other words: Begin exporting only the visible part with `C-c C-e=20= >>> 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. >>=20 >> Thanks. Seems like `org-export-visible' does exactly what I want. >>=20 >> I also wrote a function to copy the visible part of the region. For >> those curious: >>=20 >> (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 (=3D (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))) >=20 > 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 >=20 > 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. >=20 > Cheers >=20 > - Carsten - Carsten