From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Schmidt Subject: org-archive-add-header-to-new-files Date: Mon, 28 Jan 2013 12:51:49 +0000 (GMT) Message-ID: <87k3qxbhd0@ch.ristopher.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzoBo-00084U-4J for emacs-orgmode@gnu.org; Mon, 28 Jan 2013 07:51:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TzoBl-0005Sr-Aj for emacs-orgmode@gnu.org; Mon, 28 Jan 2013 07:51:56 -0500 Received: from ristopher.com ([146.185.21.93]:40002 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzoBl-0005Sd-1O for emacs-orgmode@gnu.org; Mon, 28 Jan 2013 07:51:53 -0500 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 --=-=-= Content-Type: text/plain Hi Org, here is a patch to master that allows one to inhibit the addition of the header line to newly created archive files. 2013-01-28 Christopher Schmidt * org-archive.el (org-archive-add-header-to-new-files): New option. (org-archive-subtree): Honour org-archive-add-header-to-new-files. --=-=-= Content-Type: text/x-diff Content-Disposition: inline --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -71,6 +71,12 @@ This variable is obsolete and has no effect anymore, instead add or remove :group 'org-archive :type 'boolean) +(defcustom org-archive-add-header-to-new-files t + "Non-nil means to add a header line (\"Archived entries from +file FILE-NAME\") to newly created archive files." + :group 'org-archive + :type 'boolean) + (defcustom org-archive-subtree-add-inherited-tags 'infile "Non-nil means append inherited tags when archiving a subtree." :group 'org-archive @@ -278,7 +284,8 @@ this heading." (let ((org-insert-mode-line-in-empty-file t) (org-inhibit-startup t)) (call-interactively 'org-mode))) - (when newfile-p + (when (and newfile-p + org-archive-add-header-to-new-files) (goto-char (point-max)) (insert (format "\nArchived entries from file %s\n\n" (buffer-file-name this-buffer)))) --=-=-= Content-Type: text/plain Christopher --=-=-=--