From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aFUKJOEJhGHNrgAAgWs5BA (envelope-from ) for ; Thu, 04 Nov 2021 17:27:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kBi1H+EJhGGdTAAAB5/wlQ (envelope-from ) for ; Thu, 04 Nov 2021 16:27:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BEE5C20A3D for ; Thu, 4 Nov 2021 17:27:12 +0100 (CET) Received: from localhost ([::1]:34836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mifa2-0002Ol-Uw for larch@yhetil.org; Thu, 04 Nov 2021 12:27:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mifZ4-0002OW-3N for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 12:26:10 -0400 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:38158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mifYr-0003SW-U8 for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 12:26:09 -0400 Received: from [192.168.1.47] (unknown [88.162.223.185]) (Authenticated sender: emm.charpentier@free.fr) by smtp5-g21.free.fr (Postfix) with ESMTPA id 47B855FFAC; Thu, 4 Nov 2021 17:25:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1636043153; bh=qoIHa5EcX+k1ravMux02eLY0yNyLKxC/o51vzQ8Mu58=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=W4BfinDzxWzr1+sSur4zgbF54UGpx3UnNfZilf+rTmlHbNmPkiL8nhU0RW/DcoeRt KkF5qtgnInCv/UkdzXrLaEtig/gKI+uZ6ALzR79O8h5PiMG3FQ9DCZ/tT+4uWuxm/M 7j/CexSHdNxvL04Xx3tmDROTOCV3eOb4GPLwxAoTFZhdE5/HX4jD6YAqp7HvzGAGJl 72aRgJMdmHs9NtF56ekKkGjJd9V2aP0VIE60KIpkI8BQiRSj9a37MnIld3ojKGZw1U 7k0M/2NiyauPnnBLPdP/iKc4G9l8QrYc+E7z34NmugqAuaAHMAlNZJPb1RZXkesPtP fE0ju49X+rryw== Message-ID: <11cf2687ca5444b9cd8e8d0250e20946b387d7cf.camel@free.fr> Subject: Re: [PATCH] c-csl : accept relative CSL filenames From: Emmanuel Charpentier To: Nicolas Goaziou Date: Thu, 04 Nov 2021 17:25:49 +0100 In-Reply-To: <87bl31tdn7.fsf@nicolasgoaziou.fr> References: <923e51a09367741650c05692009e00ae913a28d3.camel@free.fr> <87bl31tdn7.fsf@nicolasgoaziou.fr> Organization: =?ISO-8859-1?Q?Organis=E9?= ? Moi ??? Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.0-2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:e0c:1:1599::14; envelope-from=emm.charpentier@free.fr; helo=smtp5-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636043232; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Jmu4HyFv87EGu5mI5HFF/RW9zN3rsMuls8M9kIi14S8=; b=HkiTgRQ0dxvV+z9ttPf48WJsxWfGTUrheu2JjSlMlPMcoPRhij6GfkcDYgrod9SUX+1j0o yJfr2wGdPpKIAQ/2Apcv1EAqYmJiLIUAESUKsrzVqqKHk6GIvJokm7KZdvwFzxxeu7YTVU de37emaPOZ52tVFLsTwdVmD/P0hk4aHSJ52PJe0acvyO8QxjSDNv+tfMQqnOBMOtz3d9aV ongFYl8Y+/+8bStbPx0Oar0jBtCgpS+5TJNHRXGyr8T1ucrfulEiBz75I+M9MBOgcbfxhg yxZ67wwZ5HsMLn4gincgNAmYBKru99MMHw7m6Q6zshRXKcBYjtoPcc33DLxmbg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636043232; a=rsa-sha256; cv=none; b=DO/PQ7tsnSpZqEjbCRRhuPNxhqiOUAx6aHXvrJgCWRWG6fdpiyYRwhbJcRtCEPJjRIWD/S gYogRDiM3ON+kH230zpB071e6c+By0/OEFAlqFWba74Z80eci1LNJ7LPCsic/zr3wAgbUV isWQGpmES6DhLE7VlZNpiclNVbn5cxXiq602QFEjO/V+/G6TODP9v4MkWu6UtFsdamH2xH eSo+dooYW5gZoxUxAyR0OnpbK+NA9Pt1qC5wiW4O+2flZRUxidlZWRNNHxGzRIwtvm35Ph za3mk8AjJiDgcx66hj1gMp+q8ce08MLre2zGFO2OZoic+IT8NrBc3uxvonzoDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=W4BfinDz; dmarc=pass (policy=none) header.from=free.fr; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=W4BfinDz; dmarc=pass (policy=none) header.from=free.fr; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: BEE5C20A3D X-Spam-Score: -1.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: xBuRwp24d3SV Le mercredi 03 novembre 2021 à 17:19 +0100, Nicolas Goaziou a écrit : > Hello, > > Emmanuel Charpentier 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,