[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [PATCH] Fix for relative symlinks in subdirectories
From: |
T.F. Torrey |
Subject: |
[O] [PATCH] Fix for relative symlinks in subdirectories |
Date: |
Sun, 02 Sep 2012 11:44:43 -0700 |
Hello all,
When publishing a project that contains relative symlinks in
subdirectories, org-publish-cache-ctime-of-src mistakenly connects the
true file name with the base-dir of the project instead of the symlink,
causing an error when the linked file is in a subdirectory and not the
base-dir.
The attached patch modifiies org-publish-cache-ctime-of-src to use the
dir of the current file as the base-dir instead of simply the project
base-dir.
With this change, though, the base-dir argument to this function now
never does anything. This doesn't seem to cause problems for me, but I
am far from intimate with the workings of the org-publish cache system.
Perhaps someone with better knowledge of the system could provide a
better fix. Otherwise, the base-dir argument could be refactored out.
ChangeLog entry: Fix for relative symlinks in subdirectories
Modify org-publish-cache-ctime-of-src to use the dir of the current file
as the base-dir instead of simply the project base-dir.
TINYCHANGE
Emacs : GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2) of
2012-08-29 on nannyberry, modified by Debian Package: Org-mode version
7.9 (release_7.9-190-g845daf.dirty-git @ mixed installation!
/usr/local/share/emacs/site-lisp/ and
/home/tftorrey/.emacs.d/src/org-mode/lisp/)
Best regards,
Terry
--
T.F. Torrey
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index e78e2d4..cd77c82 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -1191,7 +1191,7 @@ Returns value on success, else nil."
(defun org-publish-cache-ctime-of-src (f base-dir)
"Get the FILENAME ctime as an integer."
(let ((attr (file-attributes
- (expand-file-name (or (file-symlink-p f) f) base-dir))))
+ (expand-file-name (or (file-symlink-p f) f) (file-name-directory
f)))))
(+ (lsh (car (nth 5 attr)) 16)
(cadr (nth 5 attr)))))
- [O] [PATCH] Fix for relative symlinks in subdirectories,
T.F. Torrey <=