diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2008-05-08 09:19:05 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2008-05-08 09:19:05 +0200 |
commit | 9703398065157c719ca9b45638d51ec643bb84ab (patch) | |
tree | 1aa7ca86354614d3827ca51874437ac71ba6a28e | |
parent | 7f769d5febd8d629fad8d2ea761f0cb63ca7b2e3 (diff) | |
download | org-mode-9703398065157c719ca9b45638d51ec643bb84ab.tar.gz |
Fix bug with archiving to a subdirectory.
Reported by Wanrong Lin.
-rw-r--r-- | lisp/org-archive.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/org-archive.el b/lisp/org-archive.el index b8e82de..e8a2aab 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -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))) |