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 23:06:30 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=43621 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtRrM-0001qF-RU for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 17:07:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtRrI-0003VR-UK for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 17:07:12 -0400 Received: from lo.gmane.org ([80.91.229.12]:43121) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtRrI-0003V1-J2 for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 17:07:08 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OtRr4-0001la-2Z for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 23:07: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 23:06:43 +0200 Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Sep 2010 23:06:43 +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 I now have a working function to blog the current org-entry to google blogs (blogger,blogspot) . See new thread "Blogging org entries using google command line". Richard Riley 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). >> >> 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)))) > > _______________________________________________ > 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 > -- ☘ http://www.shamrockirishbar.com, http://www.richardriley.net "Learning French is trivial: the word for horse is 'cheval' and everything follows thusly."