From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WLucJ+tchGGqggEAgWs5BA (envelope-from ) for ; Thu, 04 Nov 2021 23:21:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yPYxI+tchGHwZgAAbx9fmQ (envelope-from ) for ; Thu, 04 Nov 2021 22:21:31 +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 A96831630A for ; Thu, 4 Nov 2021 23:21:30 +0100 (CET) Received: from localhost ([::1]:41576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mil6u-0007mV-SI for larch@yhetil.org; Thu, 04 Nov 2021 18:21:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mil2Q-0008Nk-9V for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 18:16:51 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:35057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mil2M-000824-2T for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 18:16:49 -0400 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 1B43D100002; Thu, 4 Nov 2021 22:16:41 +0000 (UTC) From: Nicolas Goaziou To: Emmanuel Charpentier Subject: Re: [PATCH] c-csl : accept relative CSL filenames References: <923e51a09367741650c05692009e00ae913a28d3.camel@free.fr> <87bl31tdn7.fsf@nicolasgoaziou.fr> <11cf2687ca5444b9cd8e8d0250e20946b387d7cf.camel@free.fr> Date: Thu, 04 Nov 2021 23:16:36 +0100 In-Reply-To: <11cf2687ca5444b9cd8e8d0250e20946b387d7cf.camel@free.fr> (Emmanuel Charpentier's message of "Thu, 04 Nov 2021 17:25:49 +0100") Message-ID: <87bl2zsh17.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.70.178.231; envelope-from=mail@nicolasgoaziou.fr; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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=1636064491; 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; bh=6qf6o+5lgjGXnKtN6Hvb4cDKQxDmTcKKR7K/lVxCOKg=; b=b4s7dG7oo3soUPW8jhu7AaozmRHefRguRzX5pK5Au6N0hSth2ebPqRw6cjD+77OPiuDTwx ZpyQ27jsfLPwoZrzpe2H5eURqR2j08uOEN9ND8F5rS4QCo7c9UkX+3VZy+WxzjxMAi06qD IWJfz2YDPor4iFi8E4X3JhRM5qUwT/NLbkq0VRfQCh+ltOiXaYv4Lgj4mmWAKplwPHKZEf l6LQ1DyaA7KXV3zs9mQHgklbeVa8o5w9O5k3U9AxMedc5LB76N5uznq2nbYA3aAUTwBVk8 jh4BKws9qm3zYE1yFjZniTHt/pmFB3I+lHYpKV31ZYR+W4LjGQg2dVEW+G43mg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636064491; a=rsa-sha256; cv=none; b=Sux3eepz2j0TAb3Asdkcz1Wkpe1Wa6rfJiidrOvQr5btyrp2ztJmusXnUOpxkkqVL/3a/j zupKDJZHDYWlXGzc7kyLyNJRUBZG7DqMXfXODT5gOxMPrc+ZYzOXrcI/zBP4aoJ03QKNOG 1zbiPghTSh4g1zjJHLzI6V6IkjvwN4mLyHvmcpT+PN3r2lLR8mUYFQYrONlBW7ulIBkbhP SIoTyiAJHMdL/3tfxgyCWC7943MR20AVZ3bgMcGMg+owpolhpw/bOtqZLgylyVxcjBYWdP LgubL9V9YUGsDbfPEQKi2ijD5QRNKz2+aVDUL2uQG3uz4rCLEwiNHLUA2uHzBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: A96831630A X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: KoevaNSOGa6h Hello, Emmanuel Charpentier writes: > 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. But your patch blocks any use for `org-cite-csl-styles-dir' (relative file names can always be expanded from `default-directory', the other branches are thus ignored). So it is either, not both. I think there are two ways forward when a relative file name is used: 1. First check `org-cite-csl-styles-dir' and, if it is nil, expand against `default-directory'; 2. Drop `org-cite-csl-styles-dir' and always expand against `default-directory'. What do oc-csl users think about it? >> > +=C2=A0=C2=A0=C2=A0 ((and (pred (lambda (x) >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((fn (expand-file-name x default-directory= ))) >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (file-exists-p fn) fn nil)))) f= ile) file) >>=20 >> This pattern returns the relative file name, not the expanded one. It >> may not be what you want. > > From `expand-file-name' docstring : I'm not commenting about `expand-file-name', but about your `pcase' pattern: (pcase relative-file-name ((and (pred ...) file) file)) IIUC, the above will return `file', which matches `relative-file-name', not the return value from the predicate. Regards, --=20 Nicolas Goaziou