From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Rottmann Subject: Proper way to "link" external files into a project? Date: Tue, 14 Jul 2009 15:52:53 +0200 Message-ID: <87r5wj4bii.fsf@delenn.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQiXo-0005y0-0p for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 09:59:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQiXj-0005rc-Fw for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 09:59:43 -0400 Received: from [199.232.76.173] (port=60609 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQiXj-0005rV-7Z for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 09:59:39 -0400 Received: from mail.gmx.net ([213.165.64.20]:33435) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MQiXi-0001V9-Hr for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 09:59:38 -0400 Received: from delenn.lan (delenn.lan [192.168.1.11]) by nathot.lan (Postfix) with ESMTP id 0AA4C3A672 for ; Tue, 14 Jul 2009 15:52:54 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list --=-=-= Hi! I'd like to include several files into an org-mode project that live outside the project tree. I tried to just symlink them into the appropriate place into my project, and thought that might suffice to get them published correctly, but that doesn't work out, as org-mode doesn't consider the symlink's name, but the "true" filename; for example, I have this: (setq org-publish-project-alist '(("homepage" :base-directory "~/homepage" :base-extension "org" :publishing-directory "~/public_html" ...) ...)) % ls -l ~/homepage/software/SPE.org lrwxrwxrwx 1 rotty rotty 26 Jul 14 15:01 /home/rotty/homepage/software/SPE.org -> /home/rotty/src/spe/README org-mode publishes this as ~/public_html/README.html, while I'd like it to use ~/public_html/software/SPE.html. After playing around with EDebug for a while, I've come up with the following horrible hack, which does what I want, but is nowhere near a general solution: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=+symlink-hack.patch Content-Description: Try to give symlinks \"proper\" treatment diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 38e1c7b..2c42685 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -414,6 +414,9 @@ PUB-DIR is the publishing directory." (init-buf (current-buffer)) (init-point (point)) (init-buf-string (buffer-string)) + ;; dirty hack to allow symlinking; this is likely to + ;; break stuff --rotty + (buffer-file-name filename) export-buf-or-file) ;; run hooks before exporting (run-hooks 'org-publish-before-export-hook) @@ -501,8 +504,8 @@ See `org-publish-org-to' to the list of arguments." (setq tmp-pub-dir (file-name-directory (concat pub-dir - (and (string-match (regexp-quote base-dir) ftname) - (substring ftname (match-end 0)))))) + (and (string-match (regexp-quote base-dir) filename) + (substring filename (match-end 0)))))) (if (listp publishing-function) ;; allow chain of publishing functions (mapc (lambda (f) --=-=-= Is there a "proper" way to do this? Regards, Rotty -- Andreas Rottmann -- --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--