Fix bug with archiving to a subdirectory.

Reported by Wanrong Lin.
This commit is contained in:
Carsten Dominik 2008-05-08 09:19:05 +02:00
parent 7f769d5feb
commit 9703398065
1 changed files with 6 additions and 1 deletions

View File

@ -135,14 +135,19 @@ archive file is."
files))
(defun org-extract-archive-file (&optional location)
"Extract and expand the file name from archive LOCATION.
if LOCATION is not given, the value of `org-archive-location' is used."
(setq location (or location org-archive-location))
(if (string-match "\\(.*\\)::\\(.*\\)" location)
(if (= (match-beginning 1) (match-end 1))
(buffer-file-name)
(expand-file-name
(format (match-string 1 location) buffer-file-name)))))
(format (match-string 1 location)
(file-name-nondirectory buffer-file-name))))))
(defun org-extract-archive-heading (&optional location)
"Extract the heading from archive LOCATION.
if LOCATION is not given, the value of `org-archive-location' is used."
(setq location (or location org-archive-location))
(if (string-match "\\(.*\\)::\\(.*\\)" location)
(match-string 2 location)))