From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: [BUG] bug in org-publish and a (wrong) patch Date: Sun, 26 Jun 2011 20:10:06 +0200 Message-ID: <877h88mpkw.wl%dmaus@ictsoc.de> References: <8052.1302153060@alphaville.dokosmarshall.org> <5365.1302281886@alphaville.usa.hp.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sun_Jun_26_20:10:06_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qatml-0004vh-NR for emacs-orgmode@gnu.org; Sun, 26 Jun 2011 14:10:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qatmf-00015S-T6 for emacs-orgmode@gnu.org; Sun, 26 Jun 2011 14:10:19 -0400 Received: from app1a.xlhost.de ([213.202.242.161]:37819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qatmf-000158-7o for emacs-orgmode@gnu.org; Sun, 26 Jun 2011 14:10:13 -0400 In-Reply-To: <5365.1302281886@alphaville.usa.hp.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: bzg@altern.org, emacs-orgmode@gnu.org, Carsten Dominik --pgp-sign-Multipart_Sun_Jun_26_20:10:06_2011-1 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_26_20:10:06_2011-1" --Multipart_Sun_Jun_26_20:10:06_2011-1 Content-Type: text/plain; charset=US-ASCII At Fri, 08 Apr 2011 12:58:06 -0400, Nick Dokos wrote: > > Carsten Dominik wrote: > > > Hi Nick, > > > > I have not looked closely, but maybe you can use > > > > > > (expand-file-name .... (file-name-directory filename)) > > > > to fix this patch? Not sure, I have not spent any time on it. > > > > Almost but not quite: C-h v expand-file-name says > > ,---- > | (expand-file-name NAME &optional DEFAULT-DIRECTORY) > | > | Convert filename NAME to absolute, and canonicalize it. > | Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative > | (does not start with slash or tilde); if DEFAULT-DIRECTORY is nil or missing, > | the current buffer's value of `default-directory' is used. > `---- > > so you end up tacking it onto a completely unrelated directory (and my > experiments confirm this). > > But there is a :base-directory for the project that could be obtained > from the project-plist and passed to expand-file-name. I think that > would work but would require passing the project-plist down through a couple > of layers to org-publish-cache-ctime-of-src. Alternatively, it (or just > the base directory) could be bound dynamically in org-publish-file and > used in the ctime function. > > What do you think would be preferable? Took some time, but attached patch fixes the problem w/o the need for passing down :base-directory at all. Simply expand-filename only if the symlink is relative; luckily the filename passed to this fun already is absolute. @Bastien: Didn't push because I assume you already started the release process for Org 7.6. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --Multipart_Sun_Jun_26_20:10:06_2011-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-Properly-handle-relative-symlinks-when-publishing.patch" Content-Transfer-Encoding: base64 RnJvbSBmNmVkNGQ1NzA3OTk1ZjM0YTYyNzg4NmQwNjA3ZGQ3ZTYzNDMxNDRiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBNYXVzIDxkbWF1c0BpY3Rzb2MuZGU+CkRhdGU6IFN1 biwgMjYgSnVuIDIwMTEgMjA6MDI6NDIgKzAyMDAKU3ViamVjdDogW1BBVENIXSBQcm9wZXJseSBo YW5kbGUgcmVsYXRpdmUgc3ltbGlua3Mgd2hlbiBwdWJsaXNoaW5nCgoqIG9yZy1wdWJsaXNoLmVs IChvcmctcHVibGlzaC1jYWNoZS1jdG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sCisrKyBiL2xpc3Avb3JnLXB1Ymxpc2guZWwKQEAgLTExNTcsOSArMTE1 NywxMCBAQCBSZXR1cm5zIHZhbHVlIG9uIHN1Y2Nlc3MsIGVsc2UgbmlsLiIKIAogKGRlZnVuIG9y Zy1wdWJsaXNoLWNhY2hlLWN0aW1lLW9mLXNyYyAoZmlsZW5hbWUpCiAgICJHZXQgdGhlIEZJTEVO QU1FIGN0aW1lIGFzIGFuIGludGVnZXIuIgotICAobGV0ICgoc3JjLWF0dHIgKGZpbGUtYXR0cmli dXRlcyAoaWYgKHN0cmluZ3AgKGZpbGUtc3ltbGluay1wIGZpbGVuYW1lKSkKLQkJCQkgICAgICAg KGZpbGUtc3ltbGluay1wIGZpbGVuYW1lKQotCQkJCSAgICAgZmlsZW5hbWUpKSkpCisgIChsZXQq ICgoc3ltbGluay1tYXliZSAob3IgKGZpbGUtc3ltbGluay1wIGZpbGVuYW1lKSBmaWxlbmFtZSkp CisJIChzcmMtYXR0ciAoZmlsZS1hdHRyaWJ1dGVzIChpZiAoZmlsZS1uYW1lLWFic29sdXRlLXAg c3ltbGluay1tYXliZSkKKwkJCQkJc3ltbGluay1tYXliZQorCQkJCSAgICAgIChleHBhbmQtZmls ZS1uYW1lIHN5bWxpbmsgZmlsZW5hbWUpKSkpKQogICAgICgrCiAgICAgIChsc2ggKGNhciAobnRo IDUgc3JjLWF0dHIpKSAxNikKICAgICAgKGNhZHIgKG50aCA1IHNyYy1hdHRyKSkpKSkKLS0gCjEu Ny4yLjUKCg== --Multipart_Sun_Jun_26_20:10:06_2011-1-- --pgp-sign-Multipart_Sun_Jun_26_20:10:06_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk4Hdf4ACgkQma24O1pEeObmaQEA1lJI04ujQmQJbFeDOM/42Iz5 6DPGVG24/6SlUhak1r8A/3K/3Ot6FqkPefnvUBvP/2VXvwpaa2xRpNq2MW/wGvou =RrEi -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sun_Jun_26_20:10:06_2011-1--