From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cOQhG1DL6mBdOgAAgWs5BA (envelope-from ) for ; Sun, 11 Jul 2021 12:43:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aCDPFlDL6mCmbQAA1q6Kng (envelope-from ) for ; Sun, 11 Jul 2021 10:43:28 +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 79349294EE for ; Sun, 11 Jul 2021 12:43:27 +0200 (CEST) Received: from localhost ([::1]:40268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Wvl-0007Tv-DJ for larch@yhetil.org; Sun, 11 Jul 2021 06:43:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Wph-0007YP-I5 for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 06:37:09 -0400 Received: from ciao.gmane.io ([116.202.254.214]:59500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Wpf-0004Wl-VO for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 06:37:09 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m2Wpe-0000Jd-5O for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 12:37:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: citations: rx problems with emacs-26.3 Date: Sun, 11 Jul 2021 17:36:59 +0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 26 X-Spam_score: 2.6 X-Spam_bar: ++ X-Spam_report: (2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, NML_ADSP_CUSTOM_MED=0.9, 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.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626000208; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8jqWTNzW/xUqQE5VP95IvsuHip+Osua/lM9l0aZv1KQ=; b=bXhKxqoUffnQawj49AOBZmUSgieuKJ+qxZWBC2Nf8xG2uNIinNuGDqAoZfCspa/fOhEsr+ QmFeAOezx6GTEI7IQSQ0xLzaPJDj0Jxv/d8nXaR8zoY9HJQl42eUx9dEsRpKZ8nlAWsG3c JTwD+4QlxtJTC9wS8NwUsj+61ZHGNC3lMcKxkYdGz52Xg0BRcMs7kYkiIWJPETnpG+NqAf T2TAa0mLK10GKV7OBHXX6FsGc0f3S2mPhUOAcBZ/PSkH3Z0FGcoKMJu6D2kZdjFHTyF7gf NVrSg8IMmJXmQus5mVDjH0PuSb772eLxUs0CTK1m0YgCZuTCPnfzbNFvsudEjQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626000208; a=rsa-sha256; cv=none; b=Oj0xh1A0H0FJ4APxTelsph+KGAUqqfyIcNclpG8S0j7WO3UfkZxPrk0naon+sRbJ2VP4qG WD7yQfc9B8CXYUpffWR3SShFypMfK59kuOlnt1ViwslPnxDh8N8bWQLlIiTtbydRe8qwST gIK62qCDjBwhUhN75vdlnwkBg4b+UUSc6garRa1uGjDFbugz6AKlEV78X6xg/h5O0rr4Oo R0hheTZngALcjCLe7C3OERG4if0cya6ryr7C9BiJPGxn85QU9CzmueYttBpgsYr+uEy9Jm 5Qm3qL9tDUkrd+hqKKlk9BcH/8Cn/xB0tUK/WbuV8V57Btp/V5VTcqCgbc1xDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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: -1.81 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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: 79349294EE X-Spam-Score: -1.81 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0joBX8saZhqX I think citation support is a great feature. (Sorry, I do not work with references now, so I can tell nothing concerning implementation for org.) It seems, rx e.g. in emacs-26.3 does not support all features used in oc.el and oc-csl.el. Loading an org file using git master, I get a warning > Eager macro-expansion failure: (error "rx form ‘regexp’ requires args satisfying ‘stringp’") It looks like (rx (regexp ...)) require namely literal, variables are not supported yet. In additional (rx (literal ...)) is not supported as well. > Eager macro-expansion failure: (error "Unknown rx form ‘literal’") In a couple of places `rx-to-string' likely could be used instead of just `rx'. I have no idea yet what could be done with (pcase-let* ((rx ...))) in `org-cite-adjust-note'. > diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el > index 4e9d2e562..2ac601f34 100644 > --- a/lisp/oc-basic.el > +++ b/lisp/oc-basic.el > @@ -656,7 +656,7 @@ present in the citation." > (org-open-file file '(4)) > (if (not (equal "json" (file-name-extension file))) > (bibtex-search-entry key) > - (let ((regexp (rx "\"id\":" (0+ (any "[ \t]")) "\"" (literal key) "\""))) > + (let ((regexp (rx-to-string `(seq "\"id\":" (0+ (any "[ \t]")) "\"" ,key "\"") t))) > (goto-char (point-min)) > (re-search-forward regexp) > (search-backward "{"))))) > diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el > index a7a2a6042..f3c2fd901 100644 > --- a/lisp/oc-csl.el > +++ b/lisp/oc-csl.el > @@ -248,10 +248,10 @@ If nil then the Chicago author-date style is used as a fallback.") > "Alist mapping locator names to locators.") > > (defconst org-cite-csl--label-regexp > - (rx word-start > - (regexp (regexp-opt (mapcar #'car org-cite-csl--label-alist) t)) > - (0+ digit) > - (or word-start line-end (any ?\s ?\t))) > + (rx-to-string `(seq word-start > + (regexp ,(regexp-opt (mapcar #'car org-cite-csl--label-alist) t)) > + (0+ digit) > + (or word-start line-end (any ?\s ?\t))) t) > "Regexp matching a label in a citation reference suffix. > Label is in match group 1.") > > diff --git a/lisp/oc.el b/lisp/oc.el > index 1d704fb03..43a3bb444 100644 > --- a/lisp/oc.el > +++ b/lisp/oc.el > @@ -924,7 +924,7 @@ the same object, call `org-cite-adjust-punctuation' first." > (concat final-punct "\"") previous nil nil 2)) > (new-next > (replace-regexp-in-string > - (rx string-start (literal final-punct)) > + (rx-to-string `(seq string-start ,final-punct) t) > "" next))) > (org-element-set-element previous new-prev) > (org-element-set-element next new-next) Maybe I have missed other similar problems. Does someone have better ideas how to restore compatibility with older emacs versions? 24.3 is declared in org.el. Ubuntu 20.04 (latest long time support release) has 26.3.