forked from mirrors/org-mode
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.
This commit is contained in:
parent
30ef385ee0
commit
e54dce3b8c
|
@ -71,6 +71,13 @@ This variable is obsolete and has no effect anymore, instead add or remove
|
||||||
:group 'org-archive
|
:group 'org-archive
|
||||||
:type 'boolean)
|
: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
|
(defcustom org-archive-subtree-add-inherited-tags 'infile
|
||||||
"Non-nil means append inherited tags when archiving a subtree."
|
"Non-nil means append inherited tags when archiving a subtree."
|
||||||
:group 'org-archive
|
:group 'org-archive
|
||||||
|
@ -278,9 +285,9 @@ this heading."
|
||||||
(let ((org-insert-mode-line-in-empty-file t)
|
(let ((org-insert-mode-line-in-empty-file t)
|
||||||
(org-inhibit-startup t))
|
(org-inhibit-startup t))
|
||||||
(call-interactively 'org-mode)))
|
(call-interactively 'org-mode)))
|
||||||
(when newfile-p
|
(when (and newfile-p org-archive-file-header-format)
|
||||||
(goto-char (point-max))
|
(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))))
|
(buffer-file-name this-buffer))))
|
||||||
(when datetree-date
|
(when datetree-date
|
||||||
(require 'org-datetree)
|
(require 'org-datetree)
|
||||||
|
|
Loading…
Reference in a new issue