From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?=C5=81ukasz?= Stelmach Subject: Re: Q : select current org item as region Date: Fri, 10 Sep 2010 15:51:54 +0200 Message-ID: <8739th3dvp.fsf@dasa3.iem.pw.edu.pl> References: <87lj7bw0a6.fsf@dasa3.iem.pw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=49472 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou41T-0000gr-Gs for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 09:52:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ou41S-0007nA-4z for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 09:52:11 -0400 Received: from lo.gmane.org ([80.91.229.12]:48786) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou41R-0007n1-Ua for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 09:52:10 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ou41P-0008Lu-Gk for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 15:52:07 +0200 Received: from dasa3.iem.pw.edu.pl ([194.29.147.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Sep 2010 15:52:07 +0200 Received: from lukasz.stelmach by dasa3.iem.pw.edu.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Sep 2010 15:52:07 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Richard Riley writes: > Łukasz Stelmach writes: >> Richard Riley writes: >>> What would be the best elisp way to select the current org entry? I want >>> a hot key to select the current item as current region (not into the >>> clipboard). >>> >> This is mine: >> >> (defun stl/outline-mark-subtree () [...] >> >> it's derived from the original outline-mark subtree but marks an empty >> space before a next-same-level-heading. > > Thanks for the replies. > > Just for google completeness > > (goto-char (org-entry-beginning-position)) > (set-mark (org-entry-end-position)) > > seemed the most efficient after digging about a bit. It's not the same, it does not include the subtree. Take for example: --8<---------------cut here---------------start------------->8--- * Top 1 Some text in the Top 1 node ** Bottom 1 Some more text. ** Bottom 2 No text at all * Top 2 Another toplevel entry. --8<---------------cut here---------------end--------------->8--- If you place point on the second line of the above example, (stl/)?outline-mark function will mark: Top 1, Bottom 1 and Bottom 2, nodes with their content. While the org-entry-(beginning|end)-position will provide you only with Top 1 heading and a text before Bottom 1. -- Miłego dnia, Łukasz Stelmach