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