From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: kill contents of a headline, but retain properties Date: Fri, 7 Aug 2015 08:44:16 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113df88e6965fd051cb7fe39 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNh0X-0007K8-K7 for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 08:44:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNh0T-0006AV-Jx for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 08:44:21 -0400 Received: from mail-io0-x22b.google.com ([2607:f8b0:4001:c06::22b]:36202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNh0T-0006AQ-DO for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 08:44:17 -0400 Received: by ioeg141 with SMTP id g141so110313716ioe.3 for ; Fri, 07 Aug 2015 05:44:16 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --001a113df88e6965fd051cb7fe39 Content-Type: text/plain; charset=UTF-8 Hi, I have a headline like this: * Gradebook :PROPERTIES: :CUSTOM_ID: gradebook :END: some content etc etc etc. I would like to be able to replace the contents of that headline automatically, but retain the properties. Howeve,r if for some reason the properites drawer is there I don't want to accidentally search to the NEXT headline and replace ITS content! -- so I don't want to just re-search-forward ":END:". I tried this: (org-open-link-from-string "[[#gradebook]]") (kill-region (org-element-property :contents-begin (org-element-at-point)) (org-element-property :contents-end (org-element-at-point))) But "contents-begin" of course starts at the beginning of the property drawer. I thought "org-element-contents" might help me but it doesn't. Any suggestions? Thank you! matt --001a113df88e6965fd051cb7fe39 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I have a he= adline like this:

* Gradebook
:PROPERTIES:
:CUSTOM_ID: gradebo= ok
:END:

some content etc etc etc.

I would lik= e to be able to replace the contents of that headline automatically, but re= tain the properties.=C2=A0 Howeve,r if for some reason the properites drawe= r is there I don't want to accidentally search to the NEXT headline and= replace ITS content! -- so I don't want to just re-search-forward &quo= t;:END:".=C2=A0 I tried this:

(org-open-link-from-string "= [[#gradebook]]")
(kill-region (org-element-property :contents-begin= (org-element-at-point)) (org-element-property :contents-end (org-element-a= t-point)))

But "contents-begin" of course starts at = the beginning of the property drawer.=C2=A0 I thought "org-element-con= tents" might help me but it doesn't.

Any suggestions= ? Thank you!
matt
--001a113df88e6965fd051cb7fe39--