From: "Martin Kühl" <martin.kuehl@gmail.com>
To: Emacs-Orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] Improve symlink handling in `org-babel-load-file'
Date: Thu, 4 Feb 2010 12:29:01 +0100 [thread overview]
Message-ID: <c1d5a43d1002040329g8389de4o5ff4bc0f66407883@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
Hi,
when `org-babel-load-file' is called on a symlink, its timestamp code
checks the modification date of the symlink instead of the file it
points to, leading it to skip tangling the source file although its
contents have been modified.
The attached patch fixes this by resolving paths with `file-truename'
before calling `file-attributes'.
Thanks,
Martin
[-- Attachment #2: org-babel-load-file--symlinks.patch --]
[-- Type: application/octet-stream, Size: 720 bytes --]
diff --git a/contrib/babel/lisp/org-babel-tangle.el b/contrib/babel/lisp/org-babel-tangle.el
index 66e2c26..4edab9c 100644
--- a/contrib/babel/lisp/org-babel-tangle.el
+++ b/contrib/babel/lisp/org-babel-tangle.el
@@ -48,7 +48,8 @@ file using `load-file'."
(flet ((age (file)
(time-to-seconds
(time-subtract (current-time)
- (sixth (file-attributes file))))))
+ (sixth (file-attributes
+ (file-truename file)))))))
(let* ((base-name (file-name-sans-extension file))
(exported-file (concat base-name ".el")))
;; tangle if the org-mode file is newer than the elisp file
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next reply other threads:[~2010-02-04 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 11:29 Martin Kühl [this message]
2010-02-04 16:46 ` [PATCH] Improve symlink handling in `org-babel-load-file' Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c1d5a43d1002040329g8389de4o5ff4bc0f66407883@mail.gmail.com \
--to=martin.kuehl@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).