From unknown Mon Jun 23 13:07:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#31132 <31132@debbugs.gnu.org> To: bug#31132 <31132@debbugs.gnu.org> Subject: Status: AUCTeX, RefTeX and biblatex's multicite commands Reply-To: bug#31132 <31132@debbugs.gnu.org> Date: Mon, 23 Jun 2025 20:07:52 +0000 retitle 31132 AUCTeX, RefTeX and biblatex's multicite commands reassign 31132 auctex submitter 31132 gusbrs.2016@gmail.com severity 31132 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 12 02:05:31 2018 Received: (at submit) by debbugs.gnu.org; 12 Apr 2018 06:05:31 +0000 Received: from localhost ([127.0.0.1]:46962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6VMR-0003oG-2V for submit@debbugs.gnu.org; Thu, 12 Apr 2018 02:05:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6PHP-00019W-RT for submit@debbugs.gnu.org; Wed, 11 Apr 2018 19:35:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6PHJ-0006hv-Kc for submit@debbugs.gnu.org; Wed, 11 Apr 2018 19:35:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_40, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f6PHJ-0006hF-HU for submit@debbugs.gnu.org; Wed, 11 Apr 2018 19:35:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6PHI-0005FQ-6A for bug-auctex@gnu.org; Wed, 11 Apr 2018 19:35:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6PHF-0006ef-3x for bug-auctex@gnu.org; Wed, 11 Apr 2018 19:35:48 -0400 Received: from mail-it0-x232.google.com ([2607:f8b0:4001:c0b::232]:51508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6PHE-0006eJ-UR for bug-auctex@gnu.org; Wed, 11 Apr 2018 19:35:45 -0400 Received: by mail-it0-x232.google.com with SMTP id b5-v6so5046188itj.1 for ; Wed, 11 Apr 2018 16:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=bv/Jw+p9SOJQfg6z3GGA1EKlOqiCNYw/zdDx0RJq+TA=; b=AyynaxYPeJW1L1fzm90uS/UX0stzPA6BbYTbzAvU9pMglTFbSrSlsuvP58CxKxkQgF CQgH9Gv1uSbG3c2m/jOAJEClk/cB6KwGloWkkUt1WWf1+3EA2WfzwZ6310FyNQfUBf3r vJkKrkBCIoyBxGPJwRvG/flKkkkAO9dX+0+249E9R+UXpnrfXJqmuTTOfiItdjrlEOAm epOTRGHRlSbjD+bsgiEGqiyXiQVZauYimfDHu8K6Cod42XKP9ZDkAm6JYZijXOn3jzcY fZeryeemVIINNBELzhcr3bphtwfqE5QzP4CUEEqLq2VvMifMQ94CgcfTarWWrTHmbOD8 wh3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:to:message-id:date :user-agent:mime-version:content-transfer-encoding:content-language; bh=bv/Jw+p9SOJQfg6z3GGA1EKlOqiCNYw/zdDx0RJq+TA=; b=iEwVe/I/kNZKyDDmoKvEAaTKvujv/YyCIODnLYh7CH45z3cqpYX5gOHmTAbmiUmpvz k2bYVhqDIjrH47hE4L+eIMDVhyLU/qQGaDwE74YHjizc7mKygq4FKCsB2FvsoeaSGEDc /kJ8a5EqrlzNu80od7PTKOfLk6qkAf9tm2mMjeVseErXreQA0TAA3KrzzyzKcIyHIi8D yrESipvt0d+dErCSfWlZN54AW9CNILrW5osElRsgc/qwoc/W3qPw/xBYViUAWLPJ/caD xNZTnj/yvb5Jscmy3/crH2OTIcWSOlZOYs9FAKaZuivOTwYIGIyqns/d9VOopZZKemKD t9Kw== X-Gm-Message-State: ALQs6tAtgodSLhr5sg2hujOyzmtON9rDa1zgCr6bPOWHd+ZBs2JaN6S1 EiIQr6MbkQoJ4DNPqabIsCd8AlhQ X-Google-Smtp-Source: AIpwx48urkx7lAHnbt2UYCpdiGYWyrO1WNsudmHgNn5JYOSTqEr3J0mFfx8xrT/aTaT05x4zTlDpWA== X-Received: by 2002:a24:2903:: with SMTP id p3-v6mr6159506itp.10.1523489743502; Wed, 11 Apr 2018 16:35:43 -0700 (PDT) Received: from [10.5.14.6] (ip-28-39-52-196.chicago.us.northamericancoax.com. [196.52.39.28]) by smtp.gmail.com with ESMTPSA id y86-v6sm1275168ita.41.2018.04.11.16.35.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 16:35:42 -0700 (PDT) From: gusbrs.2016@gmail.com Subject: AUCTeX, RefTeX and biblatex's multicite commands To: bug-auctex@gnu.org Message-ID: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> Date: Wed, 11 Apr 2018 20:35:39 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 12 Apr 2018 02:05:30 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) From TeX.SX: https://tex.stackexchange.com/q/425883/105447 RefTeX's relations biblatex's multicite commands (such as \parencites, \footcites, \textcites and so on) leave some things to be desired for. Namely, they do not seem to be recognized as citation commands. This results in RefTeX's `reftex-view-crossref` (C-c &) returning "Not on a crossref macro argument". Also, in adding an extra bibkey to an already existing multicite command, it is not possible to access RefTeX's facilities. Arash Esbati generously provided patches at TeX.SX that go a long way in dealing with these problems. However, support for the presence of global optional arguments (between parentheses) is still missing. At their request, I write to report this issue. So, I kindly request that this issue be addressed when opportune. With my warmest thanks for the great software, gusbrs From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 19 15:46:36 2018 Received: (at 31132) by debbugs.gnu.org; 19 Apr 2018 19:46:36 +0000 Received: from localhost ([127.0.0.1]:33217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f9FVr-0002jQ-PN for submit@debbugs.gnu.org; Thu, 19 Apr 2018 15:46:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f9FVp-0002jD-Jl for 31132@debbugs.gnu.org; Thu, 19 Apr 2018 15:46:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9FVf-0002Sz-3t for 31132@debbugs.gnu.org; Thu, 19 Apr 2018 15:46:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9FVe-0002SH-U0; Thu, 19 Apr 2018 15:46:23 -0400 Received: from p4fe3e094.dip0.t-ipconnect.de ([79.227.224.148]:51866 helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1f9FVe-0003FG-Fe; Thu, 19 Apr 2018 15:46:22 -0400 From: Arash Esbati To: gusbrs.2016@gmail.com Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> Date: Thu, 19 Apr 2018 21:45:51 +0200 In-Reply-To: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> (gusbrs's message of "Wed, 11 Apr 2018 20:35:39 -0300") Message-ID: <867ep3q8sw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) gusbrs.2016@gmail.com writes: > From TeX.SX: https://tex.stackexchange.com/q/425883/105447 > > > RefTeX's relations biblatex's multicite commands (such as \parencites, > \footcites, \textcites and so on) leave some things to be desired > for. Namely, they do not seem to be recognized as citation > commands. This results in RefTeX's `reftex-view-crossref` (C-c &) > returning "Not on a crossref macro argument". Also, in adding an extra > bibkey to an already existing multicite command, it is not possible to > access RefTeX's facilities. > > Arash Esbati generously provided patches at TeX.SX that go a long way > in dealing with these problems. However, support for the presence of > global optional arguments (between parentheses) is still missing. At > their request, I write to report this issue. Hi Gusbrs, thanks for the report. I fiddled a little around and I think I have a working setup for this issue. I think with this patch, RefTeX will also recognize referencing commands provided by cleveref.sty. --8<---------------cut here---------------start------------->8--- diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index fd229a6..3f4965a 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -763,7 +763,9 @@ in order to only add another reference in the same cite command." (setq format "%l")) ((and (stringp macro) - (string-match "\\`\\\\cite\\|cite\\'" macro)) + (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" macro)) + ;; Match also commands from biblatex ending with `s' (\cites) or + ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). ;; We are already inside a cite macro (if (or (not arg) (not (listp arg))) (setq format diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el index 74a5e63..b93d05d 100644 --- a/lisp/textmodes/reftex-dcr.el +++ b/lisp/textmodes/reftex-dcr.el @@ -60,10 +60,13 @@ to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'." (setq reftex-call-back-to-this-buffer (current-buffer)) (cond - ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" macro) + ((string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) + ;; Match also commands from biblatex ending with `s' (\cites) or + ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). ;; A citation macro: search for bibitems or BibTeX entries (setq dw (reftex-view-cr-cite arg key auto-how))) - ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro) + ((string-match "\\`\\\\ref\\|ref\\(s\\|range\\)?\\*?\\'" macro) + ;; Match also commands from cleveref ending with `s' (\namecrefs). ;; A reference macro: search for labels (setq dw (reftex-view-cr-ref arg key auto-how))) (auto-how nil) ;; No further action for automatic display (speed) diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 492f546..31e108c 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -788,12 +788,13 @@ move backward to the closing parenthesis of the previous argument. This function understands the splitting of macros over several lines in TeX." (cond - ;; Just to be quick: - ((memq (preceding-char) '(?\] ?\}))) + ;; Just to be quick: biblatex uses () as delimiters for optional + ;; arguments in qualified citation lists. + ((memq (preceding-char) '(?\] ?\) ?\}))) ;; Do a search ((and reftex-allow-detached-macro-args (re-search-backward - "[]}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) + "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) (goto-char (1+ (match-beginning 0))) t) (t nil))) @@ -842,12 +843,22 @@ considered an argument of macro \\macro." (while (and (reftex-move-to-previous-arg bound) (condition-case nil (let ((forward-sexp-function nil)) - (backward-sexp) t) + (if (= (preceding-char) ?\)) + (let ((temp-table (make-syntax-table))) + (modify-syntax-entry ?\( "()" temp-table) + (modify-syntax-entry ?\) ")(" temp-table) + (with-syntax-table temp-table + (backward-sexp))) + (backward-sexp)) + t) (error nil))) - (if (eq (following-char) ?\[) (cl-incf cnt-opt)) + (if (or (eq (following-char) ?\[) + (eq (following-char) ?\()) + (cl-incf cnt-opt)) (cl-incf cnt)) (setq pos (point)) (when (and (or (= (following-char) ?\[) + (= (following-char) ?\() (= (following-char) ?\{)) (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) (setq cmd (reftex-match-string 0)) --8<---------------cut here---------------end--------------->8--- One thing I don't understand is why (backward-sexp) doesn't work on (Global Pre) arguments. Maybe somebody can enlighten me. For now, I added a trickery with `with-syntax-table'. Further, I think the functions `reftex-move-over-touching-args' and `reftex-move-to-next-arg' must also be patched in order to support optional arguments in parentheses. My test file for this looks like this. In case somebody wants to try this out, the complete functions are inserted below. Any comments welcome. --8<---------------cut here---------------start------------->8--- \documentclass{article} \begin{filecontents}{biblatex-bib.bib} @book{lamp:94, author = {Leslie Lamport}, title = {LaTeX - {A} Document Preparation System: User's Guide and Reference Manual, Second Edition}, publisher = {Pearson / Prentice Hall}, year = {1994}, isbn = {978-0-201-52983-8}, timestamp = {Fri, 08 Apr 2011 18:21:00 +0200}, } @book{mitt:97, author = {Michel Goossens and Sebastian Rahtz and Frank Mittelbach}, title = {The LaTeX Graphics Companion - Illustrating documents with TeX and PostScript}, series = {Addison-Wesley series on tools and techniques for computer typesetting}, publisher = {Addison-Wesley}, year = {1997}, isbn = {978-0-201-85469-5}, } \end{filecontents} \usepackage[style=authoryear]{biblatex} \addbibresource{biblatex-bib.bib} \begin{document} %% =============== RefTeX standard \cite{mitt:97} ==> \verb|C-c &| Ok, \verb|C-c [| Ok \cites[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} ==> \verb|C-c &| Ok, \verb|C-c [| Ok \footcitetext[Pre][Post]{mitt:97} ==> \verb|C-c &| NOk, \verb|C-c [| NOk \parencite*[Pre][Post]{mitt:97} ==> \verb|C-c &| Ok, \verb|C-c [| NOk \parencites{mitt:97} \parencites(GPre)()[Pre][]{mitt:97}[Pre][]{lamp:94} \parencites(pre)()[pre][]{mitt:97} \parencites(post)[post]{mitt:97} ==> \verb|C-c &| NOk, \verb|C-c [| NOk %% ============== RefTeX patched \parencites[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} ==> \verb|C-c &| Ok, \verb|C-c [| Ok \parencites(Global Pre)(Global Post)[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} ==> \verb|C-c &| Ok, \verb|C-c [| Ok \begin{verbatim} (defun reftex-view-crossref (&optional arg auto-how fail-quietly) "View cross reference of macro at point. Point must be on the KEY argument. When at a `\\ref' macro, show corresponding `\\label' definition, also in external documents (`xr'). When on a label, show a locations where KEY is referenced. Subsequent calls find additional locations. When on a `\\cite', show the associated `\\bibitem' macro or the BibTeX database entry. When on a `\\bibitem', show a `\\cite' macro which uses this KEY. When on an `\\index', show other locations marked by the same index entry. To define additional cross referencing items, use the option `reftex-view-crossref-extra'. See also `reftex-view-crossref-from-bibtex'. With one or two C-u prefixes, enforce rescanning of the document. With argument 2, select the window showing the cross reference. AUTO-HOW is only for the automatic crossref display and is handed through to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'." (interactive "P") ;; See where we are. (let* ((macro (car (reftex-what-macro-safe 1))) (key (reftex-this-word "^{}%\n\r, \t")) dw) (if (or (null macro) (reftex-in-comment)) (or fail-quietly (error "Not on a crossref macro argument")) (setq reftex-call-back-to-this-buffer (current-buffer)) (cond ((string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) ;; Match also commands from biblatex ending with `s' (\cites) or ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). ;; A citation macro: search for bibitems or BibTeX entries (setq dw (reftex-view-cr-cite arg key auto-how))) ((string-match "\\`\\\\ref\\|ref\\(s\\|range\\)?\\*?\\'" macro) ;; Match also commands from cleveref ending with `s' (\namecrefs). ;; A reference macro: search for labels (setq dw (reftex-view-cr-ref arg key auto-how))) (auto-how nil) ;; No further action for automatic display (speed) ((or (equal macro "\\label") (member macro reftex-macros-with-labels)) ;; A label macro: search for reference macros (reftex-access-scan-info arg) (setq dw (reftex-view-regexp-match (format reftex-find-reference-format (regexp-quote key)) 4 nil nil))) ((equal macro "\\bibitem") ;; A bibitem macro: search for citations (reftex-access-scan-info arg) (setq dw (reftex-view-regexp-match (format reftex-find-citation-regexp-format (regexp-quote key)) 4 nil nil))) ((member macro reftex-macros-with-index) (reftex-access-scan-info arg) (setq dw (reftex-view-regexp-match (format reftex-find-index-entry-regexp-format (regexp-quote key)) 3 nil nil))) (t (reftex-access-scan-info arg) (catch 'exit (let ((list reftex-view-crossref-extra) entry mre action group) (while (setq entry (pop list)) (setq mre (car entry) action (nth 1 entry) group (nth 2 entry)) (when (string-match mre macro) (setq dw (reftex-view-regexp-match (format action key) group nil nil)) (throw 'exit t)))) (error "Not on a crossref macro argument")))) (if (and (eq arg 2) (windowp dw)) (select-window dw))))) (defun reftex-figure-out-cite-format (arg &optional no-insert format-key) "Check if there is already a cite command at point and change cite format in order to only add another reference in the same cite command." (let ((macro (car (reftex-what-macro 1))) (cite-format-value (reftex-get-cite-format)) key format) (cond (no-insert ;; Format does not really matter because nothing will be inserted. (setq format "%l")) ((and (stringp macro) (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" macro)) ;; Match also commands from biblatex ending with `s' (\cites) or ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). ;; We are already inside a cite macro (if (or (not arg) (not (listp arg))) (setq format (concat (if (member (preceding-char) '(?\{ ?,)) "" reftex-cite-key-separator) "%l" (if (member (following-char) '(?\} ?,)) "" reftex-cite-key-separator))) (setq format "%l"))) (t ;; Figure out the correct format (setq format (if (and (symbolp cite-format-value) (assq cite-format-value reftex-cite-format-builtin)) (nth 2 (assq cite-format-value reftex-cite-format-builtin)) cite-format-value)) (when (listp format) (setq key (or format-key (reftex-select-with-char "" (concat "SELECT A CITATION FORMAT\n\n" (mapconcat (lambda (x) (format "[%c] %s %s" (car x) (if (> (car x) 31) " " "") (cdr x))) format "\n"))))) (if (assq key format) (setq format (cdr (assq key format))) (error "No citation format associated with key `%c'" key))))) format)) (defun reftex-move-to-previous-arg (&optional bound) "Assuming that we are in front of a macro argument, move backward to the closing parenthesis of the previous argument. This function understands the splitting of macros over several lines in TeX." (cond ;; Just to be quick: biblatex uses () as delimiters for optional ;; arguments in qualified citation lists. ((memq (preceding-char) '(?\] ?\) ?\}))) ;; Do a search ((and reftex-allow-detached-macro-args (re-search-backward "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) (goto-char (1+ (match-beginning 0))) t) (t nil))) (defun reftex-what-macro (which &optional bound) "Find out if point is within the arguments of any TeX-macro. The return value is either (\"\\macro\" . (point)) or a list of them. If WHICH is nil, immediately return nil. If WHICH is 1, return innermost enclosing macro. If WHICH is t, return list of all macros enclosing point. If WHICH is a list of macros, look only for those macros and return the name of the first macro in this list found to enclose point. If the optional BOUND is an integer, bound backwards directed searches to this point. If it is nil, limit to nearest \\section - like statement. This function is pretty stable, but can be fooled if the text contains things like \\macro{aa}{bb} where \\macro is defined to take only one argument. As RefTeX cannot know this, the string \"bb\" would still be considered an argument of macro \\macro." (unless reftex-section-regexp (reftex-compile-variables)) (catch 'exit (if (null which) (throw 'exit nil)) (let ((bound (or bound (save-excursion (re-search-backward reftex-section-regexp nil 1) (point)))) pos cmd-list cmd cnt cnt-opt entry) (save-restriction (save-excursion (narrow-to-region (max (point-min) bound) (point-max)) ;; move back out of the current parenthesis (while (condition-case nil (let ((forward-sexp-function nil)) (up-list -1) t) (error nil)) (setq cnt 1 cnt-opt 0) ;; move back over any touching sexps (while (and (reftex-move-to-previous-arg bound) (condition-case nil (let ((forward-sexp-function nil)) (if (= (preceding-char) ?\)) (let ((temp-table (make-syntax-table))) (modify-syntax-entry ?\( "()" temp-table) (modify-syntax-entry ?\) ")(" temp-table) (with-syntax-table temp-table (backward-sexp))) (backward-sexp)) t) (error nil))) (if (or (eq (following-char) ?\[) (eq (following-char) ?\()) (cl-incf cnt-opt)) (cl-incf cnt)) (setq pos (point)) (when (and (or (= (following-char) ?\[) (= (following-char) ?\() (= (following-char) ?\{)) (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) (setq cmd (reftex-match-string 0)) (when (looking-at "\\\\begin{[^}]*}") (setq cmd (reftex-match-string 0) cnt (1- cnt))) ;; This does ignore optional arguments. Very hard to fix. (when (setq entry (assoc cmd reftex-env-or-mac-alist)) (if (> cnt (or (nth 4 entry) 100)) (setq cmd nil))) (cond ((null cmd)) ((eq t which) (push (cons cmd (point)) cmd-list)) ((or (eq 1 which) (member cmd which)) (throw 'exit (cons cmd (point)))))) (goto-char pos))) (nreverse cmd-list))))) \end{verbatim} \end{document} --8<---------------cut here---------------end--------------->8--- Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 20:29:29 2018 Received: (at 31132) by debbugs.gnu.org; 22 Apr 2018 00:29:29 +0000 Received: from localhost ([127.0.0.1]:35252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fA2si-0000Es-7R for submit@debbugs.gnu.org; Sat, 21 Apr 2018 20:29:29 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:46212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fA2sf-0000Ef-3q for 31132@debbugs.gnu.org; Sat, 21 Apr 2018 20:29:26 -0400 Received: by mail-pg0-f51.google.com with SMTP id t12so5848211pgp.13 for <31132@debbugs.gnu.org>; Sat, 21 Apr 2018 17:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=NrB8gHEd/DvexQOnGbUMar7WL/I9KWhdGwk61vKBzdA=; b=GEvMbUSi+Cxb5m2aXdGvjFlkwcZ7BodVbA/3mBSlNb8+6xUy0qXBcQUXYZJWexPi/i Hxjl8ovm2uPBrpUjZA/7D+xNE5IM6VB4cRn1XEv9W+L2J+QSx7s/a4sHb5pEp97oKD5T GHXLu5w/se4RmEhQhOgs2ccK8BaY59FVSDSgOfBUQmlS8HY4E32kwYQ9L3U04DiXurtI CgMVjKQ7vlKGtkO0GrqImISXsMhBxJvq9QZkbF4QwlKvM1tnHONvaGJeTn79wpyUjAl4 g3B16HJEioQFK5v61OGLzp43ggOwJ9GzVLHDmzL1z1b3oGcsZP7ZRlVnIDvQlb2F1QaJ hXCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=NrB8gHEd/DvexQOnGbUMar7WL/I9KWhdGwk61vKBzdA=; b=AYupmyxFOzld17lru8Ngvx2i3b0a5GLgtLPaGx2z9/KRSkUEtz5RL5uvrwEH1sFjLZ VR3SAvsAzyEMKokjhzyr9OwlxItZVufZfP7CUDMOwJvIt95D4Clbf/Sy/6mBRETiNrZe CJokOYFrDgcn+2QggkIvyHkI1q9LGcoim08YG7c5Pu46A1uyWEmlm7nCWioRfcggaah7 uRIvYWfs3tXe4OrdwdyXTPD01WeWykzAaYXWQiy0WiHyXskBaVFxKAvoGvWlyRwIbGy2 uNh5I2XyEFGjbs5rPhEvWFSGl4fNM1J92O3/8SNIfC9xRKPsRmOZQVXHB2GVuySM6ONq eicQ== X-Gm-Message-State: ALQs6tDJq06N6C/m8Huw9gTsq1hLtyG55ZsIdIZJlMevvqyLxSsIC39t SEGfgk6p5id0V2RC4siFJJ+dSfOr X-Google-Smtp-Source: AIpwx48GG7LiS5JOMeu1o5MYRacdmRSdV/Erk1EXp5fHHD+dhpYi3TEjF9Tq2vuuVTEr9Gy8dasTwQ== X-Received: by 10.98.165.8 with SMTP id v8mr14542530pfm.225.1524356958683; Sat, 21 Apr 2018 17:29:18 -0700 (PDT) Received: from [10.13.10.6] (ip-97-228-239-173.router.siliconvalleywifi.com. [173.239.228.97]) by smtp.gmail.com with ESMTPSA id 27sm18734870pfo.137.2018.04.21.17.29.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Apr 2018 17:29:17 -0700 (PDT) Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands To: Arash Esbati References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> From: Gustavo Barros Message-ID: <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Sat, 21 Apr 2018 21:29:13 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <867ep3q8sw.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Arash, thank you very much for the patches. They are really appreciated. And sorry for the delay in reporting back. I didn't have the time these last couple of days to look at this with due care. I've performed some tests with the patches you sent on the full set of biblatex's citation commands, and can gladly report that both "C-c &" (reftex-view-crossref) and "C-c [" (reftex-citation) (when issued on the key of an existing citation command) work flawlessly on all of them. But, in performing the tests, I observed some other things associated with biblatex's citation commands (some related to this issue, some not) that I might as well report too, in the hope they will be useful. As a regular biblatex user, I consider them minor. 1 - The multicite variants of 'volcite' are neither fontified nor call RefTeX when inserted (with "C-c RET"). They are inserted "plain" but, once inserted, "C-c [" will work on them. They are the following: -volcites -Volcites -pvolcites -Pvolcites -fvolcites -Fvolcites -svolcites -Svolcites -tvolcites -Tvolcites -avolcites -Avolcites 2 - A couple of 'volcite' variants are fontified, but don't call RefTeX when inserted: -pvolcite -ftvolcite 3 - One command is not fontified: -footfullcite 4 - 'mcite'-like citation commands are neither fontified, nor call RefTeX when inserted: -mcite -Mcite -mparencite -Mparencite -mfootcite -mfootcitetext -mtextcite -Mtextcite I can report something else too. In the last couple of weeks, for all the critical issues for my regular workflow with LaTeX I found my way around with Emacs, so I think the "potential deal breakers" are overcome. Even though I'm clearly still in the steep part of the learning curve with Emacs, I do believe I've been hooked. Still struggling, but already bewitched. :) So I'm looking forward to sticking around. Thank you very much once again. Best, gusbrs PS: The test file used was the following: \documentclass{article} \begin{filecontents}{biblatex-bib.bib} @book{lamp:94,   author    = {Leslie Lamport},   title     = {LaTeX - {A} Document Preparation System: User's Guide                and Reference Manual, Second Edition},   publisher = {Pearson / Prentice Hall},   year      = {1994},   isbn      = {978-0-201-52983-8},   timestamp = {Fri, 08 Apr 2011 18:21:00 +0200}, } @book{mitt:97,   author    = {Michel Goossens and                Sebastian Rahtz and                Frank Mittelbach},   title     = {The LaTeX Graphics Companion - Illustrating documents                with TeX and PostScript},   series    = {Addison-Wesley series on tools and techniques                for computer typesetting},   publisher = {Addison-Wesley},   year      = {1997},   isbn      = {978-0-201-85469-5}, } \end{filecontents} \usepackage[style=authoryear, natbib=true, mcite=true]{biblatex} \addbibresource{biblatex-bib.bib} \begin{document} % Standard commands \cite[pre][pos]{mitt:97} \Cite[pre][pos]{lamp:94} \parencite[pre][pos]{mitt:97} \Parencite[pre][pos]{lamp:94} \footcite[pre][pos]{mitt:97} \footcitetext[pre][pos]{lamp:94} % Style specific commands \textcite[pre][pos]{mitt:97} \Textcite[pre][pos]{lamp:94,} \smartcite[pre][pos]{mitt:97} \Smartcite[pre][pos]{lamp:94} \cite*[pre][pos]{mitt:97} \parencite*[pre][pos]{lamp:94} % \supercite{mitt:97} % Qualified citation lists \cites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94}[pre][pos]{lamp:94} \Cites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \parencites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \Parencites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \footcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \footcitetexts(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \smartcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \Smartcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \textcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \Textcites(gpre)(gpos)[pre][pos]{lamp:94}[pre][pos]{mitt:97} % \supercites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} % Style independent commands \autocite[pre][pos]{mitt:97} \Autocite[pre][pos]{lamp:94} \autocite*[pre][pos]{mitt:97} \Autocite*[pre][pos]{lamp:94} \autocites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} \Autocites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} % Text commands \citeauthor[pre][pos]{mitt:97} \citeauthor*[pre][pos]{mitt:97} \Citeauthor[pre][pos]{lamp:94} \Citeauthor*[pre][pos]{lamp:94} \citetitle[pre][pos]{mitt:97,lamp:94} \citetitle*[pre][pos]{lamp:94} \citeyear[pre][pos]{mitt:97} \citeyear*[pre][pos]{lamp:94} \citedate[pre][pos]{mitt:97} \citedate*[pre][pos]{lamp:94} \citeurl[pre][pos]{mitt:97} % Special commands \nocite{mitt:97} \fullcite[pre][pos]{lamp:94} \footfullcite[pre][pos]{mitt:97} \volcite[pre]{2}[pg]{mitt:97} \Volcite[pre]{1}[pg]{lamp:94} \volcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} \Volcites(gpre)(gpos)[pre]{2}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} \pvolcite[pre]{1}[pg]{lamp:94} \Pvolcite[pre]{2}[pg]{mitt:97} \pvolcites(gpre)(gpos)[pre]{1}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} \Pvolcites(gpre)(gpos)[pre]{3}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} \fvolcite[pre]{3}[pg]{lamp:94} \ftvolcite[pre]{3}[pg]{lamp:94} \fvolcites(gpre)(gpos)[pre]{3}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} \Fvolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{3}[pg]{mitt:97} \svolcite[pre]{2}[pg]{lamp:94} \Svolcite[pre]{4}[pg]{mitt:97} \svolcites(gpre)(gpos)[pre]{3}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} \Svolcites(gpre)(gpos)[pre]{3}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} \tvolcite[pre]{5}[pg]{mitt:97} \Tvolcite[pre]{2}[pg]{lamp:94} \tvolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{3}[pg]{mitt:97} \Tvolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{3}[pg]{mitt:97} \avolcite[pre]{3}[pg]{lamp:94} \Avolcite[pre]{1}[pg]{mitt:97} \avolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} \Avolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} \notecite[pre][pos]{lamp:94} \Notecite[pre][pos]{mitt:97} \pnotecite[pre][pos]{mitt:97} \Pnotecite[pre][pos]{lamp:94} \fnotecite[pre][pos]{lamp:94} % Low-level commands \citename[pre][pos]{lamp:94}{author} \citelist[pre][pos]{lamp:94}{publisher} \citefield[pre][pos]{lamp:94}{isbn} % natbib compatibility commands \citet[pre][pos]{mitt:97} \citet*[pre][pos]{lamp:94} \citep[pre][pos]{lamp:94} \citep*[pre][pos]{mitt:97} \citealt[pre][pos]{lamp:94} \citealt*[pre][pos]{mitt:97} \citealp[pre][pos]{mitt:97} \citealp*[pre][pos]{lamp:94} \Citet[pre][pos]{lamp:94} \Citet*[pre][pos]{mitt:97} \Citep[pre][pos]{lamp:94} \Citep*[pre][pos]{mitt:97} % mcite-like citation commands \mcite[pre][pos]{lamp:94,mitt:97} \Mcite[pre][pos]{mitt:97,lamp:94} \mparencite[pre][pos]{lamp:94,mitt:97} \Mparencite[pre][pos]{lamp:94,mitt:97} \mfootcite[pre][pos]{lamp:94,mitt:97} \mfootcitetext[pre][pos]{lamp:94,mitt:97} \mtextcite[pre][pos]{lamp:94,mitt:97} \Mtextcite[pre][pos]{lamp:94,mitt:97} % \msupercite[pre][pos]{lamp:94,mitt:97} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: On 19/04/18 16:45, Arash Esbati wrote: > gusbrs.2016@gmail.com writes: > >> From TeX.SX: https://tex.stackexchange.com/q/425883/105447 >> >> >> RefTeX's relations biblatex's multicite commands (such as \parencites, >> \footcites, \textcites and so on) leave some things to be desired >> for. Namely, they do not seem to be recognized as citation >> commands. This results in RefTeX's `reftex-view-crossref` (C-c &) >> returning "Not on a crossref macro argument". Also, in adding an extra >> bibkey to an already existing multicite command, it is not possible to >> access RefTeX's facilities. >> >> Arash Esbati generously provided patches at TeX.SX that go a long way >> in dealing with these problems. However, support for the presence of >> global optional arguments (between parentheses) is still missing. At >> their request, I write to report this issue. > Hi Gusbrs, > > thanks for the report. I fiddled a little around and I think I have a > working setup for this issue. I think with this patch, RefTeX will also > recognize referencing commands provided by cleveref.sty. > > --8<---------------cut here---------------start------------->8--- > diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el > index fd229a6..3f4965a 100644 > --- a/lisp/textmodes/reftex-cite.el > +++ b/lisp/textmodes/reftex-cite.el > @@ -763,7 +763,9 @@ in order to only add another reference in the same cite command." > (setq format "%l")) > > ((and (stringp macro) > - (string-match "\\`\\\\cite\\|cite\\'" macro)) > + (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" macro)) > + ;; Match also commands from biblatex ending with `s' (\cites) or > + ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). > ;; We are already inside a cite macro > (if (or (not arg) (not (listp arg))) > (setq format > diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el > index 74a5e63..b93d05d 100644 > --- a/lisp/textmodes/reftex-dcr.el > +++ b/lisp/textmodes/reftex-dcr.el > @@ -60,10 +60,13 @@ to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'." > (setq reftex-call-back-to-this-buffer (current-buffer)) > > (cond > - ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" macro) > + ((string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) > + ;; Match also commands from biblatex ending with `s' (\cites) or > + ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). > ;; A citation macro: search for bibitems or BibTeX entries > (setq dw (reftex-view-cr-cite arg key auto-how))) > - ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro) > + ((string-match "\\`\\\\ref\\|ref\\(s\\|range\\)?\\*?\\'" macro) > + ;; Match also commands from cleveref ending with `s' (\namecrefs). > ;; A reference macro: search for labels > (setq dw (reftex-view-cr-ref arg key auto-how))) > (auto-how nil) ;; No further action for automatic display (speed) > diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el > index 492f546..31e108c 100644 > --- a/lisp/textmodes/reftex-parse.el > +++ b/lisp/textmodes/reftex-parse.el > @@ -788,12 +788,13 @@ move backward to the closing parenthesis of the previous argument. > This function understands the splitting of macros over several lines > in TeX." > (cond > - ;; Just to be quick: > - ((memq (preceding-char) '(?\] ?\}))) > + ;; Just to be quick: biblatex uses () as delimiters for optional > + ;; arguments in qualified citation lists. > + ((memq (preceding-char) '(?\] ?\) ?\}))) > ;; Do a search > ((and reftex-allow-detached-macro-args > (re-search-backward > - "[]}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) > + "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) > (goto-char (1+ (match-beginning 0))) > t) > (t nil))) > @@ -842,12 +843,22 @@ considered an argument of macro \\macro." > (while (and (reftex-move-to-previous-arg bound) > (condition-case nil > (let ((forward-sexp-function nil)) > - (backward-sexp) t) > + (if (= (preceding-char) ?\)) > + (let ((temp-table (make-syntax-table))) > + (modify-syntax-entry ?\( "()" temp-table) > + (modify-syntax-entry ?\) ")(" temp-table) > + (with-syntax-table temp-table > + (backward-sexp))) > + (backward-sexp)) > + t) > (error nil))) > - (if (eq (following-char) ?\[) (cl-incf cnt-opt)) > + (if (or (eq (following-char) ?\[) > + (eq (following-char) ?\()) > + (cl-incf cnt-opt)) > (cl-incf cnt)) > (setq pos (point)) > (when (and (or (= (following-char) ?\[) > + (= (following-char) ?\() > (= (following-char) ?\{)) > (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) > (setq cmd (reftex-match-string 0)) > --8<---------------cut here---------------end--------------->8--- > > One thing I don't understand is why (backward-sexp) doesn't work on > (Global Pre) arguments. Maybe somebody can enlighten me. For now, I > added a trickery with `with-syntax-table'. > > Further, I think the functions `reftex-move-over-touching-args' and > `reftex-move-to-next-arg' must also be patched in order to support > optional arguments in parentheses. > > My test file for this looks like this. In case somebody wants to try > this out, the complete functions are inserted below. Any comments > welcome. > > > --8<---------------cut here---------------start------------->8--- > \documentclass{article} > > \begin{filecontents}{biblatex-bib.bib} > @book{lamp:94, > author = {Leslie Lamport}, > title = {LaTeX - {A} Document Preparation System: User's Guide > and Reference Manual, Second Edition}, > publisher = {Pearson / Prentice Hall}, > year = {1994}, > isbn = {978-0-201-52983-8}, > timestamp = {Fri, 08 Apr 2011 18:21:00 +0200}, > } > > @book{mitt:97, > author = {Michel Goossens and > Sebastian Rahtz and > Frank Mittelbach}, > title = {The LaTeX Graphics Companion - Illustrating documents > with TeX and PostScript}, > series = {Addison-Wesley series on tools and techniques > for computer typesetting}, > publisher = {Addison-Wesley}, > year = {1997}, > isbn = {978-0-201-85469-5}, > } > \end{filecontents} > > \usepackage[style=authoryear]{biblatex} > > \addbibresource{biblatex-bib.bib} > > \begin{document} > > %% =============== RefTeX standard > > \cite{mitt:97} > ==> \verb|C-c &| Ok, \verb|C-c [| Ok > > \cites[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} > ==> \verb|C-c &| Ok, \verb|C-c [| Ok > > \footcitetext[Pre][Post]{mitt:97} > ==> \verb|C-c &| NOk, \verb|C-c [| NOk > > \parencite*[Pre][Post]{mitt:97} > ==> \verb|C-c &| Ok, \verb|C-c [| NOk > > \parencites{mitt:97} > \parencites(GPre)()[Pre][]{mitt:97}[Pre][]{lamp:94} > \parencites(pre)()[pre][]{mitt:97} > \parencites(post)[post]{mitt:97} > ==> \verb|C-c &| NOk, \verb|C-c [| NOk > > %% ============== RefTeX patched > > \parencites[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} > ==> \verb|C-c &| Ok, \verb|C-c [| Ok > > \parencites(Global Pre)(Global Post)[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} > ==> \verb|C-c &| Ok, \verb|C-c [| Ok > > > \begin{verbatim} > (defun reftex-view-crossref (&optional arg auto-how fail-quietly) > "View cross reference of macro at point. Point must be on the KEY > argument. When at a `\\ref' macro, show corresponding `\\label' > definition, also in external documents (`xr'). When on a label, show > a locations where KEY is referenced. Subsequent calls find additional > locations. When on a `\\cite', show the associated `\\bibitem' macro or > the BibTeX database entry. When on a `\\bibitem', show a `\\cite' macro > which uses this KEY. When on an `\\index', show other locations marked > by the same index entry. > To define additional cross referencing items, use the option > `reftex-view-crossref-extra'. See also `reftex-view-crossref-from-bibtex'. > With one or two C-u prefixes, enforce rescanning of the document. > With argument 2, select the window showing the cross reference. > AUTO-HOW is only for the automatic crossref display and is handed through > to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'." > > (interactive "P") > ;; See where we are. > (let* ((macro (car (reftex-what-macro-safe 1))) > (key (reftex-this-word "^{}%\n\r, \t")) > dw) > > (if (or (null macro) (reftex-in-comment)) > (or fail-quietly > (error "Not on a crossref macro argument")) > > (setq reftex-call-back-to-this-buffer (current-buffer)) > > (cond > ((string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) > ;; Match also commands from biblatex ending with `s' (\cites) or > ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). > ;; A citation macro: search for bibitems or BibTeX entries > (setq dw (reftex-view-cr-cite arg key auto-how))) > ((string-match "\\`\\\\ref\\|ref\\(s\\|range\\)?\\*?\\'" macro) > ;; Match also commands from cleveref ending with `s' (\namecrefs). > ;; A reference macro: search for labels > (setq dw (reftex-view-cr-ref arg key auto-how))) > (auto-how nil) ;; No further action for automatic display (speed) > ((or (equal macro "\\label") > (member macro reftex-macros-with-labels)) > ;; A label macro: search for reference macros > (reftex-access-scan-info arg) > (setq dw (reftex-view-regexp-match > (format reftex-find-reference-format (regexp-quote key)) > 4 nil nil))) > ((equal macro "\\bibitem") > ;; A bibitem macro: search for citations > (reftex-access-scan-info arg) > (setq dw (reftex-view-regexp-match > (format reftex-find-citation-regexp-format (regexp-quote key)) > 4 nil nil))) > ((member macro reftex-macros-with-index) > (reftex-access-scan-info arg) > (setq dw (reftex-view-regexp-match > (format reftex-find-index-entry-regexp-format > (regexp-quote key)) > 3 nil nil))) > (t > (reftex-access-scan-info arg) > (catch 'exit > (let ((list reftex-view-crossref-extra) > entry mre action group) > (while (setq entry (pop list)) > (setq mre (car entry) > action (nth 1 entry) > group (nth 2 entry)) > (when (string-match mre macro) > (setq dw (reftex-view-regexp-match > (format action key) group nil nil)) > (throw 'exit t)))) > (error "Not on a crossref macro argument")))) > (if (and (eq arg 2) (windowp dw)) (select-window dw))))) > > (defun reftex-figure-out-cite-format (arg &optional no-insert format-key) > "Check if there is already a cite command at point and change cite format > in order to only add another reference in the same cite command." > (let ((macro (car (reftex-what-macro 1))) > (cite-format-value (reftex-get-cite-format)) > key format) > (cond > (no-insert > ;; Format does not really matter because nothing will be inserted. > (setq format "%l")) > > ((and (stringp macro) > (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" macro)) > ;; Match also commands from biblatex ending with `s' (\cites) or > ;; `*' (\parencite*) and `texts?' (\footcitetext and \footcitetexts). > ;; We are already inside a cite macro > (if (or (not arg) (not (listp arg))) > (setq format > (concat > (if (member (preceding-char) '(?\{ ?,)) > "" > reftex-cite-key-separator) > "%l" > (if (member (following-char) '(?\} ?,)) > "" > reftex-cite-key-separator))) > (setq format "%l"))) > (t > ;; Figure out the correct format > (setq format > (if (and (symbolp cite-format-value) > (assq cite-format-value reftex-cite-format-builtin)) > (nth 2 (assq cite-format-value reftex-cite-format-builtin)) > cite-format-value)) > (when (listp format) > (setq key > (or format-key > (reftex-select-with-char > "" (concat "SELECT A CITATION FORMAT\n\n" > (mapconcat > (lambda (x) > (format "[%c] %s %s" (car x) > (if (> (car x) 31) " " "") > (cdr x))) > format "\n"))))) > (if (assq key format) > (setq format (cdr (assq key format))) > (error "No citation format associated with key `%c'" key))))) > format)) > > (defun reftex-move-to-previous-arg (&optional bound) > "Assuming that we are in front of a macro argument, > move backward to the closing parenthesis of the previous argument. > This function understands the splitting of macros over several lines > in TeX." > (cond > ;; Just to be quick: biblatex uses () as delimiters for optional > ;; arguments in qualified citation lists. > ((memq (preceding-char) '(?\] ?\) ?\}))) > ;; Do a search > ((and reftex-allow-detached-macro-args > (re-search-backward > "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) > (goto-char (1+ (match-beginning 0))) > t) > (t nil))) > > > (defun reftex-what-macro (which &optional bound) > "Find out if point is within the arguments of any TeX-macro. > The return value is either (\"\\macro\" . (point)) or a list of them. > > If WHICH is nil, immediately return nil. > If WHICH is 1, return innermost enclosing macro. > If WHICH is t, return list of all macros enclosing point. > If WHICH is a list of macros, look only for those macros and return the > name of the first macro in this list found to enclose point. > If the optional BOUND is an integer, bound backwards directed > searches to this point. If it is nil, limit to nearest \\section - > like statement. > > This function is pretty stable, but can be fooled if the text contains > things like \\macro{aa}{bb} where \\macro is defined to take only one > argument. As RefTeX cannot know this, the string \"bb\" would still be > considered an argument of macro \\macro." > (unless reftex-section-regexp (reftex-compile-variables)) > (catch 'exit > (if (null which) (throw 'exit nil)) > (let ((bound (or bound (save-excursion (re-search-backward > reftex-section-regexp nil 1) > (point)))) > pos cmd-list cmd cnt cnt-opt entry) > (save-restriction > (save-excursion > (narrow-to-region (max (point-min) bound) (point-max)) > ;; move back out of the current parenthesis > (while (condition-case nil > (let ((forward-sexp-function nil)) > (up-list -1) t) > (error nil)) > (setq cnt 1 cnt-opt 0) > ;; move back over any touching sexps > (while (and (reftex-move-to-previous-arg bound) > (condition-case nil > (let ((forward-sexp-function nil)) > (if (= (preceding-char) ?\)) > (let ((temp-table (make-syntax-table))) > (modify-syntax-entry ?\( "()" temp-table) > (modify-syntax-entry ?\) ")(" temp-table) > (with-syntax-table temp-table > (backward-sexp))) > (backward-sexp)) > t) > (error nil))) > (if (or (eq (following-char) ?\[) > (eq (following-char) ?\()) > (cl-incf cnt-opt)) > (cl-incf cnt)) > (setq pos (point)) > (when (and (or (= (following-char) ?\[) > (= (following-char) ?\() > (= (following-char) ?\{)) > (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) > (setq cmd (reftex-match-string 0)) > (when (looking-at "\\\\begin{[^}]*}") > (setq cmd (reftex-match-string 0) > cnt (1- cnt))) > ;; This does ignore optional arguments. Very hard to fix. > (when (setq entry (assoc cmd reftex-env-or-mac-alist)) > (if (> cnt (or (nth 4 entry) 100)) > (setq cmd nil))) > (cond > ((null cmd)) > ((eq t which) > (push (cons cmd (point)) cmd-list)) > ((or (eq 1 which) (member cmd which)) > (throw 'exit (cons cmd (point)))))) > (goto-char pos))) > (nreverse cmd-list))))) > > \end{verbatim} > > \end{document} > > --8<---------------cut here---------------end--------------->8--- > > Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 20:54:37 2018 Received: (at 31132) by debbugs.gnu.org; 22 Apr 2018 00:54:37 +0000 Received: from localhost ([127.0.0.1]:35261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fA3H2-0000p7-8M for submit@debbugs.gnu.org; Sat, 21 Apr 2018 20:54:37 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fA3Gz-0000oq-5u for 31132@debbugs.gnu.org; Sat, 21 Apr 2018 20:54:34 -0400 Received: by mail-pf0-f196.google.com with SMTP id h69so6323805pfe.13 for <31132@debbugs.gnu.org>; Sat, 21 Apr 2018 17:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=iRumVHKeCIz2LK9GJhrrjwzFW5UzqPFppnfQY5Az+F0=; b=f+iN/WU7SwzBDb6LK9aza6GvO3rJMb7cdn3c60QhF5hDq5kM3ZUl6JmdJ9GbKh4g7Z IcHemZJk+5S3ODtluT1SLfofSICR/RrWc7GFFSIrPpF47EJO7O3j35LSShv/cWrEqMQO JhhYHcPX/2PwFxYX25naYddXftS7s/f01UVJYV/rWObhq39bba7gcacBTS1uwGsNB0+l ahF8yvbhA0ThYDQubY3cPQx2QoCvPTSGKbMD6ZQyRI1Rs0TIMjSsfXO+I1Ynb7NKziS0 6ZaRChkzqPR6xqsTvurvkbIb3Td9HjlxNWyxUQiAU2pA9fj/d8HibRqkOllTN7SdKgXb XUzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=iRumVHKeCIz2LK9GJhrrjwzFW5UzqPFppnfQY5Az+F0=; b=Q9GP5iurmNxMQMmQQqaKg01JRNTHHM34AE7YguS+uR+UmNzkkT6IywxYKiBkVU4ReQ FMcBQZshsF0qLfdS48ygovFRKX70Vx/ZRxelv83SEtL6yUOPH0kT0Piy95FKGfISuL/l nTUpqOKcBxmXJZOZPLMx7hnKgmCSryj6BUgKk+QQaMLMlmm3+73wBwJrZwyForRJSC3T e3cOPteVtNAnm0wOsl+sTW87jXYbelhR4BpFWRLN5yjcT3yKfzgCtLKBQeRtY84NLHcj e8Dc0HAuRa13Dp4AapgLQ5iHcnGKOg2lksi866kURPubFErlt/ccLuIezXbGyNpP9fLZ mYDw== X-Gm-Message-State: ALQs6tBwtVpknpB/p8zAjr06fBsoXEkPLtkWt4TO587HWbkGZn+FoG/q yWL9ue1fgb/AHkTHr2aZoxlp1Tej X-Google-Smtp-Source: AIpwx4+VRQ6NnY3gmTYm5MJuU4j6n4UoO6ctCgpdHF7cxJSS6b6IWVXwDucXzGffM5zRnvRx8wqIpQ== X-Received: by 10.99.98.69 with SMTP id w66mr12620129pgb.55.1524358466211; Sat, 21 Apr 2018 17:54:26 -0700 (PDT) Received: from [10.13.10.6] (ip-97-228-239-173.router.siliconvalleywifi.com. [173.239.228.97]) by smtp.gmail.com with ESMTPSA id e83sm22944123pfd.175.2018.04.21.17.54.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Apr 2018 17:54:25 -0700 (PDT) Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands From: Gustavo Barros To: Arash Esbati References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Message-ID: Date: Sat, 21 Apr 2018 21:54:21 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Arash, I did observe something else, as I closed my file after testing, and was cleaning up things. I had observed the behavior before, but was unsure if my "noobiness" was to blame. (So please be understanding). The behavior is the following. When I first open the file, if I try to issue 'C-c &' on a multicite command key, it returns "Not on a crossref macro argument". 'C-c [' works though. And *after* I have either issued 'C-c [' on a key or issued successfully 'C-c &' on a regular citation command, then 'C-c &' will work also on multicite commands. It's a small glitch in my view, and was somehow hard to spot. But I can reproduce this behavior with the test file I sent previously. Sorry for the previous incomplete report. But I only could figure the logic of what was going on, after I closed and reopened things. Thank you once again. Best, gusbrs On 21/04/18 21:29, Gustavo Barros wrote: > Hi Arash, > > thank you very much for the patches. They are really appreciated. > And sorry for the delay in reporting back. I didn't have the time > these last couple of days to look at this with due care. > > I've performed some tests with the patches you sent on the full set of > biblatex's citation commands, and can gladly report that both "C-c &" > (reftex-view-crossref) and "C-c [" (reftex-citation) (when issued on > the key of an existing citation command) work flawlessly on all of them. > > But, in performing the tests, I observed some other things associated > with biblatex's citation commands (some related to this issue, some > not) that I might as well report too, in the hope they will be useful. > As a regular biblatex user, I consider them minor. > > 1 - The multicite variants of 'volcite' are neither fontified nor call > RefTeX when inserted (with "C-c RET"). They are inserted "plain" but, > once inserted, "C-c [" will work on them. They are the following: > -volcites > -Volcites > -pvolcites > -Pvolcites > -fvolcites > -Fvolcites > -svolcites > -Svolcites > -tvolcites > -Tvolcites > -avolcites > -Avolcites > > 2 - A couple of 'volcite' variants are fontified, but don't call > RefTeX when inserted: > -pvolcite > -ftvolcite > > 3 - One command is not fontified: > -footfullcite > > 4 - 'mcite'-like citation commands are neither fontified, nor call > RefTeX when inserted: > -mcite > -Mcite > -mparencite > -Mparencite > -mfootcite > -mfootcitetext > -mtextcite > -Mtextcite > > > I can report something else too. In the last couple of weeks, for all > the critical issues for my regular workflow with LaTeX I found my way > around with Emacs, so I think the "potential deal breakers" are > overcome. Even though I'm clearly still in the steep part of the > learning curve with Emacs, I do believe I've been hooked. Still > struggling, but already bewitched. :) > So I'm looking forward to sticking around. > > Thank you very much once again. > > Best, > gusbrs > > > PS: The test file used was the following: > > \documentclass{article} > > \begin{filecontents}{biblatex-bib.bib} > @book{lamp:94, >   author    = {Leslie Lamport}, >   title     = {LaTeX - {A} Document Preparation System: User's Guide >                and Reference Manual, Second Edition}, >   publisher = {Pearson / Prentice Hall}, >   year      = {1994}, >   isbn      = {978-0-201-52983-8}, >   timestamp = {Fri, 08 Apr 2011 18:21:00 +0200}, > } > > @book{mitt:97, >   author    = {Michel Goossens and >                Sebastian Rahtz and >                Frank Mittelbach}, >   title     = {The LaTeX Graphics Companion - Illustrating documents >                with TeX and PostScript}, >   series    = {Addison-Wesley series on tools and techniques >                for computer typesetting}, >   publisher = {Addison-Wesley}, >   year      = {1997}, >   isbn      = {978-0-201-85469-5}, > } > \end{filecontents} > > \usepackage[style=authoryear, natbib=true, mcite=true]{biblatex} > > \addbibresource{biblatex-bib.bib} > > \begin{document} > > % Standard commands > \cite[pre][pos]{mitt:97} > \Cite[pre][pos]{lamp:94} > \parencite[pre][pos]{mitt:97} > \Parencite[pre][pos]{lamp:94} > \footcite[pre][pos]{mitt:97} > \footcitetext[pre][pos]{lamp:94} > % Style specific commands > \textcite[pre][pos]{mitt:97} > \Textcite[pre][pos]{lamp:94,} > \smartcite[pre][pos]{mitt:97} > \Smartcite[pre][pos]{lamp:94} > \cite*[pre][pos]{mitt:97} > \parencite*[pre][pos]{lamp:94} > % \supercite{mitt:97} > % Qualified citation lists > \cites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94}[pre][pos]{lamp:94} > > \Cites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \parencites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \Parencites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \footcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \footcitetexts(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \smartcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \Smartcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \textcites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \Textcites(gpre)(gpos)[pre][pos]{lamp:94}[pre][pos]{mitt:97} > % \supercites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > % Style independent commands > \autocite[pre][pos]{mitt:97} > \Autocite[pre][pos]{lamp:94} > \autocite*[pre][pos]{mitt:97} > \Autocite*[pre][pos]{lamp:94} > \autocites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > \Autocites(gpre)(gpos)[pre][pos]{mitt:97}[pre][pos]{lamp:94} > % Text commands > \citeauthor[pre][pos]{mitt:97} > \citeauthor*[pre][pos]{mitt:97} > \Citeauthor[pre][pos]{lamp:94} > \Citeauthor*[pre][pos]{lamp:94} > \citetitle[pre][pos]{mitt:97,lamp:94} > \citetitle*[pre][pos]{lamp:94} > \citeyear[pre][pos]{mitt:97} > \citeyear*[pre][pos]{lamp:94} > \citedate[pre][pos]{mitt:97} > \citedate*[pre][pos]{lamp:94} > \citeurl[pre][pos]{mitt:97} > % Special commands > \nocite{mitt:97} > \fullcite[pre][pos]{lamp:94} > \footfullcite[pre][pos]{mitt:97} > \volcite[pre]{2}[pg]{mitt:97} > \Volcite[pre]{1}[pg]{lamp:94} > \volcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} > \Volcites(gpre)(gpos)[pre]{2}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} > \pvolcite[pre]{1}[pg]{lamp:94} > \Pvolcite[pre]{2}[pg]{mitt:97} > \pvolcites(gpre)(gpos)[pre]{1}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} > \Pvolcites(gpre)(gpos)[pre]{3}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} > \fvolcite[pre]{3}[pg]{lamp:94} > \ftvolcite[pre]{3}[pg]{lamp:94} > \fvolcites(gpre)(gpos)[pre]{3}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} > \Fvolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{3}[pg]{mitt:97} > \svolcite[pre]{2}[pg]{lamp:94} > \Svolcite[pre]{4}[pg]{mitt:97} > \svolcites(gpre)(gpos)[pre]{3}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} > \Svolcites(gpre)(gpos)[pre]{3}[pg]{mitt:97}[pre]{2}[pg]{lamp:94} > \tvolcite[pre]{5}[pg]{mitt:97} > \Tvolcite[pre]{2}[pg]{lamp:94} > \tvolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{3}[pg]{mitt:97} > \Tvolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{3}[pg]{mitt:97} > \avolcite[pre]{3}[pg]{lamp:94} > \Avolcite[pre]{1}[pg]{mitt:97} > \avolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} > \Avolcites(gpre)(gpos)[pre]{2}[pg]{lamp:94}[pre]{1}[pg]{mitt:97} > \notecite[pre][pos]{lamp:94} > \Notecite[pre][pos]{mitt:97} > \pnotecite[pre][pos]{mitt:97} > \Pnotecite[pre][pos]{lamp:94} > \fnotecite[pre][pos]{lamp:94} > % Low-level commands > \citename[pre][pos]{lamp:94}{author} > \citelist[pre][pos]{lamp:94}{publisher} > \citefield[pre][pos]{lamp:94}{isbn} > % natbib compatibility commands > \citet[pre][pos]{mitt:97} > \citet*[pre][pos]{lamp:94} > \citep[pre][pos]{lamp:94} > \citep*[pre][pos]{mitt:97} > \citealt[pre][pos]{lamp:94} > \citealt*[pre][pos]{mitt:97} > \citealp[pre][pos]{mitt:97} > \citealp*[pre][pos]{lamp:94} > \Citet[pre][pos]{lamp:94} > \Citet*[pre][pos]{mitt:97} > \Citep[pre][pos]{lamp:94} > \Citep*[pre][pos]{mitt:97} > % mcite-like citation commands > \mcite[pre][pos]{lamp:94,mitt:97} > \Mcite[pre][pos]{mitt:97,lamp:94} > \mparencite[pre][pos]{lamp:94,mitt:97} > \Mparencite[pre][pos]{lamp:94,mitt:97} > \mfootcite[pre][pos]{lamp:94,mitt:97} > \mfootcitetext[pre][pos]{lamp:94,mitt:97} > \mtextcite[pre][pos]{lamp:94,mitt:97} > \Mtextcite[pre][pos]{lamp:94,mitt:97} > % \msupercite[pre][pos]{lamp:94,mitt:97} > > \end{document} > %%% Local Variables: > %%% mode: latex > %%% TeX-master: t > %%% End: > > > > > On 19/04/18 16:45, Arash Esbati wrote: >> gusbrs.2016@gmail.com writes: >> >>>  From TeX.SX: https://tex.stackexchange.com/q/425883/105447 >>> >>> >>> RefTeX's relations biblatex's multicite commands (such as \parencites, >>> \footcites, \textcites and so on) leave some things to be desired >>> for. Namely, they do not seem to be recognized as citation >>> commands. This results in RefTeX's `reftex-view-crossref` (C-c &) >>> returning "Not on a crossref macro argument". Also, in adding an extra >>> bibkey to an already existing multicite command, it is not possible to >>> access RefTeX's facilities. >>> >>> Arash Esbati generously provided patches at TeX.SX that go a long way >>> in dealing with these problems. However, support for the presence of >>> global optional arguments (between parentheses) is still missing. At >>> their request, I write to report this issue. >> Hi Gusbrs, >> >> thanks for the report.  I fiddled a little around and I think I have a >> working setup for this issue.  I think with this patch, RefTeX will also >> recognize referencing commands provided by cleveref.sty. >> >> --8<---------------cut here---------------start------------->8--- >> diff --git a/lisp/textmodes/reftex-cite.el >> b/lisp/textmodes/reftex-cite.el >> index fd229a6..3f4965a 100644 >> --- a/lisp/textmodes/reftex-cite.el >> +++ b/lisp/textmodes/reftex-cite.el >> @@ -763,7 +763,9 @@ in order to only add another reference in the >> same cite command." >>         (setq format "%l")) >> >>        ((and (stringp macro) >> -           (string-match "\\`\\\\cite\\|cite\\'" macro)) >> +           (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" >> macro)) >> +      ;; Match also commands from biblatex ending with `s' (\cites) or >> +      ;; `*' (\parencite*) and `texts?' (\footcitetext and >> \footcitetexts). >>         ;; We are already inside a cite macro >>         (if (or (not arg) (not (listp arg))) >>             (setq format >> diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el >> index 74a5e63..b93d05d 100644 >> --- a/lisp/textmodes/reftex-dcr.el >> +++ b/lisp/textmodes/reftex-dcr.el >> @@ -60,10 +60,13 @@ to the functions `reftex-view-cr-cite' and >> `reftex-view-cr-ref'." >>         (setq reftex-call-back-to-this-buffer (current-buffer)) >> >>         (cond >> -       ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" macro) >> +       ((string-match >> "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) >> +        ;; Match also commands from biblatex ending with `s' >> (\cites) or >> +        ;; `*' (\parencite*) and `texts?' (\footcitetext and >> \footcitetexts). >>          ;; A citation macro: search for bibitems or BibTeX entries >>          (setq dw (reftex-view-cr-cite arg key auto-how))) >> -       ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro) >> +       ((string-match "\\`\\\\ref\\|ref\\(s\\|range\\)?\\*?\\'" macro) >> +        ;; Match also commands from cleveref ending with `s' >> (\namecrefs). >>          ;; A reference macro: search for labels >>          (setq dw (reftex-view-cr-ref arg key auto-how))) >>          (auto-how nil)  ;; No further action for automatic display >> (speed) >> diff --git a/lisp/textmodes/reftex-parse.el >> b/lisp/textmodes/reftex-parse.el >> index 492f546..31e108c 100644 >> --- a/lisp/textmodes/reftex-parse.el >> +++ b/lisp/textmodes/reftex-parse.el >> @@ -788,12 +788,13 @@ move backward to the closing parenthesis of the >> previous argument. >>   This function understands the splitting of macros over several lines >>   in TeX." >>     (cond >> -   ;; Just to be quick: >> -   ((memq (preceding-char) '(?\] ?\}))) >> +   ;; Just to be quick: biblatex uses () as delimiters for optional >> +   ;; arguments in qualified citation lists. >> +   ((memq (preceding-char) '(?\] ?\) ?\}))) >>      ;; Do a search >>      ((and reftex-allow-detached-macro-args >>            (re-search-backward >> -          "[]}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" >> bound t)) >> +          "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" >> bound t)) >>       (goto-char (1+ (match-beginning 0))) >>       t) >>      (t nil))) >> @@ -842,12 +843,22 @@ considered an argument of macro \\macro." >>               (while (and (reftex-move-to-previous-arg bound) >>                           (condition-case nil >>                               (let ((forward-sexp-function nil)) >> -                              (backward-sexp) t) >> +                              (if (= (preceding-char) ?\)) >> +                                  (let ((temp-table >> (make-syntax-table))) >> +                                    (modify-syntax-entry ?\( "()" >> temp-table) >> +                                    (modify-syntax-entry ?\) ")(" >> temp-table) >> +                                    (with-syntax-table temp-table >> +                                      (backward-sexp))) >> +                                (backward-sexp)) >> +                              t) >>                             (error nil))) >> -              (if (eq (following-char) ?\[) (cl-incf cnt-opt)) >> +              (if (or (eq (following-char) ?\[) >> +                      (eq (following-char) ?\()) >> +                  (cl-incf cnt-opt)) >>                 (cl-incf cnt)) >>               (setq pos (point)) >>               (when (and (or (= (following-char) ?\[) >> +                           (= (following-char) ?\() >>                              (= (following-char) ?\{)) >>                          (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) >>                 (setq cmd (reftex-match-string 0)) >> --8<---------------cut here---------------end--------------->8--- >> >> One thing I don't understand is why (backward-sexp) doesn't work on >> (Global Pre) arguments.  Maybe somebody can enlighten me.  For now, I >> added a trickery with `with-syntax-table'. >> >> Further, I think the functions `reftex-move-over-touching-args' and >> `reftex-move-to-next-arg' must also be patched in order to support >> optional arguments in parentheses. >> >> My test file for this looks like this.  In case somebody wants to try >> this out, the complete functions are inserted below.  Any comments >> welcome. >> >> >> --8<---------------cut here---------------start------------->8--- >> \documentclass{article} >> >> \begin{filecontents}{biblatex-bib.bib} >> @book{lamp:94, >>    author    = {Leslie Lamport}, >>    title     = {LaTeX - {A} Document Preparation System: User's Guide >>                 and Reference Manual, Second Edition}, >>    publisher = {Pearson / Prentice Hall}, >>    year      = {1994}, >>    isbn      = {978-0-201-52983-8}, >>    timestamp = {Fri, 08 Apr 2011 18:21:00 +0200}, >> } >> >> @book{mitt:97, >>    author    = {Michel Goossens and >>                 Sebastian Rahtz and >>                 Frank Mittelbach}, >>    title     = {The LaTeX Graphics Companion - Illustrating documents >>                 with TeX and PostScript}, >>    series    = {Addison-Wesley series on tools and techniques >>                 for computer typesetting}, >>    publisher = {Addison-Wesley}, >>    year      = {1997}, >>    isbn      = {978-0-201-85469-5}, >> } >> \end{filecontents} >> >> \usepackage[style=authoryear]{biblatex} >> >> \addbibresource{biblatex-bib.bib} >> >> \begin{document} >> >> %% =============== RefTeX standard >> >> \cite{mitt:97} >> ==> \verb|C-c &| Ok, \verb|C-c [| Ok >> >> \cites[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} >> ==> \verb|C-c &| Ok, \verb|C-c [| Ok >> >> \footcitetext[Pre][Post]{mitt:97} >> ==> \verb|C-c &| NOk, \verb|C-c [| NOk >> >> \parencite*[Pre][Post]{mitt:97} >> ==> \verb|C-c &| Ok, \verb|C-c [| NOk >> >> \parencites{mitt:97} >> \parencites(GPre)()[Pre][]{mitt:97}[Pre][]{lamp:94} >> \parencites(pre)()[pre][]{mitt:97} >> \parencites(post)[post]{mitt:97} >> ==> \verb|C-c &| NOk, \verb|C-c [| NOk >> >> %% ============== RefTeX patched >> >> \parencites[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} >> ==> \verb|C-c &| Ok, \verb|C-c [| Ok >> >> \parencites(Global Pre)(Global >> Post)[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} >> ==> \verb|C-c &| Ok, \verb|C-c [| Ok >> >> >> \begin{verbatim} >> (defun reftex-view-crossref (&optional arg auto-how fail-quietly) >>    "View cross reference of macro at point.  Point must be on the KEY >> argument.  When at a `\\ref' macro, show corresponding `\\label' >> definition, also in external documents (`xr').  When on a label, show >> a locations where KEY is referenced.  Subsequent calls find additional >> locations.  When on a `\\cite', show the associated `\\bibitem' macro or >> the BibTeX database entry.  When on a `\\bibitem', show a `\\cite' macro >> which uses this KEY. When on an `\\index', show other locations marked >> by the same index entry. >> To define additional cross referencing items, use the option >> `reftex-view-crossref-extra'.  See also >> `reftex-view-crossref-from-bibtex'. >> With one or two C-u prefixes, enforce rescanning of the document. >> With argument 2, select the window showing the cross reference. >> AUTO-HOW is only for the automatic crossref display and is handed >> through >> to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'." >> >>    (interactive "P") >>    ;; See where we are. >>    (let* ((macro (car (reftex-what-macro-safe 1))) >>           (key (reftex-this-word "^{}%\n\r, \t")) >>           dw) >> >>      (if (or (null macro) (reftex-in-comment)) >>          (or fail-quietly >>              (error "Not on a crossref macro argument")) >> >>        (setq reftex-call-back-to-this-buffer (current-buffer)) >> >>        (cond >>         ((string-match >> "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) >>          ;; Match also commands from biblatex ending with `s' >> (\cites) or >>          ;; `*' (\parencite*) and `texts?' (\footcitetext and >> \footcitetexts). >>          ;; A citation macro: search for bibitems or BibTeX entries >>          (setq dw (reftex-view-cr-cite arg key auto-how))) >>         ((string-match "\\`\\\\ref\\|ref\\(s\\|range\\)?\\*?\\'" macro) >>          ;; Match also commands from cleveref ending with `s' >> (\namecrefs). >>          ;; A reference macro: search for labels >>          (setq dw (reftex-view-cr-ref arg key auto-how))) >>         (auto-how nil)  ;; No further action for automatic display >> (speed) >>         ((or (equal macro "\\label") >>              (member macro reftex-macros-with-labels)) >>          ;; A label macro: search for reference macros >>          (reftex-access-scan-info arg) >>          (setq dw (reftex-view-regexp-match >>                    (format reftex-find-reference-format (regexp-quote >> key)) >>                    4 nil nil))) >>         ((equal macro "\\bibitem") >>          ;; A bibitem macro: search for citations >>          (reftex-access-scan-info arg) >>          (setq dw (reftex-view-regexp-match >>                    (format reftex-find-citation-regexp-format >> (regexp-quote key)) >>                    4 nil nil))) >>         ((member macro reftex-macros-with-index) >>          (reftex-access-scan-info arg) >>          (setq dw (reftex-view-regexp-match >>                    (format reftex-find-index-entry-regexp-format >>                            (regexp-quote key)) >>                    3 nil nil))) >>         (t >>          (reftex-access-scan-info arg) >>          (catch 'exit >>            (let ((list reftex-view-crossref-extra) >>                  entry mre action group) >>              (while (setq entry (pop list)) >>                (setq mre (car entry) >>                      action (nth 1 entry) >>                      group (nth 2 entry)) >>                (when (string-match mre macro) >>                  (setq dw (reftex-view-regexp-match >>                            (format action key) group nil nil)) >>                  (throw 'exit t)))) >>            (error "Not on a crossref macro argument")))) >>        (if (and (eq arg 2) (windowp dw)) (select-window dw))))) >> >> (defun reftex-figure-out-cite-format (arg &optional no-insert >> format-key) >>    "Check if there is already a cite command at point and change cite >> format >> in order to only add another reference in the same cite command." >>    (let ((macro (car (reftex-what-macro 1))) >>          (cite-format-value (reftex-get-cite-format)) >>          key format) >>      (cond >>       (no-insert >>        ;; Format does not really matter because nothing will be >> inserted. >>        (setq format "%l")) >> >>       ((and (stringp macro) >>             (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" >> macro)) >>        ;; Match also commands from biblatex ending with `s' (\cites) or >>        ;; `*' (\parencite*) and `texts?' (\footcitetext and >> \footcitetexts). >>        ;; We are already inside a cite macro >>        (if (or (not arg) (not (listp arg))) >>            (setq format >>                  (concat >>                   (if (member (preceding-char) '(?\{ ?,)) >>                       "" >>                     reftex-cite-key-separator) >>                   "%l" >>                   (if (member (following-char) '(?\} ?,)) >>                       "" >>                     reftex-cite-key-separator))) >>          (setq format "%l"))) >>       (t >>        ;; Figure out the correct format >>        (setq format >>              (if (and (symbolp cite-format-value) >>                       (assq cite-format-value >> reftex-cite-format-builtin)) >>                  (nth 2 (assq cite-format-value >> reftex-cite-format-builtin)) >>                cite-format-value)) >>        (when (listp format) >>          (setq key >>                (or format-key >>                    (reftex-select-with-char >>                     "" (concat "SELECT A CITATION FORMAT\n\n" >>                                (mapconcat >>                                 (lambda (x) >>                                   (format "[%c] %s  %s" (car x) >>                                           (if (> (car x) 31) " " "") >>                                           (cdr x))) >>                                 format "\n"))))) >>          (if (assq key format) >>              (setq format (cdr (assq key format))) >>            (error "No citation format associated with key `%c'" key))))) >>      format)) >> >> (defun reftex-move-to-previous-arg (&optional bound) >>    "Assuming that we are in front of a macro argument, >> move backward to the closing parenthesis of the previous argument. >> This function understands the splitting of macros over several lines >> in TeX." >>    (cond >>     ;; Just to be quick: biblatex uses () as delimiters for optional >>     ;; arguments in qualified citation lists. >>     ((memq (preceding-char) '(?\] ?\) ?\}))) >>     ;; Do a search >>     ((and reftex-allow-detached-macro-args >>           (re-search-backward >>            "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" >> bound t)) >>      (goto-char (1+ (match-beginning 0))) >>      t) >>     (t nil))) >> >> >> (defun reftex-what-macro (which &optional bound) >>    "Find out if point is within the arguments of any TeX-macro. >> The return value is either (\"\\macro\" . (point)) or a list of them. >> >> If WHICH is nil, immediately return nil. >> If WHICH is 1, return innermost enclosing macro. >> If WHICH is t, return list of all macros enclosing point. >> If WHICH is a list of macros, look only for those macros and return the >>    name of the first macro in this list found to enclose point. >> If the optional BOUND is an integer, bound backwards directed >>    searches to this point.  If it is nil, limit to nearest \\section - >>    like statement. >> >> This function is pretty stable, but can be fooled if the text contains >> things like \\macro{aa}{bb} where \\macro is defined to take only one >> argument.  As RefTeX cannot know this, the string \"bb\" would still be >> considered an argument of macro \\macro." >>    (unless reftex-section-regexp (reftex-compile-variables)) >>    (catch 'exit >>      (if (null which) (throw 'exit nil)) >>      (let ((bound (or bound (save-excursion (re-search-backward >> reftex-section-regexp nil 1) >>                                             (point)))) >>            pos cmd-list cmd cnt cnt-opt entry) >>        (save-restriction >>          (save-excursion >>            (narrow-to-region (max (point-min) bound) (point-max)) >>            ;; move back out of the current parenthesis >>            (while (condition-case nil >>                       (let ((forward-sexp-function nil)) >>                         (up-list -1) t) >>                     (error nil)) >>              (setq cnt 1 cnt-opt 0) >>              ;; move back over any touching sexps >>              (while (and (reftex-move-to-previous-arg bound) >>                          (condition-case nil >>                              (let ((forward-sexp-function nil)) >>                                (if (= (preceding-char) ?\)) >>                                    (let ((temp-table >> (make-syntax-table))) >>                                      (modify-syntax-entry ?\( "()" >> temp-table) >>                                      (modify-syntax-entry ?\) ")(" >> temp-table) >>                                      (with-syntax-table temp-table >>                                        (backward-sexp))) >>                                  (backward-sexp)) >>                                t) >>                            (error nil))) >>                (if (or (eq (following-char) ?\[) >>                        (eq (following-char) ?\()) >>                    (cl-incf cnt-opt)) >>                (cl-incf cnt)) >>              (setq pos (point)) >>              (when (and (or (= (following-char) ?\[) >>                             (= (following-char) ?\() >>                             (= (following-char) ?\{)) >>                         (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) >>                (setq cmd (reftex-match-string 0)) >>                (when (looking-at "\\\\begin{[^}]*}") >>                  (setq cmd (reftex-match-string 0) >>                        cnt (1- cnt))) >>                ;; This does ignore optional arguments.  Very hard to >> fix. >>                (when (setq entry (assoc cmd reftex-env-or-mac-alist)) >>                  (if (> cnt (or (nth 4 entry) 100)) >>                      (setq cmd nil))) >>                (cond >>                 ((null cmd)) >>                 ((eq t which) >>                  (push (cons cmd (point)) cmd-list)) >>                 ((or (eq 1 which) (member cmd which)) >>                  (throw 'exit (cons cmd (point)))))) >>              (goto-char pos))) >>          (nreverse cmd-list))))) >> >> \end{verbatim} >> >> \end{document} >> >> --8<---------------cut here---------------end--------------->8--- >> >> Best, Arash > From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 06 17:01:00 2024 Received: (at 31132) by debbugs.gnu.org; 6 Apr 2024 21:01:00 +0000 Received: from localhost ([127.0.0.1]:41074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtD9n-0007F4-N6 for submit@debbugs.gnu.org; Sat, 06 Apr 2024 17:01:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtD9j-0007EL-28 for 31132@debbugs.gnu.org; Sat, 06 Apr 2024 17:00:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtD9X-0000WU-Al; Sat, 06 Apr 2024 17:00:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ZwAVlFvH8UeGmRxq0HlWPeuIie8mI4ydKnt20fnTf5I=; b=UCgfi4cxUbPzb+t/h3zw Q+qeQ1Z/FryzVVnCNvYLX4GPWyy17HCOY3SvaWs0d21LxXYdtbLtWfwZyvNukCPEQogaA2ZUpVZUa 4wX45hCXznReP4aPycETBfjeG2jVVPeEIkqy9hbpnOE/M/FFp6ZI2qjq1/m1BMp0bayoKrAakm8+c V3/y8spZ3CT73Byow0K7EfpKjjdrkFzjj3bdBnjU2xWADjc5m7DVlZu0MiPavjKj8FaGbgNW3OsEf E+3TxZxXQUz2u23K+9ZqMZQP2WZA6iAJ4srrMUAIZQrNulrfr2Ytlg/ARFwX18G0yoF19DFYo811q 7c1z+cb8aUALOg==; From: Arash Esbati To: Gustavo Barros Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands In-Reply-To: <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> (Gustavo Barros's message of "Sat, 21 Apr 2018 21:29:13 -0300") References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Sat, 06 Apr 2024 23:00:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Gustavo, Gustavo Barros writes: > thank you very much for the patches. They are really appreciated. > And sorry for the delay in reporting back. I didn't have the time > these last couple of days to look at this with due care. Sorry for my late response; it seems I didn't have time during the last couple of years ;-) Somehow this report went lost. > I've performed some tests with the patches you sent on the full set of > biblatex's citation commands, and can gladly report that both "C-c &" > (reftex-view-crossref) and "C-c [" (reftex-citation) (when issued on > the key of an existing citation command) work flawlessly on all of > them. I had a look again and I plan to install the following change in Emacs master: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 9694a1364d3..6e1c229561a 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -801,17 +801,17 @@ reftex-notice-new ) (defsubst reftex-move-to-previous-arg (&optional bound) - "Assuming that we are in front of a macro argument, -move backward to the closing parenthesis of the previous argument. -This function understands the splitting of macros over several lines -in TeX." + "Move backward to the closing parenthesis of the previous argument. +This happens under the assumption that we are in front of a macro +argument. This function understands the splitting of macros over +several lines in TeX." (cond ;; Just to be quick: - ((memq (preceding-char) '(?\] ?\}))) + ((memq (preceding-char) '(?\] ?\) ?\}))) ;; Do a search ((and reftex-allow-detached-macro-args (re-search-backward - "[]}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) + "[])}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=" bound t)) (goto-char (1+ (match-beginning 0))) t) (t nil))) @@ -860,13 +860,19 @@ reftex-what-macro (while (and (reftex-move-to-previous-arg bound) (condition-case nil (let ((forward-sexp-function nil)) - (backward-sexp) t) + (if (eq (preceding-char) ?\)) + (let ((temp-table (make-syntax-table))) + (modify-syntax-entry ?\( "()" temp-table) + (modify-syntax-entry ?\) ")(" temp-table) + (with-syntax-table temp-table + (backward-sexp))) + (backward-sexp)) + t) (error nil))) - (if (eq (following-char) ?\[) (cl-incf cnt-opt)) + (if (memq (following-char) '(?\( ?\[)) (cl-incf cnt-opt)) (cl-incf cnt)) (setq pos (point)) - (when (and (or (= (following-char) ?\[) - (= (following-char) ?\{)) + (when (and (memq (following-char) '(?\[ ?\( ?\{)) (re-search-backward "\\\\[*a-zA-Z]+\\=" nil t)) (setq cmd (reftex-match-string 0)) (when (looking-at "\\\\begin{[^}]*}") --8<---------------cut here---------------end--------------->8--- Do you have the chance to install this locally and test it again? I will push it afterwards. Thanks. > But, in performing the tests, I observed some other things associated > with biblatex's citation commands (some related to this issue, some > not) that I might as well report too, in the hope they will be > useful. As a regular biblatex user, I consider them minor. > > 1 - The multicite variants of 'volcite' are neither fontified nor call > RefTeX when inserted (with "C-c RET"). They are inserted "plain" but, > once inserted, "C-c [" will work on them. They are the following: > -volcites > -Volcites > -pvolcites > -Pvolcites > -fvolcites > -Fvolcites > -svolcites > -Svolcites > -tvolcites > -Tvolcites > -avolcites > -Avolcites Fontification should work now for limited number of args: https://git.savannah.gnu.org/cgit/auctex.git/tree/font-latex.el#n305 > 2 - A couple of 'volcite' variants are fontified, but don't call > RefTeX when inserted: > -pvolcite > -ftvolcite Fixed with commit 9ba0093b. > 3 - One command is not fontified: > -footfullcite Is fixed. > 4 - 'mcite'-like citation commands are neither fontified, nor call > RefTeX when inserted: > -mcite > -Mcite > -mparencite > -Mparencite > -mfootcite > -mfootcitetext > -mtextcite > -Mtextcite This is indeed nasty because of the notation (biblatex.pdf, page 120): \mcite{key1,setA,*keyA1,*keyA2,*keyA3,key2,setB,*keyB1,*keyB2,*keyB3} I have no idea what the best approach for this is. Again, sorry the late response. Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 06 17:52:01 2024 Received: (at 31132) by debbugs.gnu.org; 6 Apr 2024 21:52:02 +0000 Received: from localhost ([127.0.0.1]:41185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtDx8-0003wv-NS for submit@debbugs.gnu.org; Sat, 06 Apr 2024 17:52:01 -0400 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]:45479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtDx4-0003vx-0Z for 31132@debbugs.gnu.org; Sat, 06 Apr 2024 17:51:57 -0400 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-617dfcf80aeso13844427b3.3 for <31132@debbugs.gnu.org>; Sat, 06 Apr 2024 14:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712440302; x=1713045102; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sjiE/+mFujeQ9yXcsCrrCTxNANAJR1v+rHLqL5InyW4=; b=TNMvCtaudMt+tuDrnG4rpzhk9xZSKxw8trt9RydK7Sl76/IzCzzW0KglR1ejQK6lf8 4yKhIHQIxzL18ECK5UJA3F3TvHtVKU8/dLdjbQFtxLJFVFMe2GotgYEEIwtsPn7HhMeK cDdC9se7WJEvkCYP5illF3yutYytAuCTW3BceYOnRJFNkWQT0MmNAWIzkzhyhlf7NsEW ajRopIPsTSz37owkRYc/PBWN7S753KcJ/sIQ0Tfi0bOd4lScuoWLLqlfGqDyonLx/8NX XWg95reI7WO4lCqHnhRPXKZgSkPInYyr/n2RrCaDMPh6x7XohduGd8azM+liMnQw4+Pq +0vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712440302; x=1713045102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sjiE/+mFujeQ9yXcsCrrCTxNANAJR1v+rHLqL5InyW4=; b=BcOwiLpvrmdGbxvV36WT3q3rVKpu5MCSkF7YWM6ge8pixN69LEc6biuW36IfkxGp7L Kn/1u8jkfgZGGPYrUSFg5zjWwysCMOrUMT+fRLH+Gq4+nItcHpoUZOGHiCdD6BJjYCwJ O8mT7tOFdnQvSNpsMCT3W1l+mvnRPm1HUSLiHLrpb+j6uOjrUN6BryOpymhwEMStHYSW CCGMPmJTnOAXepEHdfsDTuDZrfXpQXfMuaOIGAQ540oYoJs0Y1zIoun655lc1yD6U99O yjOAg2YZiv1H0itKGV9fT0CPgzAaCz5Kl8ksb41Z9Jopie1O2i1Pj1nIKcwbw5zLFx3k L7kA== X-Gm-Message-State: AOJu0YyBJfGOg7ALnOqUB5vAo6lcW9aWbRQVNFelVgqNXPftZtIYDBZ8 Zgfcu0Osmt0HMq2O6L52XfEPtL2e3yA577TmGEz/Hg4acAY8NjiL6pbzADDYMgq7zstEj704Z+5 NhEALWF8DawEhBAVh9MASoJ188gk= X-Google-Smtp-Source: AGHT+IG1q92PLv5kk4fzEgzeUBgKRhdC5hUyJhDI1sfaztss+JiA06XwUbW1yMVfP/Rnc+8GqkaTk3RdoNeC28aa9PU= X-Received: by 2002:a0d:eaca:0:b0:611:1e35:e5d8 with SMTP id t193-20020a0deaca000000b006111e35e5d8mr4611377ywe.32.1712440301796; Sat, 06 Apr 2024 14:51:41 -0700 (PDT) MIME-Version: 1.0 References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> In-Reply-To: From: gusbrs Date: Sat, 6 Apr 2024 18:51:30 -0300 Message-ID: Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands To: Arash Esbati Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, On Sat, 6 Apr 2024 at 18:00, Arash Esbati wrote: > Sorry for my late response; it seems I didn't have time during the last > couple of years ;-) Somehow this report went lost. Oh, wow! Back from ancient times. I think this was my first ever AUCTeX report. :-) > > I had a look again and I plan to install the following change in Emacs > master: > > [...] > > Do you have the chance to install this locally and test it again? I > will push it afterwards. Thanks. > Sure, but please put me up to speed (it's been a long time, after all). If I read the patch correctly, it seems the intent here is adding support for "global" arguments (the ones delimited with parentheses). Is that correct? Anything else? (I'm asking so I know what to look for). Also, I have been patching this and some related RefTeX functions, especially for this reason, plus some others. Since you have your hands on this, would you like me to share what I have here for them, to see if you can spot anything which might be worth handling at this point? > > But, in performing the tests, I observed some other things associated > > with biblatex's citation commands (some related to this issue, some > > not) that I might as well report too, in the hope they will be > > useful. As a regular biblatex user, I consider them minor. > > > > 1 - The multicite variants of 'volcite' are neither fontified nor call > > RefTeX when inserted (with "C-c RET"). They are inserted "plain" but, > > once inserted, "C-c [" will work on them. They are the following: > > -volcites > > -Volcites > > -pvolcites > > -Pvolcites > > -fvolcites > > -Fvolcites > > -svolcites > > -Svolcites > > -tvolcites > > -Tvolcites > > -avolcites > > -Avolcites > > Fontification should work now for limited number of args: > https://git.savannah.gnu.org/cgit/auctex.git/tree/font-latex.el#n305 > > > 2 - A couple of 'volcite' variants are fontified, but don't call > > RefTeX when inserted: > > -pvolcite > > -ftvolcite > > Fixed with commit 9ba0093b. > > > 3 - One command is not fontified: > > -footfullcite > > Is fixed. > Thanks for that! :-) > > 4 - 'mcite'-like citation commands are neither fontified, nor call > > RefTeX when inserted: > > -mcite > > -Mcite > > -mparencite > > -Mparencite > > -mfootcite > > -mfootcitetext > > -mtextcite > > -Mtextcite > > This is indeed nasty because of the notation (biblatex.pdf, page 120): > > \mcite{key1,setA,*keyA1,*keyA2,*keyA3,key2,setB,*keyB1,*keyB2,*keyB3} > > I have no idea what the best approach for this is. Mhm, yeah. Tricky notation. No particularly interesting approach pops up to me. In fairness, I've never seen any of those "in the wild". > > Again, sorry the late response. > I'm surprised you dug this back. It is appreciated. Thank you. Best, gusbrs From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 07 05:01:51 2024 Received: (at 31132) by debbugs.gnu.org; 7 Apr 2024 09:01:51 +0000 Received: from localhost ([127.0.0.1]:41605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtOPO-0008N2-Qu for submit@debbugs.gnu.org; Sun, 07 Apr 2024 05:01:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtOPM-0008M2-N4 for 31132@debbugs.gnu.org; Sun, 07 Apr 2024 05:01:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtOPA-0008Sy-Gs; Sun, 07 Apr 2024 05:01:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=JDnMlyTbxhCXY56akShbJ3u7VqrSXhei7xdEG4uGtaQ=; b=EkJmlfb7we09ItGVp7of d4VsNfVSi/pWprRw9YZA8FMHyPTA7U3T5hsh/zNRwA/A/ucTZnJW1d0QHR2H7ZyE88RDawfG9UD9h Zq7cavvyj1hds7+gnQYIo4KPQYEKUx1UQcWWuGARchkl8o8+w4T6ZQAfajkdQpRqQdXwGjcSUcpkX GxdaAA8FtMFJoIrQLGJ+do2/fOxaihsRZA0eOWlzE/SRdvVP38VvlrIXJUaZQfzGxiN7kUe4VoLjl oLRPD3xDwq54dsrAjPvlEWKTf3lD8T06bVHg5lar0lwH7LqCj55XaVTxxYk3iwxUBilSSJWPTqGtZ qz6NQqv0w15I6A==; From: Arash Esbati To: gusbrs Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands In-Reply-To: (gusbrs's message of "Sat, 6 Apr 2024 18:51:30 -0300") References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Sun, 07 Apr 2024 11:01:34 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Gustavo, gusbrs writes: > Oh, wow! Back from ancient times. I think this was my first ever > AUCTeX report. :-) Time flies :-) > Sure, but please put me up to speed (it's been a long time, after > all). If I read the patch correctly, it seems the intent here is > adding support for "global" arguments (the ones delimited with > parentheses). Is that correct? Anything else? (I'm asking so I know > what to look for). It's solely about getting C-& work with things like: \parencites(Global Pre)(Global Post)[Pre][Post]{mitt:97}[Pre][Post]{lamp:94} > Also, I have been patching this and some related RefTeX functions, > especially for this reason, plus some others. Since you have your > hands on this, would you like me to share what I have here for them, > to see if you can spot anything which might be worth handling at this > point? Yes, please, share them, and we can see what we can incorporate upstream, highly appreciated =F0=9F=91=8D > Mhm, yeah. Tricky notation. No particularly interesting approach pops > up to me. In fairness, I've never seen any of those "in the wild". We can leave that open for now. > I'm surprised you dug this back. It is appreciated. Thank you. I started looking at our old bug reports, let's see if we can close this one as well. Since it is your first report, it should get the attention deserved ;-) Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 08 10:32:06 2024 Received: (at 31132) by debbugs.gnu.org; 8 Apr 2024 14:32:06 +0000 Received: from localhost ([127.0.0.1]:47347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtq2W-0001bI-W5 for submit@debbugs.gnu.org; Mon, 08 Apr 2024 10:32:06 -0400 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]:46310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtq2R-0001a1-A7 for 31132@debbugs.gnu.org; Mon, 08 Apr 2024 10:32:03 -0400 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-dc236729a2bso4297828276.0 for <31132@debbugs.gnu.org>; Mon, 08 Apr 2024 07:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712586706; x=1713191506; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SKTnE6Rss165xc7ce0EwgTlR4PW8cRARF4gPrjfpHeU=; b=Orhbife4g//FLEWMCW4Fufyf80uJ20zPnJEnb4NX7nWUyDnwIpxOs0hydIn3jJnPLJ VAkD4tOb9suRxIDIQ9o6jlohfQvKJTj8mfzc7jXxKGg3MMCTV/YUUYUjwHgPOnG33TPL Y9X1UsmgSAVVdAgaBQ4jE+KX3TGg2nzfvgSL02May16u9CggKioGWE+9kM4v+w9y/Com Q5VfbUUOEPiK1HN8cEzeTS4QwpmmPDdADT7JG4VIAgwMTZJ41N6wqno96aR/JLIMWe2s 1uU2nztopxIlbIPxN1khBzvKdyvKzm5xlRdfFKZYna6Z9Cd+ezfzue0sJvbitwpG5ib6 SrmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712586706; x=1713191506; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SKTnE6Rss165xc7ce0EwgTlR4PW8cRARF4gPrjfpHeU=; b=oas6rWENK1aPYu8d1FUJMOCZxrvSKf7j/3zeYR8QiGvZXbm2Br9ucMPs7eyscHD2cj JC69s2YEIzJBTJtdjDhtzwxiVar8rFMUhwsOhqdu3CHo7VuKoWQ7gTXdbQr4EErwSXyz eXfGAXpQPOPQl2s0reLBId4w5khgwFyXFDphOiKieuSeZSYfTMPXZ9L9Ph8uyISZi957 FFhE5YEdEypX1WjBrlscoE+PPrR9oE8bmiIyJA2l1K5bj2nyr4L7GP1ypjkZqSz1UIEU zPl5AGPeCx9qyzAYbRMziLYvZNZCZqyQ/yN+gaWaePEtoSBMI3Jecb3ibXwGtwPh+Oh/ NhVg== X-Gm-Message-State: AOJu0YwYGIgvR4AvcfJGENrAm5LOBeSJ6iZ2A0oA4ewdsKpequb0C02V 4JA/1+k8ZTQ3MoB5mdZSsxKMLu5SHc1rcKk0Q46xISLxQJ8XYs3z5lYgwaFm5+/L9aQFez6pl9A x4yWmJA6qDat/yG7szNn+lLzBOfK6jr0olvY= X-Google-Smtp-Source: AGHT+IFoECYkBsYGsPxQIKw3XcwCd2IoYuiaQt1Gt9PXpz30Xu/XnWmv54PCnnTbbEE+z4tuEhtNnEAaL0EMzrNWgxU= X-Received: by 2002:a25:dc49:0:b0:dc7:46b7:6d67 with SMTP id y70-20020a25dc49000000b00dc746b76d67mr6794737ybe.33.1712586705819; Mon, 08 Apr 2024 07:31:45 -0700 (PDT) MIME-Version: 1.0 References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> In-Reply-To: From: gusbrs Date: Mon, 8 Apr 2024 11:31:34 -0300 Message-ID: Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands To: Arash Esbati Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, On Sun, 7 Apr 2024 at 06:01, Arash Esbati wrote: > > Time flies :-) > Oh, reading the old thread was a little embarrassing. I didn't even know how to reply to a mailing list (full html contents at the end, etc., sigh... ;-). > > It's solely about getting C-& work with things like: > > \parencites(Global Pre)(Global Post)[Pre][Post]{mitt:97}[Pre][Post]{lamp:= 94} > Great, and it is very welcome that you are revisiting this. Thank you. I did test things and the TL;DR is: looks good to me. The long version: I tested both with AUCTeX and built-in latex-mode, with the following setups. With AUCTeX: (add-to-list 'load-path "~/.emacs.d/elpa/auctex-14.0.4") (load "auctex.el" nil t t) (load "reftex.el" nil t t) (setq TeX-parse-self t) (setq TeX-auto-save t) (setq reftex-plug-into-AUCTeX t) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (require 'reftex-parse) ;; just being sure... ;; and apply Arash's patch Without AUCTeX: (load "reftex.el" nil t t) (add-hook 'latex-mode-hook 'turn-on-reftex) (require 'reftex-parse) ;; just being sure... ;; and apply Arash's patch I used the same test file I had used in the original report. It is possibly not up to date six years later, but should be thorough enough for our purposes. I tested the citation lists of interest both for "C-c &" and "C-c [", and they worked as expected in all cases. (The only thing in `\volcite' and friends where the volume is given in braces, thus mistaken for a key which is not found, but nothing to do there, I'd say). I did not attempt to test for possible side effects in other areas, given that `reftex-move-to-previous-arg' and `reftex-what-macro' are general purpose utility functions. But I think the patch at hand is pretty careful in changing the syntax of the parentheses only locally. That's what I'd do too and my assessment is that I see no reason it shouldn't be safe. (That's not what I currently do in my own config, see below, but that's because I'm lazy and free to shoot myself in the foot in my own config ;-). All in all, the patch looks good to me. The only other thing of note I observed is that the mcite-like citation commands are not fontified as reference/citation commands (they get only the generic `font-latex-sedate-face'). I had agreed with you that the case is tricky and arguably not worth the trouble on RefTeX's side of things. But fontification for them should be trivial. So, why not? > > Also, I have been patching this and some related RefTeX functions, > > especially for this reason, plus some others. Since you have your > > hands on this, would you like me to share what I have here for them, > > to see if you can spot anything which might be worth handling at this > > point? > > Yes, please, share them, and we can see what we can incorporate > upstream, highly appreciated =F0=9F=91=8D Nice, perhaps something useful comes out of it. I'll share the code first and comment later. I'm using `el-patch' in my config, but it should be easy enough to read, even if you are not acquainted with it. And, of course, this is not a real patch or anything, just some stuff to grab ideas from. #+begin_src emacs-lisp (with-eval-after-load 'el-patch ;; For 'reftex-what-macro' and 'reftex-move-to-previous-arg'. (el-patch-feature reftex-parse) (with-eval-after-load 'reftex-parse ;; Provide replacement for 'reftex-what-macro' which recognizes 'biblat= ex' ;; citation lists global optional arguments (between parentheses, inste= ad ;; of brackets). These are *renamed* versions of them, just for use in ;; 'reftex-figure-out-cite-format' and 'reftex-view-crossref', I don't ;; want these changes to affect the behavior of RefTeX elsewhere (playi= ng ;; safe...). Note that the same procedure for 'reftex-what-macro-safe' ;; fails because of the syntax table used, so we just go with ;; 'reftex-what-macro' on 'reftex-view-crossref'. (el-patch-defun (el-patch-swap reftex-what-macro gb/reftex-what-macro-parens) (which &optional bound) "Find out if point is within the arguments of any TeX-macro. The return value is either (\"\\macro\" . (point)) or a list of them. If WHICH is nil, immediately return nil. If WHICH is 1, return innermost enclosing macro. If WHICH is t, return list of all macros enclosing point. If WHICH is a list of macros, look only for those macros and return the name of the first macro in this list found to enclose point. If the optional BOUND is an integer, bound backwards directed searches to this point. If it is nil, limit to nearest \\section - like statement. This function is pretty stable, but can be fooled if the text contains things like \\macro{aa}{bb} where \\macro is defined to take only one argument. As RefTeX cannot know this, the string \"bb\" would still be considered an argument of macro \\macro." (unless reftex-section-regexp (reftex-compile-variables)) (catch 'exit (if (null which) (throw 'exit nil)) (let ((bound (or bound (save-excursion (re-search-backward reftex-section-regexp nil 1= ) (point)))) pos cmd-list cmd cnt cnt-opt entry) (save-restriction (save-excursion (narrow-to-region (max (point-min) bound) (point-max)) ;; move back out of the current parenthesis (while (condition-case nil (let ((forward-sexp-function nil)) (up-list -1) t) (error nil)) (setq cnt 1 cnt-opt 0) ;; move back over any touching sexps (while (and (el-patch-swap (reftex-move-to-previous-arg bound) (gb/reftex-move-to-previous-arg-parens bound)= ) (condition-case nil (let ((forward-sexp-function nil)) (backward-sexp) t) (error nil))) (if (eq (following-char) ?\[) (cl-incf cnt-opt)) (cl-incf cnt)) (setq pos (point)) (when (and (or (=3D (following-char) ?\[) (=3D (following-char) ?\{) (el-patch-add (=3D (following-char) ?\())) (re-search-backward "\\\\[*a-zA-Z]+\\=3D" nil t)= ) (setq cmd (reftex-match-string 0)) (when (looking-at "\\\\begin{[^}]*}") (setq cmd (reftex-match-string 0) cnt (1- cnt))) ;; This does ignore optional arguments. Very hard to fix= . (when (setq entry (assoc cmd reftex-env-or-mac-alist)) (if (> cnt (or (nth 4 entry) 100)) (setq cmd nil))) (cond ((null cmd)) ((eq t which) (push (cons cmd (point)) cmd-list)) ((or (eq 1 which) (member cmd which)) (throw 'exit (cons cmd (point)))))) (goto-char pos))) (nreverse cmd-list))))) (el-patch-defsubst (el-patch-swap reftex-move-to-previous-arg gb/reftex-move-to-previous-arg-parens= ) (&optional bound) "Assuming that we are in front of a macro argument, move backward to the closing parenthesis of the previous argument. This function understands the splitting of macros over several lines in TeX." (cond ;; Just to be quick: ((memq (preceding-char) '(?\] ?\} (el-patch-add ?\))))) ;; Do a search ((and reftex-allow-detached-macro-args (re-search-backward (el-patch-swap "[]}][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=3D" "[]})][ \t]*[\n\r]?\\([ \t]*%[^\n\r]*[\n\r]\\)*[ \t]*\\=3D"= ) bound t)) (goto-char (1+ (match-beginning 0))) t) (t nil))))) (with-eval-after-load 'el-patch (el-patch-feature reftex-cite); for 'reftex-figure-out-cite-format'. (with-eval-after-load 'reftex-cite ;; Select citation format with completion. (el-patch-defun reftex-figure-out-cite-format (arg &optional no-insert format-key) "Check if there is already a cite command at point and change cite fo= rmat in order to only add another reference in the same cite command." (let ((macro (car (el-patch-swap (reftex-what-macro 1) (gb/reftex-what-macro-parens 1)))) (cite-format-value (reftex-get-cite-format)) key format) (cond (no-insert ;; Format does not really matter because nothing will be inserted= . (setq format "%l")) ((and (stringp macro) (el-patch-swap ;; Match also commands from biblatex ending with `s' ;; (\parencites) or `*' (\parencite*) and `texts?' ;; (\footcitetext and \footcitetexts). (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" macro) (and (string-match (concat ;; The original regexp. "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" ;; Plus some... "\\|\\`\\\\begin{\\(foreign\\|hyphen\\)?displaycquo= te}") macro) ;; Make sure we are in a mandatory arg. (save-excursion (let ((forward-sexp-function nil)) (ignore-errors (up-list -1))) (=3D (following-char) ?\{))))) ;; We are already inside a cite macro (if (or (not arg) (not (listp arg))) (setq format (concat (if (member (preceding-char) '(?\{ ?,)) "" reftex-cite-key-separator) "%l" (if (member (following-char) '(?\} ?,)) "" reftex-cite-key-separator))) (setq format "%l"))) (t ;; Figure out the correct format (setq format (if (and (symbolp cite-format-value) (assq cite-format-value reftex-cite-format-builtin= )) (nth 2 (assq cite-format-value reftex-cite-format-built= in)) cite-format-value)) (when (listp format) (setq key (or format-key (el-patch-swap ;; RefTeX offers a selection by key... (reftex-select-with-char "" (concat "SELECT A CITATION FORMAT\n\n" (mapconcat (lambda (x) (format "[%c] %s %s" (car x) (if (> (car x) 31) " " "") (cdr x))) format "\n"))) ;; ... I prefer to select with completion. ;; I'm stripping the slash and the empty arguments ;; from the candidates with 'replace-regexp-in-stri= ng' ;; to have a cleaner list of candidates. Technical= ly ;; speaking this is not fully general, since we can ;; have two candidates (and thus two keys) which ar= e ;; identical or whose only difference are the ;; arguments (e.g. "\\cite{%l}" and "\\cite[][]{%l}= ", ;; as in the jurabib format in ;; 'reftex-cite-format-builtin'). But I can well d= o ;; without it by using an adequate ;; 'gb/reftex-cite-format-biblatex' with no such ;; duplicate entries, particularly since I also let ;; 'reftex-cite-prompt-optional-args' set to 'maybe= ', ;; and thus am not queried by default for optional ;; args anyway and can always include them on deman= d ;; with a prefix arg. (let* ((cands (mapcar (lambda (c) (cons (replace-regexp-in-string "\\(\\[]\\)*\\({%l}\\)*\\= '" "" (replace-regexp-in-string "\\`\\\\" "" (cdr c))) (car c))) format)) (ans (completing-read "Citation format: " cands nil t))) (cdr (assoc ans cands)))))) (if (assq key format) (setq format (cdr (assq key format))) (error "No citation format associated with key `%c'" key))))) format)))) (with-eval-after-load 'el-patch (el-patch-feature reftex-dcr); for 'reftex-view-crossref' and ; 'reftex-view-crossref-when-idle'. (with-eval-after-load 'reftex-dcr ;; 'reftex-view-crossref' and the related 'reftex-view-crossref-when-id= le' ;; have an annoying bug of reporting non-existing bibentries when point= is ;; actually on pre- or post-notes. This has been reported ;; (https://lists.gnu.org/archive/html/bug-auctex/2019-11/msg00007.html= ), ;; but the bug report was not really well received (see thread ;; https://lists.gnu.org/archive/html/bug-auctex/2020-08/msg00007.html)= . ;; So I unfortunately have to patch it here. This must be done also fo= r ;; "ref" commands, since 'zcref' takes an optional argument, and thus i= s ;; subject to the same issue. I've also added support for 'zcheck' and ;; for 'csquotes' integrated display environments here. Some of this ;; stuff could arguably be done by means of 'reftex-view-crossref-extra= ' ;; but, in the end, this is somewhat restrictive, since it only allows = to ;; enable search in the current buffer, which particularly defeats ;; citation keys. (el-patch-defun reftex-view-crossref (&optional arg auto-how fail-quiet= ly) "View cross reference of macro at point. Point must be on the KEY argument. When at a `\\ref' macro, show corresponding `\\label' definition, also in external documents (`xr'). When on a label, show a locations where KEY is referenced. Subsequent calls find additional locations. When on a `\\cite', show the associated `\\bibitem' macro or the BibTeX database entry. When on a `\\bibitem', show a `\\cite' macro which uses this KEY. When on an `\\index', show other locations marked by the same index entry. To define additional cross referencing items, use the option `reftex-view-crossref-extra'. See also `reftex-view-crossref-from-bibtex'. With one or two \\[universal-argument] prefixes, enforce rescanning of the document. With argument 2, select the window showing the cross reference. AUTO-HOW is only for the automatic crossref display and is handed through to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'." (interactive "P") (el-patch-add (require 'reftex-parse)) ;; See where we are. (let* ((macro (car (el-patch-swap (reftex-what-macro-safe 1) (gb/reftex-what-macro-parens 1)))) (key (reftex-this-word "^{}%\n\r, \t")) dw) (if (or (null macro) (reftex-in-comment)) (or fail-quietly (error "Not on a crossref macro argument")) (setq reftex-call-back-to-this-buffer (current-buffer)) (cond ((el-patch-swap (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" macro) ;; A citation macro: search for bibitems or BibTeX entries. ;; Match also commands from biblatex ending with `s' ;; (\parencites) or `*' (\parencite*) and `texts?' ;; (\footcitetext and \footcitetexts). (and (string-match (concat ;; The original regexp. "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" ;; Plus some... "\\|\\`\\\\begin{\\(foreign\\|hyphen\\)?displaycquote}= ") macro) ;; Make sure we are in a mandatory arg. (save-excursion (let ((forward-sexp-function nil)) (ignore-errors (up-list -1))) (=3D (following-char) ?\{)))) (setq dw (reftex-view-cr-cite arg key auto-how))) ((el-patch-swap (string-match "\\`\\\\ref\\|ref\\(range\\|s\\)?\\*?\\'" macro= ) ;; A reference macro: search for labels. ;; Match also commands from cleveref ending with `s' (\namecr= efs). (and (string-match (concat ;; The original regexp. "\\`\\\\ref\\|ref\\(range\\|s\\)?\\*?\\'" ;; Plus some... "\\|\\`\\\\zcheck\\*?\\'") macro) ;; Make sure we are in a mandatory arg. (save-excursion (let ((forward-sexp-function nil)) (ignore-errors (up-list -1))) (and (=3D (following-char) ?\{) ;; And make sure it is the *first* mandatory arg ;; (for '\zcheck'). (progn (backward-sexp 1) t) (not (=3D (following-char) ?\{)))))) (setq dw (reftex-view-cr-ref arg key auto-how))) (auto-how nil) ;; No further action for automatic display (spee= d) ((or (equal macro "\\label") (el-patch-add (equal macro "\\begin{zcregion}")) (member macro reftex-macros-with-labels)) ;; A label macro: search for reference macros (reftex-access-scan-info arg) (setq dw (reftex-view-regexp-match (format reftex-find-reference-format (regexp-quote ke= y)) 4 nil nil))) ((equal macro "\\bibitem") ;; A bibitem macro: search for citations (reftex-access-scan-info arg) (setq dw (reftex-view-regexp-match (format reftex-find-citation-regexp-format (regexp-quote key)) 4 nil nil))) ((member macro reftex-macros-with-index) (reftex-access-scan-info arg) (setq dw (reftex-view-regexp-match (format reftex-find-index-entry-regexp-format (regexp-quote key)) 3 nil nil))) (t (reftex-access-scan-info arg) (catch 'exit (let ((list reftex-view-crossref-extra) entry mre action group) (while (setq entry (pop list)) (setq mre (car entry) action (nth 1 entry) group (nth 2 entry)) (when (string-match mre macro) (setq dw (reftex-view-regexp-match (format action key) group nil nil)) (throw 'exit t)))) (error "Not on a crossref macro argument")))) (if (and (eq arg 2) (windowp dw)) (select-window dw))))) ;; Allow for 'reftex-view-crossref' to find reference commands with ;; multiple labels. Also add support for '\zcheck'. (setopt reftex-find-reference-format (concat "\\\\\\(ref[a-zA-Z]*\\|[a-zA-Z]*ref\\(range\\)?\\|zcheck\\)\\*= ?" "\\(\\[[^]]*\\]\\|{[^}]*}\\)*" "{\\(?:[^}]*,[ \n]*\\)?\\(%s\\)[ ]*[},]")) (el-patch-defun reftex-view-crossref-when-idle () ;; Display info about crossref at point in echo area or a window. ;; This function was designed to work with an idle timer. ;; We try to get out of here as quickly as possible if the call is useless. (and reftex-mode ;; Make sure message area is free if we need it. (or (eq reftex-auto-view-crossref 'window) (not (current-message= ))) ;; Make sure we are not already displaying this one (not (memq last-command '(reftex-view-crossref reftex-mouse-view-crossref))) ;; Quick precheck if this might be a relevant spot ;; `reftex-view-crossref' will do a more thorough check. (save-excursion (search-backward "\\" nil t) (looking-at (el-patch-swap "\\\\[a-zA-Z]*\\(cite\\|ref\\|bibentry\\)" (concat ;; The original regexp. "\\\\[a-zA-Z]*\\(cite\\|ref\\|bibentry\\)" ;; Plus some... "\\|\\\\zcheck" "\\|\\\\begin{\\(foreign\\|hyphen\\)?displaycquote}")))) (condition-case nil (let ((current-prefix-arg nil)) (cond ((eq reftex-auto-view-crossref t) (reftex-view-crossref -1 'echo 'quiet)) ((eq reftex-auto-view-crossref 'window) (reftex-view-crossref -1 'tmp-window 'quiet)) (t nil))) (error nil)))))) (with-eval-after-load 'el-patch (el-patch-feature reftex-parse); for 'reftex-parse-from-file' (with-eval-after-load 'reftex-parse ;; With lazy-macro-expansion to avoid startup errors if 'el-patch' is n= ot ;; installed. (gb/with-lazy-macro-expansion ;; Add RefTeX support for zref-xr. I have made a feature request at ;; https://lists.gnu.org/archive/html/auctex-devel/2021-11/msg00012.ht= ml ;; which met with a positive answer by Arash at ;; https://lists.gnu.org/archive/html/auctex-devel/2021-12/msg00000.ht= ml. ;; But, even if this really makes it, it will take a long time for me = to ;; enjoy. In the meantime, we can use a patch, and a "template" at th= at, ;; since this is a tiny change in a large function. (el-patch-define-and-eval-template (defun reftex-parse-from-file) (el-patch-swap "\\\\external\\(?:cite\\)?document" "\\\\z?external\\(?:cite\\)?document\\*?"))))) #+end_src Comments, starting with exclusions. Naturally, my changes to `reftex-what-macro' and `reftex-move-to-previous-arg' will become obsolete with your patch (Thanks!!). There are obvious idiosyncrasies of mine, like preferring completing-read to a key dispatcher to choose the citation command. Disregard those. Net of this kind of stuff are some things which accumulated over time, to add support to specific packages, or fixing things I didn't like. In hindsight, my general take on those is that RefTeX seems to presume that only the standard, or very traditional, reference and citation commands exist and, hence, chooses to hard-code most of the relevant behavior, making it very hard to extend and tweak. Inaccessible to the less daring users and, more importantly, to AUCTeX style files. Now, as an author of some non-standard cross-reference packages I'm certainly more sensitive to these restrictions than the regular user. Which makes me partial in this regard. But the simple fact that `csquotes' integrated display environments are not supported by this feature set of RefTeX is likely sufficient to convince that this hard-coding bites more widely than the users of some niche package. The fact that `reftex-view-crossref' does not exclude optional arguments with its implications to `reftex-view-crossref-when-idle' would also remain, but this was reported and discussed elsewhere, and I have nothing new to add on this matter. In summary, ideally some of this stuff could be exposed so as to be accessible from AUCTeX style files. Failing that, I'd say adding support to `csquotes', even if hard-coded, would be very welcome. > > I'm surprised you dug this back. It is appreciated. Thank you. > > I started looking at our old bug reports, let's see if we can close this > one as well. Since it is your first report, it should get the attention > deserved ;-) I recall you questioning somewhat the relevance of this peculiar notation of biblatex's citation lists (https://lists.gnu.org/archive/html/auctex-devel/2023-05/msg00015.html) so, as a regular user of them, I'm glad and thankful to see you soften a little your stance in this regard. Best, gusbrs From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 08:40:04 2024 Received: (at 31132) by debbugs.gnu.org; 9 Apr 2024 12:40:04 +0000 Received: from localhost ([127.0.0.1]:48607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruAle-0007iW-Dn for submit@debbugs.gnu.org; Tue, 09 Apr 2024 08:40:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruAlb-0007hy-W8 for 31132@debbugs.gnu.org; Tue, 09 Apr 2024 08:40:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruAlN-0005nu-I1; Tue, 09 Apr 2024 08:39:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=sVf+dG/ZiTTZ1bMBhQ/cgATPky2KnOapgPZU+Ums0u8=; b=Dxj5AQwQNhx+6+zv9vke njczuYwkjfMdwqLIKWkg3deGcwnubgd/AZ0u6YM9sc9aLwWwnwakw2fAmfZ8xOT7zUBYiH2UiKF5l ptitLfEn0l7eXiotwd5LB2xXfWaFYUE/vk3sTJQ4GyioyYVCHf8bc/6/smc7iPgB3OmyvNP2ejhNp lCIBKn6OXqM8LJ8nq2N1iY5OC3d1OOmDdggDFKCpimJe3k/DZ9LqUt6TTUlYNdeQHptcTFJzw++Wc FHGJTFTqrZ6Wp1dwrD4et0w0jjBYMLGhz5+VgMev7o2s9kUYYQZfQDCLYp2kqjpg5P0mI/mEzW+Bt e1EZdPUlLYZw+w==; From: Arash Esbati To: gusbrs Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands In-Reply-To: (gusbrs's message of "Mon, 8 Apr 2024 11:31:34 -0300") References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Tue, 09 Apr 2024 14:39:29 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Hi Gustavo, gusbrs writes: > Oh, reading the old thread was a little embarrassing. I didn't even > know how to reply to a mailing list (full html contents at the end, > etc., sigh... ;-). Wait another year or two, and you'll be writing Mails within Emacs ;-) > I did test things and the TL;DR is: looks good to me. Thanks, I installed that change on Emacs master, commit 7236010d2e. > I did not attempt to test for possible side effects in other areas, > given that `reftex-move-to-previous-arg' and `reftex-what-macro' are > general purpose utility functions. But I think the patch at hand is > pretty careful in changing the syntax of the parentheses only locally. > That's what I'd do too and my assessment is that I see no reason it > shouldn't be safe. Thanks, this is/was also my impression; hopefully no side-effects. > The only other thing of note I observed is that the mcite-like > citation commands are not fontified as reference/citation commands > (they get only the generic `font-latex-sedate-face'). I had agreed > with you that the case is tricky and arguably not worth the trouble on > RefTeX's side of things. But fontification for them should be trivial. > So, why not? Ok, I had another look, and biblatex manual says on page 120: In contrast to that, a biblatex entry set is an entity in its own right. So I think the change attached gives sort of support for mcite-like macros, incl. fontification. Do you want to give it a roll? Please ignore the re-indent changes. > Nice, perhaps something useful comes out of it. I'll share the code > first and comment later. Thanks, I will read through it later. I'd like to address the issues in this report and close it before we proceed. > I'm using `el-patch' in my config, but it should be easy enough to > read, even if you are not acquainted with it. Yes, I think I get the message. > Net of this kind of stuff are some things which accumulated over time, > to add support to specific packages, or fixing things I didn't like. > In hindsight, my general take on those is that RefTeX seems to presume > that only the standard, or very traditional, reference and citation > commands exist and, hence, chooses to hard-code most of the relevant > behavior, making it very hard to extend and tweak. Inaccessible to the > less daring users and, more importantly, to AUCTeX style files. Yes, this is true: RefTeX hardcodes plenty of stuff. > I recall you questioning somewhat the relevance of this peculiar > notation of biblatex's citation lists > (https://lists.gnu.org/archive/html/auctex-devel/2023-05/msg00015.html) > so, as a regular user of them, I'm glad and thankful to see you soften > a little your stance in this regard. TBH, I still don't want to touch font-latex.el in order to make fontification for cite-lists work, but we have an imperfect solution in place which hopefully is enough for you and other users :-) Again, thank you for your support. Best, Arash --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=biblatex.el.diff Content-Transfer-Encoding: quoted-printable diff --git a/style/biblatex.el b/style/biblatex.el index 31180226..7f9d4145 100644 --- a/style/biblatex.el +++ b/style/biblatex.el @@ -237,20 +237,56 @@ for citation keys." (TeX-argument-insert (mapconcat #'identity items ",") optional)) (setq noinsert t)))) =20 +;; Support for mcite-like Citation Commands, see =C2=A7 3.9.10 of Biblatex +;; reference manual. +(defun LaTeX-arg-biblatex-mcite (optional) + "Query and insert the mandatory argument of \\mcite compat macros." + (let ((set-name (TeX-read-string + (TeX-argument-prompt optional nil "Set"))) + (read-cite (lambda (opt) + (if (and (fboundp 'reftex-citation) + (fboundp 'reftex-plug-flag) + (reftex-plug-flag 3)) + (reftex-citation t) + (TeX-completing-read-multiple + (TeX-argument-prompt opt nil "Key(s)") + (LaTeX-bibitem-list))))) + cite-keys arg) + (cond ((and (not (string-empty-p set-name)) + (y-or-n-p "Add citation keys to the set name?")) + ;; We want \mcite{set-name,*key1,*key2,*key3} + (setq cite-keys (funcall read-cite optional)) + (when cite-keys + (setq cite-keys (mapcar (lambda (x) (concat "*" x)) + cite-keys))) + (setq arg (concat set-name + (when cite-keys + (concat "," (mapconcat #'identity + cite-keys + ",")))))) + ;; We want \mcite{key1}. FIXME: Are multiple keys + ;; allowed? + ((string-empty-p set-name) + (setq arg (mapconcat #'identity + (funcall read-cite optional) + ","))) + (t (setq arg ""))) + (TeX-argument-insert arg optional))) + (defun LaTeX-arg-biblatex-natbib-notes (optional) "Prompt for two note arguments of a natbib compat citation command." (when TeX-arg-cite-note-p - (let ((pre (TeX-read-string - (TeX-argument-prompt optional nil "Prenote"))) - (post (TeX-read-string - (TeX-argument-prompt optional nil "Postnote")))) - (TeX-argument-insert pre optional) - (TeX-argument-insert post optional) - ;; pre is given, post is empty: Make sure that we insert an - ;; extra pair of `[]', otherwise pre becomes post - (when (and pre (not (string=3D pre "")) - (string=3D post "")) - (insert LaTeX-optop LaTeX-optcl))))) + (let ((pre (TeX-read-string + (TeX-argument-prompt optional nil "Prenote"))) + (post (TeX-read-string + (TeX-argument-prompt optional nil "Postnote")))) + (TeX-argument-insert pre optional) + (TeX-argument-insert post optional) + ;; pre is given, post is empty: Make sure that we insert an + ;; extra pair of `[]', otherwise pre becomes post + (when (and pre (not (string=3D pre "")) + (string=3D post "")) + (insert LaTeX-optop LaTeX-optcl))))) =20 (TeX-add-style-hook "biblatex" @@ -334,32 +370,45 @@ for citation keys." (TeX-arg-completing-read-multiple (LaTeX-bibitem-list) "Keys")) ;;; Citation Commands '("cite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-arg-c= ite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Cite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-arg-c= ite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("parencite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Parencite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("footcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("footcitetext" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) T= eX-arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) ;; Style-specific Commands '("textcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Textcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("smartcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Smartcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("cite*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-arg-= cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("parencite*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX= -arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("supercite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) ;; Qualified Citation Lists '("cites" LaTeX-arg-biblatex-cites) '("Cites" LaTeX-arg-biblatex-cites) @@ -374,45 +423,62 @@ for citation keys." '("supercites" LaTeX-arg-biblatex-cites) ;; Style-independent Commands '("autocite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Autocite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("autocite*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Autocite*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("autocites" LaTeX-arg-biblatex-cites) '("Autocites" LaTeX-arg-biblatex-cites) ;; Text Commands '("citeauthor" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX= -arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Citeauthor" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX= -arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citeauthor*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) Te= X-arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Citeauthor*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) Te= X-arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citetitle" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citetitle*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX= -arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citeyear" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citeyear*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citedate" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citedate*" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("citeurl" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-ar= g-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("parentext" "Text") '("brackettext" "Text") ;; Special Commands '("fullcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("footfullcite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) T= eX-arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("volcite" (TeX-arg-conditional TeX-arg-cite-note-p (["Prenote"]) ()) "Volume" (TeX-arg-conditional TeX-arg-cite-note-p (["Page"]) ()) TeX-arg-cite) @@ -450,15 +516,20 @@ for citation keys." (TeX-arg-conditional TeX-arg-cite-note-p (["Prenote"]) ()) "Volume" (TeX-arg-conditional TeX-arg-cite-note-p (["Page"]) ()) TeX-arg-cite) '("notecite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Notecite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-a= rg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("pnotecite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("Pnotecite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) '("fnotecite" (TeX-arg-conditional TeX-arg-cite-note-p - (["Prenote"] ["Postnote"]) ()) TeX-= arg-cite) + (["Prenote"] ["Postnote"]) ()) + TeX-arg-cite) ;; Low-level Commands '("citename" (TeX-arg-conditional TeX-arg-cite-note-p (["Prenote"] ["Postnote"]) = ()) @@ -522,8 +593,8 @@ for citation keys." (list (car cmd) '(TeX-arg-conditional TeX-arg-cite-note-p - ([LaTeX-arg-biblatex-natbib-notes]) - nil) + ([LaTeX-arg-biblatex-natbib-notes]) + nil) #'TeX-arg-cite)))) cmds)) =20 @@ -540,6 +611,44 @@ for citation keys." ("Citealp" "*[[{")) 'biblatex)))) =20 + ;; =C2=A7 3.9.10 mcite-like Citation Commands + (when (or (LaTeX-provided-package-options-member "biblatex" "mcite") + (LaTeX-provided-package-options-member "biblatex" "mcite=3Dtr= ue")) + (let ((cmds '("mcite" "Mcite" + "mparencite" "Mparencite" + "mfootcite" "mfootcitetext" + "mtextcite" "Mtextcite" + "msupercite" + "mautocite" "Mautocite")) + (spec "*[[{")) + ;; Add the macros incl. optional arguments: + (apply #'TeX-add-symbols + (mapcar + (lambda (cmd) + (list cmd + '(TeX-arg-conditional TeX-arg-cite-note-p + (["Prenote"] ["Postnote"]) + nil) + #'LaTeX-arg-biblatex-mcite)) + cmds)) + ;; Cater for the starred versions as well: + (apply #'TeX-add-symbols + (mapcar + (lambda (cmd) + (list (concat cmd "*") + '(TeX-arg-conditional TeX-arg-cite-note-p + (["Prenote"] ["Postnote"]) + nil) + #'LaTeX-arg-biblatex-mcite)) + cmds)) + ;; Fontification for compat macros does not go into `font-latex.el': + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords (mapcar (lambda (cmd) + (list cmd spec)) + cmds) + 'biblatex)))) + (LaTeX-add-environments ;;; Bibliography commands ;; Bibliography Sections --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 10:34:31 2024 Received: (at 31132) by debbugs.gnu.org; 9 Apr 2024 14:34:32 +0000 Received: from localhost ([127.0.0.1]:51205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruCYK-0008CK-3O for submit@debbugs.gnu.org; Tue, 09 Apr 2024 10:34:31 -0400 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]:42051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruCYG-0008Ao-AW for 31132@debbugs.gnu.org; Tue, 09 Apr 2024 10:34:22 -0400 Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-dcc6fc978ddso4550284276.0 for <31132@debbugs.gnu.org>; Tue, 09 Apr 2024 07:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712673246; x=1713278046; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0kDRNXBq3yDp+/8Ql7S0r+e/uNL2aS/6WpcOt0vYFdc=; b=d5BoZbiYpVCjI4rUV+Z63PtoZ59NdKV+UJmE69nIhH+waL7ZunBesXRlvSDeNCsuMp YgiClQmxLjGTfSPaQm/d3QpX/P3D7HnBkrh7sI4xXkbHTehziVDN14jfy45mXJhE8mCS GINcyI6UQxrm2I3k9Mmf3uPve5OYB0HvAuAb+bn7oUebLyLNpeW1aUa9EkKMF5jSc4IV pGd/On1eUBIUQ5fOwSJQhpC+9XMiyYHUo4gKIfyxxAoWlrvGpRkD96BiKyPz3MBvpVLW qF7dE17KnPbAF/tzHRb3pWd4y4Tb0zLCJbu/DZoQwVo8Pl7pr11ySkkywlKoVje/kpRf 3GoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712673246; x=1713278046; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0kDRNXBq3yDp+/8Ql7S0r+e/uNL2aS/6WpcOt0vYFdc=; b=aLeio58PSlvDX3wlWEWfV5opNdUir8sdnIubA6ckbwJKhDlaPNJDf0+3SEGiNj0pOf 0Pg44+bQzsgvDNeaqGzrVJhDMWTsh+JbS7Aj4KDBvpG3GRV6CtxvyK+4E46+oOZ3FJlV MIMJqbBwJHROZ1olQncylFZc2al6Msc6TmC/GS+8qTbRoo0ZhUpPls/9ETnu6rxla9Qa anLmgPdEVDpfAMPwgQ6qiZzdnrLdcdw6uMzz/ChN4eanSxXXEqLNSs3JqDxz+F4s3eMZ liNpNIGopyfNihwFMBSYYf+T71Svj40N8ZD6UL5OYD1pNAtfFmR4H72Zv1xGAITZbW6l SBHw== X-Gm-Message-State: AOJu0YxxiWldVNxCpnyisneugJcc7iRhScE5zrsAieCHaLniR6cRjINx ESb5380mIQN3v0qmRA948JGAqZM0psfMWW2fk55/uWM13Ox9VkOA2WH9UXFcbvwcEkNtF287Hi4 SehHBuvBVlT8+My5ph9UJh29HYBQ= X-Google-Smtp-Source: AGHT+IHnQ7+iQhnJJ3BOsnlSUk7Fj5vroc2SqQ0iP04EsgJfW9jMb6D/Gi8vFj/zP3OQPuB+b4v//pSo/UAaiPeMOJw= X-Received: by 2002:a25:a3c5:0:b0:dc7:4988:6c77 with SMTP id e63-20020a25a3c5000000b00dc749886c77mr1876483ybi.21.1712673246443; Tue, 09 Apr 2024 07:34:06 -0700 (PDT) MIME-Version: 1.0 References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> In-Reply-To: From: gusbrs Date: Tue, 9 Apr 2024 11:33:55 -0300 Message-ID: Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands To: Arash Esbati Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, On Tue, 9 Apr 2024 at 09:39, Arash Esbati wrote: > Thanks, I installed that change on Emacs master, commit 7236010d2e. Great, thank you very much! I'm already looking forward to Emacs 30 now. :-) > > The only other thing of note I observed is that the mcite-like > > citation commands are not fontified as reference/citation commands > > (they get only the generic `font-latex-sedate-face'). I had agreed > > with you that the case is tricky and arguably not worth the trouble on > > RefTeX's side of things. But fontification for them should be trivial. > > So, why not? > > Ok, I had another look, and biblatex manual says on page 120: > > In contrast to that, a biblatex entry set is an entity in its own > right. > > So I think the change attached gives sort of support for mcite-like > macros, incl. fontification. Do you want to give it a roll? Please > ignore the re-indent changes. Oh, wow! You went far there. I had only thought of a simple `font-latex-add-keywords` for them when I mentioned. I did take it for a spin (light, but should be sufficient for this). And it does more than I'd expect, you are even handling the insertion of the sets. Fontification is fine too. For these macros, seldom used, macro insertion on the AUCTeX side with TeX-insert-macro is more than sufficient. Pretty good, looks good to me. Thank you! Sure, the peculiar bibkey notation still defeats `reftex-view-crossref', but... as previously discussed. > > Nice, perhaps something useful comes out of it. I'll share the code > > first and comment later. > > Thanks, I will read through it later. I'd like to address the issues in > this report and close it before we proceed. > > [...] > > Yes, this is true: RefTeX hardcodes plenty of stuff. Use this stuff as you see fit. As I said, just to get some ideas from. Discuss if you feel like it, but feel free to keep it to yourself too. I offered without giving it much thought, and it turned out to be quite a lot. Take it as an example of what an interested user had to do to add support to a few non-standard packages to this feature set in RefTeX. I doubt the general view emerging from it is any news to folks in this list, but sometimes a concrete example helps building perspective. I don't expect anything to come out of it, except perhaps be a useful food for thought to you. > TBH, I still don't want to touch font-latex.el in order to make > fontification for cite-lists work, but we have an imperfect solution in > place which hopefully is enough for you and other users :-) Fair, and understood. And, granted, this one is actually easy to handle on the user side (if one can live with a discrete warning face on the backslash). I just couldn't resist poking you a little bit about it. ;-) > Again, thank you for your support. I thank _you_! Best, gusbrs From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 15:52:47 2024 Received: (at 31132) by debbugs.gnu.org; 9 Apr 2024 19:52:47 +0000 Received: from localhost ([127.0.0.1]:51597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruHWR-0005jv-8s for submit@debbugs.gnu.org; Tue, 09 Apr 2024 15:52:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruHWO-0005iw-R8 for 31132@debbugs.gnu.org; Tue, 09 Apr 2024 15:52:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruHWB-0006ph-9r; Tue, 09 Apr 2024 15:52:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=wTJBXwaLJOAxC1HhOxf2UFV56FJhQdidO3qmpjg7jfA=; b=k/N3cuZwAXAR7zQawVF0 fngnF+NiHkIwp+aAAQ3X8CBCpTlMcmFu1Yu6X6aX5w58tJe/NcPV6NGv3VB2omkmGOpE+gvfBa4IJ 3r3Qd5tpurdJ6Wauvx5O8kPpnY2wKzST/aSg6LdpFP8fdej2XSEqag07m9MW6LInij37fIiJXCO6m 4ZJqZFfi60k9tAYR/Ye/jkzpGiSp3FB9yIXzsNiJ0DVrsU2gVH5GOK3Q8AQd0iwgJZXv6IFZBPBPU LptAy6J4AS+d9J4uWLYQcsrniIXZ++q/dIUWXsg9UQGGGfd7ojuSllUUodgCVXQe1ZwAcgL9C8Lak Z1jjE+wP69lHyg==; From: Arash Esbati To: gusbrs Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands In-Reply-To: (gusbrs's message of "Tue, 9 Apr 2024 11:33:55 -0300") References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Tue, 09 Apr 2024 21:52:25 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Gustavo, gusbrs writes: > For these macros, seldom used, macro insertion on the AUCTeX side with > TeX-insert-macro is more than sufficient. Pretty good, looks good to > me. Thank you! Thanks for testing, I installed that change on AUCTeX master with commit d9f8ff12b1. > I don't expect anything to come out of it, except perhaps be a useful > food for thought to you. I think we can find things which are useful for users, even for one single user. You just need to be patient :-) > I just couldn't resist poking you a little bit about it. ;-) That's a good habit, please don't stop that ;-) I think we have addressed all the issues in the original report, or am I missing something? Otherwise I'll close this report. Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 16:03:35 2024 Received: (at 31132) by debbugs.gnu.org; 9 Apr 2024 20:03:35 +0000 Received: from localhost ([127.0.0.1]:51602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruHgs-0006Qn-E8 for submit@debbugs.gnu.org; Tue, 09 Apr 2024 16:03:35 -0400 Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]:60561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruHgq-0006QI-W7 for 31132@debbugs.gnu.org; Tue, 09 Apr 2024 16:03:33 -0400 Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dc23bf7e5aaso6483984276.0 for <31132@debbugs.gnu.org>; Tue, 09 Apr 2024 13:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712692999; x=1713297799; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yV/4trC90Alm9nBtQjVDj//Otj/d6sA85hz5UMy5UKc=; b=M35AXfXg6dbNaHltGp9ULCOL26AUKo3tq466EAtuiW6NR2hTGkqRM1jPgLMQjlzdz5 yki9R5fAsQ4bsXHzFn8h42TOBFmol6Xm+0d18HXNSuiGa4gvjHbjBG0ueOXpnPNSlax/ xQZhx9IC8Atp4qB/gkO353NMTzTkgllCTlgN6unm2EReOiS5GK0fFFtHq1QjVzX/ahO3 znChxb7D+iy6OC2WWHzg8cCx24BTbhXIHd2ubi/4INQjGvSwSFIhRl3FAg5CXLEOKlhb 7HS/KPLL9mRtFseT4tAqkizZIoM8wkc+QVhD+hVLN3fY4jz4trE+hiS1hxDSGybxDp5L BN0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712692999; x=1713297799; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yV/4trC90Alm9nBtQjVDj//Otj/d6sA85hz5UMy5UKc=; b=h/bg1nS5m/Xe8kRYp0ZYJ+nQVPqpd65Kdsfe/kPs/k71xFCzhC8HgRYLx6vcJLuNw9 i7REGMO+hTUcgMhC9TbNwTCFZYT5FyaN4LaMa7+mllCMTcdVDhG0u1/MSk3xOxSfxUFk MVp46TwmtWgMPCAS/YKhoSuemj04jzs4LdIK52ckZUsQlnvwLRjeciGOZ74NChxBQJ0K bpwS95rbKstQs//xWkx27tyTgNekKa57xl/iuUBVRla3ebJY6t/uuPkYEB/nKo4XAlMr SoB2pNKfwmG9VF4XxkgLeY5BDMG3s5ffTZ0dekGivbk6OQDkcChjFSLm5wf/G0dGiVSB dmnw== X-Gm-Message-State: AOJu0YxwzK/1KBEuPn3OHu91spP7xEv534mTzJQ+pTdvyOg0Y2BCjE/B JktlDkdHsDYC8ul3cQ8+5JlcIsZH5X8BwFtRCFw5+YGZzlxhs6xSPCQCarYkCEc47r8gZD5sNqi 2qP7291ltp/MSV35/Ur49LGoFxkU= X-Google-Smtp-Source: AGHT+IGf8kwjJmznKcEKErQlFePOBjpExdBVESEgVdjM+sTn56WkgG7E4xztZdLqN5DZFVzlHIvY3ABzRYcp5ReKk8Q= X-Received: by 2002:a25:6e42:0:b0:dcd:af3f:c7fc with SMTP id j63-20020a256e42000000b00dcdaf3fc7fcmr802278ybc.9.1712692999106; Tue, 09 Apr 2024 13:03:19 -0700 (PDT) MIME-Version: 1.0 References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> In-Reply-To: From: gusbrs Date: Tue, 9 Apr 2024 17:03:08 -0300 Message-ID: Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands To: Arash Esbati Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31132 Cc: 31132@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, On Tue, 9 Apr 2024 at 16:52, Arash Esbati wrote: > I think we have addressed all the issues in the original report, or am I > missing something? Otherwise I'll close this report. I think so too, this one is good to close. Once again, thank you very much! Best, gusbrs From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 16:33:33 2024 Received: (at 31132-done) by debbugs.gnu.org; 9 Apr 2024 20:33:33 +0000 Received: from localhost ([127.0.0.1]:51619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruI9t-0008IR-AI for submit@debbugs.gnu.org; Tue, 09 Apr 2024 16:33:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruI9r-0008Hm-Ev for 31132-done@debbugs.gnu.org; Tue, 09 Apr 2024 16:33:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruI9d-0005EI-Qj; Tue, 09 Apr 2024 16:33:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=HiTflsASr4Sovjj4NG5adwxe3ezb2yzuFsoQWXahMAY=; b=rL8gZ9RgKwWJGMxO9918 F3QI0urcSLIbWeBAwD1uho139EKpqjbyCfjv8jdCJ/EEMdrh1KhacH8CbZd03VWx4sOmHyLigYuyJ lXVZ/g6RpiNKk8M75iUGUeRkpYQt26uxrJbUns5LuMZszoAzTAxnPORP5Rjgp7V/P8ceVsO0JhXaV byF/406kTYf8sMLx5JMz/Jzn5BOwUc83Cz8YG/f4Rx4Unnb4nDMdN9No1Nb2PFQ3vGfNMGDyJF5Tp XkShEopFLtH0oqwBJuwcxXeVxZ7mPQnweq1QOXrWE5E0HosyrjvK7gH4pHNOevvd+QQArExHwD9ig H+EaNU1tl9QF6g==; From: Arash Esbati To: gusbrs Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands In-Reply-To: (gusbrs's message of "Tue, 9 Apr 2024 17:03:08 -0300") References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Tue, 09 Apr 2024 22:33:11 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31132-done Cc: 31132-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) gusbrs writes: > I think so too, this one is good to close. Once again, thank you very > much! You're welcome, and thank you for your support. I think we will go on with discussion about your proposals on auctex-devel. For now, I'm closing this report. Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 16:52:38 2024 Received: (at 31132-done) by debbugs.gnu.org; 9 Apr 2024 20:52:38 +0000 Received: from localhost ([127.0.0.1]:51644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruISM-0001BD-4r for submit@debbugs.gnu.org; Tue, 09 Apr 2024 16:52:38 -0400 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]:45068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruISH-0001AR-PA for 31132-done@debbugs.gnu.org; Tue, 09 Apr 2024 16:52:37 -0400 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-617d25b2bc4so47901257b3.2 for <31132-done@debbugs.gnu.org>; Tue, 09 Apr 2024 13:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712695940; x=1713300740; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mNzhuV/f/9RZSBiql+DLSZSL5biGtfm+xzJUFYcne5s=; b=i9/jwk7zgCE4eQk8mOoKSB2ogI1zJBIwNV4scGKx3nve+TomaAoAu8mNJgd9MCN2oj TqqsbVO4WQnGTstYwRUOIW1Q1slYQpLo547T8cXYLklAHmiYxI6Daqesz6jlSPo/DV9B WOjrQSCzazGXWOe7jfxmAFUpYV9geR/H99ymZ8aV8CRqEUyN5ip2HYju1KqYqYCsWSA0 sRSRLCs1FXPa8O/a4bssdI/KebtvZ+IBv/o/QMQxOQdFpXNkbMFnrQntXTCvQskw7RQ/ yyW58d7TdTNc+AwodudLMOeOi6CvORNGh2UvBEzUzgRU3wkjZfd+Wzs6+7p/aEfm8lxv gw/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712695940; x=1713300740; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mNzhuV/f/9RZSBiql+DLSZSL5biGtfm+xzJUFYcne5s=; b=VkWK7mGGfobZXNiGy38aAcU7jvpw5MpFbC0ngZd2daPfv/mVSxho8jtyITu3TC82lQ xND/QbCprFJaTpe6pbst928ubZpsq93J3NQGqkP9SWnopd3qhG3yQTW9OHJUSE2kAMrv jmxLbIzT5h2/GY+85VHLyefMB9AIA89vK+pJsVKlcHwRUwbw8LUXvjvm/lG0Uar2W4ec QzjAhHVi7xisMpfBz1i9wx/1BG/Cp2wkTvenTN6lAUE04fInSYqxFGPVm9bz7YkRSW3J Kh6eBsT5FE/TAkgjcUDvvwpWWHWeRO5xDafNCm1ctYpxYmG/QpMeORnlmiC89EEwrEDa lmWQ== X-Gm-Message-State: AOJu0Yy/o3ZEDPJHe1mILnKQ2cOqbc5zbYnvKs/ocbeITZjkCMt9vECB beFna4+MwoH5HcuK4epdodmCO/VxkqC0BNZfJ1kXsTjyhDqvtXCrb2w+oXvkgyXjaoD7PArMdn0 hjpRbUK7o0KY/AoNjnNyWrCCruP1XqfVY2IM= X-Google-Smtp-Source: AGHT+IEenhRdFJuXzWrDC5n/x9Uf+oL4f82E2ZSMu5wwdT629KnNRzcHVi9StFSmy4Rwco5EhPQOx+4MlHaoIVFvxDQ= X-Received: by 2002:a5b:b45:0:b0:d80:68d1:b826 with SMTP id b5-20020a5b0b45000000b00d8068d1b826mr1038469ybr.6.1712695939720; Tue, 09 Apr 2024 13:52:19 -0700 (PDT) MIME-Version: 1.0 References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> In-Reply-To: From: gusbrs Date: Tue, 9 Apr 2024 17:52:08 -0300 Message-ID: Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands To: Arash Esbati Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31132-done Cc: 31132-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, On Tue, 9 Apr 2024 at 17:33, Arash Esbati wrote: > I think we will go on > with discussion about your proposals on auctex-devel. Please CC me if/when you do so. Cheers! From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 17:07:42 2024 Received: (at 31132-done) by debbugs.gnu.org; 9 Apr 2024 21:07:42 +0000 Received: from localhost ([127.0.0.1]:51661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruIgv-0002A5-Oq for submit@debbugs.gnu.org; Tue, 09 Apr 2024 17:07:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruIgu-00029h-Dp for 31132-done@debbugs.gnu.org; Tue, 09 Apr 2024 17:07:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruIgg-0002N6-Q3; Tue, 09 Apr 2024 17:07:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=XhL/2KZ1gR4WuCkNv+5PBB9cQjRSNx81Ap0XgHyLuYg=; b=Xi/wZa5bsUgjcoKZOQ+s ut1/t0Va/5kiAAA4sGSvyrLghHE719T/tdg3Y1g6225Nqd9UrEdLKiYfW6dIVvezB8FV5f5mdudAr IBhRzbmqvZKpF3POekZa0ijF8hgbQB70IYb8BFl6vki2AvA3A5zv7hez6LvleiGmv7UujAmhDzj5U JILmdi20dfdFDp5YXYBbWkoW6RA49OHz2p2MxKlXb2rKS7xHTh4Dsrr4/AMXHnPS/Qn1mxI/2BkPV ys9fSK1a/OSlTDkrPLeeERrInAaQHEm1VoV4T9oJBXbU/rG2EhFWQ4K3mGXBkjmufjL00b7qAXd4D TwXUu06dUGtlrw==; From: Arash Esbati To: gusbrs Subject: Re: bug#31132: AUCTeX, RefTeX and biblatex's multicite commands In-Reply-To: (gusbrs's message of "Tue, 9 Apr 2024 17:52:08 -0300") References: <2040bd1a-7ee5-d7eb-a546-f35b66697686@gmail.com> <867ep3q8sw.fsf@gnu.org> <280a40e2-24ee-e2f7-12ef-e46fc779d133@gmail.com> Date: Tue, 09 Apr 2024 23:07:22 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31132-done Cc: 31132-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) gusbrs writes: > On Tue, 9 Apr 2024 at 17:33, Arash Esbati wrote: > >> I think we will go on >> with discussion about your proposals on auctex-devel. > > Please CC me if/when you do so. No worries :-) From unknown Mon Jun 23 13:07:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 08 May 2024 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator