From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KGKHB7iSoWMgewEAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 11:47:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YBh2B7iSoWOCAAAA9RJhRA (envelope-from ) for ; Tue, 20 Dec 2022 11:47:20 +0100 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 AFFE91987F for ; Tue, 20 Dec 2022 11:47:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7a8k-0003Wt-Ee; Tue, 20 Dec 2022 05:46:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7a8h-0003WZ-Hy for emacs-orgmode@gnu.org; Tue, 20 Dec 2022 05:46:28 -0500 Received: from mailer-211-194.hitrost.net ([91.185.211.194]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7a8e-00081m-Va for emacs-orgmode@gnu.org; Tue, 20 Dec 2022 05:46:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:In-reply-to:Subject:Cc:To:From:References:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wXz9fJhnK/lmGUW6mrtz1lCrWtxhpL6t0NXl3fag7IE=; b=coU+COrW8ol3uR1S+cYP/BgnWv IxLiROMXvgZ98hsPaVA6bzShIdLyyHpP41jPPS8vjERa/fHQTMMY0E3iTa4A5nyGGkbYp4m2Ueu3Z cdvW1G1zaxrG02zYpg/5rfhT/UG7ZGUHdJq0GMCRQ+iE0vmfyYP9Wh5DKFRNvJGkojWNaowTloKVZ mNoZbj8ff9ZWObBx62p5uym8RkBqee9WO2Ct17Ej9CEMEkTrPScMYj9micCn6zc0S4pYIdH2ZF9OJ 2Fys3o4h0joc4Li+8z+tVtuS2/CqJubOK8bdKmV/H2NxUxLWR2W6kj+gRHohSimipiCRiYUjm0gWM yO9+Rn6A==; Received: from 84-20-244-215.dynamic.telemach.net ([84.20.244.215] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1p7a8a-00FXNh-1p; Tue, 20 Dec 2022 11:46:20 +0100 References: <87k02njvp6.fsf@christianmoe.com> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: Denis Maier Cc: =?utf-8?Q?Andr=C3=A1s?= Simonyi , "emacs-orgmode@gnu.org" Subject: Re: Org-cite (oc-csl) tip: Filtering bibliography for language In-reply-to: Date: Tue, 20 Dec 2022 11:46:19 +0100 Message-ID: <87fsdajqtg.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-GeoIP: Country [IP], SI [84.20.244.215] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.194; envelope-from=mail@christianmoe.com; helo=mailer-211-194.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=coU+COrW; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671533239; a=rsa-sha256; cv=none; b=oa3aiM2VVHMUDvUX4a2nHA8oIzv/lyO0RRt+qDUcKNHxhR1U1evJkW6n+JuDgfekXzH9gS 7eC9p6ypEBaAeYkyT7u2T+oJdwRf0Wc6GNZZdW5tthBSeZ1QKh1fcMgrux6Xki/70b1QS/ otzyNq3gBswm+vq8pFI6efepQDtT0Ts73dExedXvE99lhNmxuCSgurHdsc4twoVCsdyh9A ro36prQk9vAfeRblDFiTlq+gKBjApgr0pnRtQtkqUjF8uRdZ/N85KJZjgctnGqtFMrVdJK h31KdvYN1aTP3jQUqjZQGVtKYKkEmAghLUEs6lbK7TCBVNzKP6JfVstsxMcIeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671533239; 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=wXz9fJhnK/lmGUW6mrtz1lCrWtxhpL6t0NXl3fag7IE=; b=pYVONdOou55vE2sJP/O8dvj7oS80DuzpoNNMJagK8Vpq6ffm8bvt3Cohj57XT5OJ/+g+9Z 0FxSYxSFRVV33sEKXCmHvIsqaJhIMCRt/ilBV78SonD7bi3V2/TCa3sM3su9d7+KPzvU8W glcyUtsrcBkPMmZ+gAky2kcKLYd+KcAS5X43GRDGj5bQJ6HLw7FLcBNzSxBOlNuBr5m/18 6+mr0eRSZuh4NuF657QlHlDvfFDpbm2XZWzkpw0lO7ihu1mbTf0pjjhlWLL4vCWF9Kf1Xs E0Mtn4ZhNoHn01T3HFkTeTXNJL25dE5X5W0HsfD8d8juSI07bYvLXA6/8j/nCQ== Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=coU+COrW; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -2.79 X-Spam-Score: -2.79 X-Migadu-Queue-Id: AFFE91987F X-TUID: xunoJW6DBNJT Denis Maier writes: > Am 19.12.2022 um 23:20 schrieb Andr=C3=A1s Simonyi: >> ... I've forgotten to add that another (probably more user friendly) >> option would be to design and implement some kind of filtering DSL. >> Andr=C3=A1s >> On Mon, 19 Dec 2022 at 23:05, Andr=C3=A1s Simonyi >> wrote: >>> >>> Dear All, >>> >>> On Mon, 19 Dec 2022 at 15:49, Christian Moe wro= te: >>> >>>> Refinements welcome. I'm especially wondering what would be an elegant >>>> way to generalize this for more languages without defining a predicate >>>> for each language (given that we cannot pass the language as an >>>> additional argument in the print_bibliography line). >>> >>> Thanks for describing this usage! As for the problem of generalizing >>> to more languages, one relatively simple solution would be to allow >>> arbitrary sexps as filters. Then one could write something like >>> >>> #+print_bibliography: :filter (lambda (item) (bibitem-has-language item= "en"))) >>> >>> Would this type of extension be helpful? One (not necessarily >>> important) consequence would be that filters of this type would be >>> obviously unusable with the biblatex exporter. >>> >>> best wishes, >>> Andr=C3=A1s > > I'd say both options are certainly useful. A filtering DSL is surely > the more user friendly option, but allowing lambda expressions would > probably be quicker to implement, and it would also allow for > predicates not anticipated by DSL designers. > > Best, > Denis Arbitrary sexps would give us more flexibility. Alternately, one could achieve more or less the same by letting :filter collect any additional arguments and pass them as &rest to the user's predicate function, something like: #+PRINT_BIBLIOGRAPHY: :filter bibitem-lang-p nb nn no :type article (This perhaps makes for cleaner solutions. And it is perhaps slightly better from a security viewpoint: I hope for a bright future of collaborative authoring in Org, so I'm wary of proliferating ways to execute arbitrary elisp that a user might not notice. But we do have such ways already, and it's possible to abuse the above solution as well, so I don't know.) Alternatively, I think there is a case for adding a user-friendly :language property to the print_bibliography keyword. On my bookshelf it vies with primary/secondary sources as the most common criterion for separate bibliographies. I was going to say that this is the only extension I can think of that is needed beside :(not)(csl)type and :(not)keyword, but of course people are sooner or later going to want easy-to-use properties to filter by author, publication date ranges, and probably other criteria I cannot think of right now, so it's a strategic decision for the maintainer(s) if you want to go that way. :-) Yours, Christian