emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christopher Schmidt <christopher@ch.ristopher.com>
To: emacs-orgmode@gnu.org
Subject: org-archive-add-header-to-new-files
Date: Mon, 28 Jan 2013 12:51:49 +0000 (GMT)	[thread overview]
Message-ID: <87k3qxbhd0@ch.ristopher.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

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  <christopher@ch.ristopher.com>

            * org-archive.el (org-archive-add-header-to-new-files): New
            option.
            (org-archive-subtree): Honour
            org-archive-add-header-to-new-files.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 927 bytes --]

--- 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))))

[-- Attachment #3: Type: text/plain, Size: 21 bytes --]


        Christopher

             reply	other threads:[~2013-01-28 12:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 12:51 Christopher Schmidt [this message]
2013-01-30 10:51 ` org-archive-add-header-to-new-files Bastien
2013-01-30 19:19   ` org-archive-add-header-to-new-files Christopher Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3qxbhd0@ch.ristopher.com \
    --to=christopher@ch.ristopher.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).