Re: [Orgmode] Proper way to link external files into a project?
On Jul 15, 2009, at 10:35 PM, Andreas Rottmann wrote: Sebastian Rose sebastian_r...@gmx.de writes: Andreas Rottmann a.rottm...@gmx.at writes: 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: First of all: How about hardlinks? I'd rather not use them in this case. Second: See http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php#sec-7.1 That shows how you can share files between projects, simply by pulling them in through a special export project. I use this technique a lot. One advantage is that each project has a complete set of files. The drawbacks are minor for my use-case, but that might vary. But as linking was enough, this approach should be fine. Thanks! I'm now using this approach, and it works well. The only drawback for me is that I have to pollute the included projects' org files with a line like this: #+SETUPFILE: ~/.emacs.d/org-templates/level-2.org IIUC, you don't need to do this. Since you are only linking to these files, you can simply define a project component that will make sure these files will be copied into the correct location. Then use links with relative path, and this should do the trick. The level-dependent setupfiles Sebastian describes in his tutorial are for different purposes. - Carsten Ideally, I'd like to have that information inferred, or at least external to the included projects, as they should not have to know at which location they are used. You don't know about a trick how to get around this? I'd also be willing to write some elisp to that end... Regards, Rotty -- Andreas Rottmann -- http://rotty.yi.org/ ___ 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 ___ 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
Re: [Orgmode] Proper way to link external files into a project?
Sebastian Rose sebastian_r...@gmx.de writes: Andreas Rottmann a.rottm...@gmx.at writes: 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: First of all: How about hardlinks? I'd rather not use them in this case. Second: See http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php#sec-7.1 That shows how you can share files between projects, simply by pulling them in through a special export project. I use this technique a lot. One advantage is that each project has a complete set of files. The drawbacks are minor for my use-case, but that might vary. But as linking was enough, this approach should be fine. Thanks! I'm now using this approach, and it works well. The only drawback for me is that I have to pollute the included projects' org files with a line like this: #+SETUPFILE: ~/.emacs.d/org-templates/level-2.org Ideally, I'd like to have that information inferred, or at least external to the included projects, as they should not have to know at which location they are used. You don't know about a trick how to get around this? I'd also be willing to write some elisp to that end... Regards, Rotty -- Andreas Rottmann -- http://rotty.yi.org/ ___ 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
[Orgmode] Proper way to link external files into a project?
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: 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 -- http://rotty.yi.org/ ___ 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
Re: [Orgmode] Proper way to link external files into a project?
Andreas Rottmann a.rottm...@gmx.at writes: 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: First of all: How about hardlinks? Second: See http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php#sec-7.1 That shows how you can share files between projects, simply by pulling them in through a special export project. I use this technique a lot. One advantage is that each project has a complete set of files. The drawbacks are minor for my use-case, but that might vary. But as linking was enough, this approach should be fine. Sebastian ___ 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