From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: kill contents of a headline, but retain properties Date: Fri, 07 Aug 2015 16:40:16 +0200 Message-ID: <87wpx7mab3.fsf@gmx.us> References: <87614rtfqj.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNiou-0006Vz-NF for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 10:40:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNioq-0001Vh-Nc for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 10:40:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:45539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNioq-0001VC-Gd for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 10:40:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZNioo-0002mz-DT for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 16:40:22 +0200 Received: from ip5b4025d5.dynamic.kabel-deutschland.de ([91.64.37.213]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Aug 2015 16:40:22 +0200 Received: from rasmus by ip5b4025d5.dynamic.kabel-deutschland.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Aug 2015 16:40:22 +0200 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: emacs-orgmode@gnu.org Matt Price writes: > can you just provide a skeletal example so I understand better wha that > means? thanks so much! There's an example in the manual. Here's another example: In org: #+begin: thanks :pretext "We have received valuable comments from" #+end: The function: (defun org-dblock-write:thanks (params) "Reads THANKS file in same folder and format. PARAMS can hold :filename, :keyword, and :prefix" (when (file-exists-p (or (plist-get params :filename) "THANKS")) (insert (or (plist-get params :keyword) "#+thanks: ") (plist-get params :prefix) " " (replace-regexp-in-string ".*?\\(,\\)[^,]*\\'" ", and" (mapconcat 'identity (remove-if (lambda (str) (string-match-p "^\\s-*$" str)) (split-string (with-temp-buffer (save-excursion (insert-file-contents "THANKS")) (flush-lines "^\\s-*$" (point-min) (point-max)) (buffer-string)) "\\s-*\n+\\s-*")) ", ") nil nil 1) "."))) You might want to add (org-dblock-update t) to some export hook. Rasmus -- This space is left intentionally blank