From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Q : select current org item as region Date: Wed, 08 Sep 2010 21:51:51 +0200 Message-ID: <87tym0j9ns.wl%n.goaziou@gmail.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from [140.186.70.92] (port=51789 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtQgl-0002sE-1d for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 15:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtQgj-0008E9-TQ for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 15:52:10 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:44248) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtQgj-0008Dx-PC for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 15:52:09 -0400 Received: by ewy28 with SMTP id 28so460631ewy.0 for ; Wed, 08 Sep 2010 12:52:08 -0700 (PDT) In-Reply-To: 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: Richard Riley Cc: emacs-orgmode@gnu.org Hello, >>>>> 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). > The problem I am having is that org-in-item-p is returning nil even > though the point is in an org-item. Is the docstring where it > mentions "hand-formatted item" more significant that I understand? > As a result org-beginning-of-item is failing Could you elaborate on that? Could you give a minimal example? If `org-in-item-p' is returning nil whereas you are in an item, there is definitely a bug to fix. Here is a suggestion to mark current item: (defun mark-current-item () (interactive) (when (org-in-item-p) (goto-char (org-get-item-beginning)) (push-mark nil t t) (goto-char (org-get-end-of-item (org-list-bottom-point))))) Regards, -- Nicolas