소스 검색

Fix bug with archiving to a subdirectory.

Reported by Wanrong Lin.
Carsten Dominik 17 년 전
부모
커밋
9703398065
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      lisp/org-archive.el

+ 6 - 1
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)))