emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: Q : select current org item as region


From: Łukasz Stelmach
Subject: [Orgmode] Re: Q : select current org item as region
Date: Fri, 10 Sep 2010 15:51:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Richard Riley <address@hidden> writes:

> Łukasz Stelmach <address@hidden> writes:
>> Richard Riley <address@hidden> 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




reply via email to

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