Łukasz Stelmach <lukasz.stelm...@iem.pw.edu.pl> writes: > Richard Riley <rile...@gmail.com> writes: > >> Łukasz Stelmach <lukasz.stelm...@iem.pw.edu.pl> writes: >>> Richard Riley <rile...@gmail.com> 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: > > > > * 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. > > > > 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.
Hi Lukasz, You are right and sub trees should be included. I was just looking at that while refitting the core blog part to be called more generally. I used : (org-forward-same-level 1 t) to do the same. http://github.com/rileyrg/org-googlecl/blob/subtrees-0.01/org-googlecl.el Seems to be working ok now. regards r. _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode