summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-01-30 10:50:14 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-01-30 10:50:14 (GMT)
commite54dce3b8c3141a8d8e01dd18564310b3d2408c5 (patch)
tree36841d2ee94fbf082f112c4f534aebc648ac0f47
parent30ef385ee03ea1f92e07f368413c065630bc01b8 (diff)
downloadorg-mode-e54dce3b8c3141a8d8e01dd18564310b3d2408c5.zip
org-mode-e54dce3b8c3141a8d8e01dd18564310b3d2408c5.tar.gz
org-archive.el (org-archive-file-header-format): New option
* org-archive.el (org-archive-file-header-format): New option. (org-archive-subtree): Use it. Thanks to Christopher Schmidt for suggesting something close.
-rw-r--r--lisp/org-archive.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index 2fcfc86..09564d9 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -71,6 +71,13 @@ This variable is obsolete and has no effect anymore, instead add or remove
:group 'org-archive
:type 'boolean)
+(defcustom org-archive-file-header-format "\nArchived entries from file %s\n\n"
+ "The header format string for newly created archive files.
+When nil, no header will be inserted.
+When a string, a %s formatter will be replaced by the file name."
+ :group 'org-archive
+ :type 'string)
+
(defcustom org-archive-subtree-add-inherited-tags 'infile
"Non-nil means append inherited tags when archiving a subtree."
:group 'org-archive
@@ -278,9 +285,9 @@ 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-file-header-format)
(goto-char (point-max))
- (insert (format "\nArchived entries from file %s\n\n"
+ (insert (format org-archive-file-header-format
(buffer-file-name this-buffer))))
(when datetree-date
(require 'org-datetree)