emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Emmanuel Charpentier <emm.charpentier@free.fr>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] c-csl : accept relative CSL filenames
Date: Thu, 04 Nov 2021 17:25:49 +0100	[thread overview]
Message-ID: <11cf2687ca5444b9cd8e8d0250e20946b387d7cf.camel@free.fr> (raw)
In-Reply-To: <87bl31tdn7.fsf@nicolasgoaziou.fr>

Le mercredi 03 novembre 2021 à 17:19 +0100, Nicolas Goaziou a écrit :
> Hello,
> 
> Emmanuel Charpentier <emm.charpentier@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,



  reply	other threads:[~2021-11-04 16:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 18:24 [PATCH] c-csl : accept relative CSL filenames Emmanuel Charpentier
2021-11-03 16:19 ` Nicolas Goaziou
2021-11-04 16:25   ` Emmanuel Charpentier [this message]
2021-11-04 22:16     ` Nicolas Goaziou
2021-11-04 22:36       ` Bruce D'Arcus
2021-11-05 12:18         ` Eric S Fraga
2021-11-05  9:38       ` M. ‘quintus’ Gülker
  -- strict thread matches above, loose matches on Subject: below --
2021-11-05 17:56 Emmanuel Charpentier
2021-11-19 12:54 ` Nicolas Goaziou
2021-11-19 18:10   ` M. ‘quintus’ Gülker
2021-12-10  9:20 ` Nicolas Goaziou
2022-02-18 14:51   ` Kaushal Modi
2022-02-18 18:16     ` Nicolas Goaziou
2022-02-18 19:17       ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11cf2687ca5444b9cd8e8d0250e20946b387d7cf.camel@free.fr \
    --to=emm.charpentier@free.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).