From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: Q : select current org item as region Date: Wed, 08 Sep 2010 21:40:52 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=46961 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtQW7-0005Pv-1m for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 15:41:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtQW6-0006Rl-1t for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 15:41:10 -0400 Received: from lo.gmane.org ([80.91.229.12]:37521) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtQW5-0006RQ-SD for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 15:41:10 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OtQW0-00085q-2I for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 21:41:04 +0200 Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Sep 2010 21:41:04 +0200 Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Sep 2010 21:41:04 +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: > 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 > > Currently the function I have is (not working but to give you the idea > of what I am trying to accomplish): > > (defun rgr/org-blog-entry () > (interactive) > (save-excursion > (org-beginning-of-item) > (set-mark-command) > (org-end-of-item) > (let((tmpbuf (make-temp-file))) > (org-export-as-html nil nil tmpbuf t)))) > > _______________________________________________ > 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 > OK, minus several million for me for not digging deep enough. "item" is not an org item per se but a list item. I need the entry functions. So its taking shape (but not working yet ..) as (defun rgr/org-blog-entry () (interactive) (save-excursion (goto-char (org-entry-beginning-position)) (set-mark (org-entry-end-position)) (let((tmpfile (make-temp-file "org-blog-html-"))) (org-export-as-html nil nil (find-file-noselect tmpfile) t))))