Le mercredi 03 novembre 2021 à 17:19 +0100, Nicolas Goaziou a écrit : > Hello, > > Emmanuel Charpentier <emm.charpent...@free.fr> writes: > > > This (minuscule) patch allows to pass a relative (to the buffer's > > default directory) file name to denote the CSL style file. > > Thank you. However, I'm not sure to understand the purpose of the > patch. > > > Rationale : this allows the use of "one-of" styles for "one-of" > > projects without overloading a defailt CSL style directory (which may > > or may not exist on a given system : think JabRef users...). Also > > useful for hacked CSL files specific to a given project. > > If we expand every relative file name from `default-directory', what > happens to `org-cite-csl-styles-dir'? Your patch makes this variable > useless, doesn't it?
This can be useful to be able, for example, to use a one-off style for a given exporter while keeping a standard one for another exporter (e. g. a one-off exporter for a journal with complicated bibliographic requirement and anorher for a preprint archive of the same paper). > What about using a local `org-cite-csl-styles-dir' instead, using > file-local variables? IMHO, `org-cite-csl-styles-dir' is deemed to be a more-or-less permanent setting (possibly in `.emacs'), whereas allowing a relative filename doesn't need any initial setup. > > + ((and (pred (lambda (x) > > + (let ((fn (expand-file-name x default-directory))) > > + (if (file-exists-p fn) fn nil)))) file) file) > > This pattern returns the relative file name, not the expanded one. It > may not be what you want. >From `expand-file-name' docstring : "expand-file-name is a built-in function in ‘C source code’. (expand-file-name NAME &optional DEFAULT-DIRECTORY) Probably introduced at or before Emacs version 1.6. Convert filename NAME to absolute, and canonicalize it. [ Abridged.. ]" My tests confirmed that. I do not understand how you managed to reach your conclusions... Sincerely, -- Emmanuel Charpentier > > > Regards,