Browse Source

ox-publish: Use file true name as reference

* lisp/ox-publish.el (org-publish-file): Use file true name as
  reference.
Nicolas Goaziou 8 years ago
parent
commit
d9c0a810f7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/ox-publish.el

+ 4 - 4
lisp/ox-publish.el

@@ -664,13 +664,13 @@ If NO-CACHE is not nil, do not initialize `org-publish-cache'.
 This is needed, since this function is used to publish single
 This is needed, since this function is used to publish single
 files, when entire projects are published (see
 files, when entire projects are published (see
 `org-publish-projects')."
 `org-publish-projects')."
-  (let* ((project
+  (let* ((filename (file-truename filename)) ;normalize name
+	 (project
 	  (or project
 	  (or project
 	      (org-publish-get-project-from-filename filename)
 	      (org-publish-get-project-from-filename filename)
 	      (user-error "File %S is not part of any known project"
 	      (user-error "File %S is not part of any known project"
 			  (abbreviate-file-name filename))))
 			  (abbreviate-file-name filename))))
 	 (project-plist (cdr project))
 	 (project-plist (cdr project))
-	 (ftname (expand-file-name filename))
 	 (publishing-function
 	 (publishing-function
 	  (pcase (plist-get project-plist :publishing-function)
 	  (pcase (plist-get project-plist :publishing-function)
 	    (`nil (user-error "No publishing function chosen"))
 	    (`nil (user-error "No publishing function chosen"))
@@ -678,7 +678,7 @@ files, when entire projects are published (see
 	    (f (list f))))
 	    (f (list f))))
 	 (base-dir
 	 (base-dir
 	  (file-name-as-directory
 	  (file-name-as-directory
-	   (expand-file-name
+	   (file-truename
 	    (or (plist-get project-plist :base-directory)
 	    (or (plist-get project-plist :base-directory)
 		(user-error "Project %S does not have :base-directory defined"
 		(user-error "Project %S does not have :base-directory defined"
 			    (car project))))))
 			    (car project))))))
@@ -691,7 +691,7 @@ files, when entire projects are published (see
 		 (car project))))))
 		 (car project))))))
 	 (pub-dir
 	 (pub-dir
 	  (file-name-directory
 	  (file-name-directory
-	   (expand-file-name (file-relative-name ftname base-dir)
+	   (expand-file-name (file-relative-name filename base-dir)
 			     pub-base-dir))))
 			     pub-base-dir))))
 
 
     (unless no-cache (org-publish-initialize-cache (car project)))
     (unless no-cache (org-publish-initialize-cache (car project)))