From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Using org-export-get-reference for strings Date: Sat, 01 Apr 2017 10:16:29 +0200 Message-ID: <871stco84i.fsf@nicolasgoaziou.fr> References: <87inmq6561.fsf@ofosos.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuED6-0001hu-G5 for emacs-orgmode@gnu.org; Sat, 01 Apr 2017 04:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuED3-0002KK-CU for emacs-orgmode@gnu.org; Sat, 01 Apr 2017 04:16:36 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:37178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cuED3-0002JB-50 for emacs-orgmode@gnu.org; Sat, 01 Apr 2017 04:16:33 -0400 In-Reply-To: <87inmq6561.fsf@ofosos.org> (Mark Meyer's message of "Thu, 30 Mar 2017 19:33:10 +0200") 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" To: Mark Meyer Cc: emacs-orgmode Hello, Mark Meyer writes: > In ox-epub I'm using several references to external stylesheets, > starting with the external name in the user filesystem I transform > these into a kind-of unique id that lives in the EPUB zip file. > > Currently I'm doing this using a counter, generating zip entries in the > form of style-1.css. Can I use `org-export-get-reference' to generate > these ids? I would likely pass a simple string as the object to get a > reference to (the path the external stylesheet lives at). > > From what I understand this would generate different references for > `foobar.css' and `../foobar.css' even when these are identical > documents. This should be fixed by passing `(expand-file-name style)' to > `org-export-get-reference'. > > I'm not quite sure I understand `org-export-get-reference' correctly, > can you elucidate this? `org-export-get-reference' is meant to return a unique identifier for objects in the parse tree. You cannot really use it for strings, as the comparison is done with `eq', unless the strings are part of the parse tree. Regards, -- Nicolas Goaziou