From unknown Sat Sep 20 21:09:15 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#64921 <64921@debbugs.gnu.org> To: bug#64921 <64921@debbugs.gnu.org> Subject: Status: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX Reply-To: bug#64921 <64921@debbugs.gnu.org> Date: Sun, 21 Sep 2025 04:09:15 +0000 retitle 64921 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX reassign 64921 auctex submitter 64921 Gustavo Barros severity 64921 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 28 16:12:14 2023 Received: (at submit) by debbugs.gnu.org; 28 Jul 2023 20:12:14 +0000 Received: from localhost ([127.0.0.1]:46174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPTos-0005Wu-87 for submit@debbugs.gnu.org; Fri, 28 Jul 2023 16:12:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:33020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPToq-0005Wg-7e for submit@debbugs.gnu.org; Fri, 28 Jul 2023 16:12:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPTok-0006GQ-K1 for bug-auctex@gnu.org; Fri, 28 Jul 2023 16:12:06 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qPToi-0006b0-Ep for bug-auctex@gnu.org; Fri, 28 Jul 2023 16:12:06 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-563e6524aaeso1428685a12.0 for ; Fri, 28 Jul 2023 13:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690575122; x=1691179922; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=N4nFw1IHMl0kuofTPONgIht5dMoG3v5WM3ZHhurnA1A=; b=dwpFGXMlqgbQsGalWwsbLH2+nno/fP+i+Ae+gvfoI8bCwDF9v1AZfgjZk5CVM3PemL H9UzJC/Te14hqDiIU3MGM0j40YgMpB1Jx/v3C32wt8/NrNVlw9aPsCDCJ9ZUrZQHkTaX LKlRo59pWLHYHsmvc/YsTcY55o1wIGKyx2XsGsnL/httwvId/aUORVWiQ3jZdS7lZw0o CEJu1S1SN2spiZktFaraB4lj0xc/O6C7H4lk5ck6MOZsTE0adJbsmfoqcn+RD82JvmMW ZV/+ny//y6Rdohy2oRFEPzuyEC3VJSK+dr8LVVtQx1wXzYP7MX/NP6BExgofIzYHsA+j i26w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690575122; x=1691179922; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=N4nFw1IHMl0kuofTPONgIht5dMoG3v5WM3ZHhurnA1A=; b=Ekq/mhWYOuzXNIpbZjMzUzvhmDLeHBEvim2hl95v3VjaXfFuIZEt7EJdzErsd8pqzo 8ySw+ZxPuTU5RKJxJtEJQ10SMsdupo8e+Ha56vlTYMbX0PnAy2U4KhOIB3CwfxQ8tYYa PWkRYFoDGXCiBuBE0aUIfZT6zMJ31ZrA4NMAcA+zwqMaPygx7qcgb0ziw9MWewuyG4e6 Z24CBgGNtVpFynDNC5QBmoIidVGq4OnBW14hgpP8/SqtLCnl9Sofn2DmiVB7wI+O06fH q477vvj+9KYKzrk1XTw8J7WD4FhnwroMo1NZtSycWO73rWjQFWAliC2ev1XAIi3yp1CG ci1Q== X-Gm-Message-State: ABy/qLa5VajYLJ3pdlHfbyLUNYOu0N8coxzhaXaKpQ1myC9CZ9Q9aWdb KCQ3K3+9iHDAgtajVOlS4Vu7W6Wqk264pm8QDZNsa6kVbRU= X-Google-Smtp-Source: APBJJlEhIgoZwPcBecLlqhItVthLLWi/EiV3R77WxXJARhZmM2488+eg5dQF4M/CjAg25On2eKTxZrMJ/JcRu0E8c3k= X-Received: by 2002:a17:90a:46c7:b0:262:e742:f40a with SMTP id x7-20020a17090a46c700b00262e742f40amr2042233pjg.44.1690575121670; Fri, 28 Jul 2023 13:12:01 -0700 (PDT) MIME-Version: 1.0 From: Gustavo Barros Date: Fri, 28 Jul 2023 17:11:50 -0300 Message-ID: Subject: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX To: bug-auctex@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=gtvbrs@gmail.com; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HK_RANDOM_ENVFROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit 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.0 (/) Hi All, I might be missing something obvious on this one, but I couldn't figure out a way to do it and as far as I understand the code, I see no way to break the loop in `LaTeX-arg-biblatex-cites'. So I report. When RefTeX is plugged into AUCTeX, trying to insert a `biblatex' citation list with `TeX-insert-macro' will call `LaTeX-arg-biblatex-cites' and, as far as I can tell, there is no way to tell that function no further arguments are required. For sure, one can interrupt the cycle from the call to `reftex-citation' with "C-g" or "q", but then one also loses the citation altogether making the attempt futile. To reproduce starting with `emacs -Q'. Some setup: #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/elpa/auctex-13.2.1") (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) (setq reftex-use-external-file-finders t) #+end_src Visit a file with contents: #+begin_src latex \documentclass{article} \usepackage{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} \end{document} #+end_src Now, use `TeX-insert-macro' to insert a biblatex qualified citation list, say `\cites': "C-c RET cites RET". You are prompted for a regexp, as usual, you can enter it, get a list of results, select one with RET. And, you are prompted again for a new regexp, you can enter it and select a new candidate, etc. etc. The only chance you get to break the loop is at the regexp prompt, where you can leave it with "C-g" or "q", but then you lose the whole citation command, which is deleted. Indeed, the loop in `LaTeX-arg-biblatex-cites' takes the form: #+begin_src emacs-lisp (while items ;; ... handling of optional arguments (setq items (if (and (fboundp 'reftex-citation) (fboundp 'reftex-plug-flag) (reftex-plug-flag 3)) ;; Use RefTeX when enabled. (reftex-citation t) ;; Multiple citation keys in each argument are allowed. (TeX-completing-read-multiple (TeX-argument-prompt optional prompt "Key(s)") (LaTeX-bibitem-list)))) ;; ... macro/argument is inserted, but value of `items' is left untouched ) #+end_src So, since `items' is not touched after it is set with `(reftex-citation t)', leaving the loop would require a way for `reftex-citation's UI to return nil. I don't see how. But, again, I may be missing something... Best regards, Gustavo. Emacs : GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2023-07-23 Package: 13.2.1 current state: ============== (setq AUCTeX-date "2023-07-20" window-system 'x LaTeX-version "2e" TeX-style-path '("~/.emacs.d/auctex" "/home/gustavo/.emacs.d/elpa/auctex-13.2.1/style" "/home/gustavo/.emacs.d/auctex/auto" "/home/gustavo/.emacs.d/auctex/style" "auto" "style") TeX-auto-save t TeX-parse-self t TeX-master t TeX-command-list '(("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %(output-dir) %t" TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX") ("LaTeX" "%`%l%(mode)%' %T" TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") ("Makeinfo" "makeinfo %(extraopts) %(o-dir) %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info output") ("Makeinfo HTML" "makeinfo %(extraopts) %(o-dir) --html %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML output") ("AmSTeX" "amstex %(PDFout) %`%(extraopts) %S%(mode)%' %(output-dir) %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX") ("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt once") ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until completion") ("BibTeX" "bibtex %(O?aux)" TeX-run-BibTeX nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode context-mode) :help "Run BibTeX") ("Biber" "biber %(output-dir) %s" TeX-run-Biber nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run Biber") ("Texindex" "texindex %s.??" TeX-run-command nil (texinfo-mode) :help "Run Texindex") ("Texi2dvi" "%(PDF)texi2dvi %t" TeX-run-command nil (texinfo-mode) :help "Run Texi2dvi or Texi2pdf") ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file") ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible TeX-queue-command) ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Generate PostScript file") ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Convert DVI file to PostScript") ("Dvipdfmx" "dvipdfmx -o %(O?pdf) %d" TeX-run-dvipdfmx nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Convert DVI file to PDF with dvipdfmx") ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Convert PostScript file to PDF") ("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run makeglossaries to create glossary file") ("Index" "makeindex %(O?idx)" TeX-run-index nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run makeindex to create index file") ("upMendex" "upmendex %(O?idx)" TeX-run-index t (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run upmendex to create index file") ("Xindy" "texindy %s" TeX-run-command nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run xindy to create index file") ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for correctness") ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for common mistakes") ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files") ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files") ("Other" "" TeX-run-command t t :help "Run an arbitrary command")) ) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 12 01:21:03 2023 Received: (at 64921) by debbugs.gnu.org; 12 Aug 2023 05:21:03 +0000 Received: from localhost ([127.0.0.1]:48420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUh3e-0000Wt-Op for submit@debbugs.gnu.org; Sat, 12 Aug 2023 01:21:03 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:51592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUh3c-0000WM-FO for 64921@debbugs.gnu.org; Sat, 12 Aug 2023 01:21:01 -0400 Received: from localhost (p887025-ipngn4201yosida.nagano.ocn.ne.jp [114.175.41.25]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 7BA745C; Sat, 12 Aug 2023 14:20:59 +0900 (JST) From: Ikumi Keita To: Gustavo Barros Subject: Re: bug#64921: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX In-reply-to: References: Comments: In-reply-to Gustavo Barros message dated "Fri, 28 Jul 2023 17:11:50 -0300." X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29417.1691817652.1@localhost> Date: Sat, 12 Aug 2023 14:20:52 +0900 Message-ID: <29418.1691817652@localhost> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64921 Cc: 64921@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 Gustavo, sorry for late reply. >>>>> Gustavo Barros writes: > When RefTeX is plugged into AUCTeX, trying to insert a `biblatex' > citation list with `TeX-insert-macro' will call > `LaTeX-arg-biblatex-cites' and, as far as I can tell, there is no way > to tell that function no further arguments are required. For sure, > one can interrupt the cycle from the call to `reftex-citation' with > "C-g" or "q", but then one also loses the citation altogether making > the attempt futile. > To reproduce starting with `emacs -Q'. Some setup: > #+begin_src emacs-lisp > (add-to-list 'load-path "~/.emacs.d/elpa/auctex-13.2.1") > (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) > (setq reftex-use-external-file-finders t) > #+end_src > Visit a file with contents: > #+begin_src latex > \documentclass{article} > \usepackage{biblatex} > \addbibresource{biblatex-examples.bib} > \begin{document} > \end{document} > #+end_src > Now, use `TeX-insert-macro' to insert a biblatex qualified citation > list, say `\cites': "C-c RET cites RET". You are prompted for a > regexp, as usual, you can enter it, get a list of results, select one > with RET. And, you are prompted again for a new regexp, you can enter > it and select a new candidate, etc. etc. The only chance you get to > break the loop is at the regexp prompt, where you can leave it with > "C-g" or "q", but then you lose the whole citation command, which is > deleted. I can confirm the reported behavior. > Indeed, the loop in `LaTeX-arg-biblatex-cites' takes the form: > #+begin_src emacs-lisp > (while items > ;; ... handling of optional arguments > (setq items (if (and (fboundp 'reftex-citation) > (fboundp 'reftex-plug-flag) > (reftex-plug-flag 3)) > ;; Use RefTeX when enabled. > (reftex-citation t) > ;; Multiple citation keys in each argument are allowed. > (TeX-completing-read-multiple > (TeX-argument-prompt optional prompt "Key(s)") > (LaTeX-bibitem-list)))) > ;; ... macro/argument is inserted, but value of `items' is left untouched > ) > #+end_src > So, since `items' is not touched after it is set with > `(reftex-citation t)', leaving the loop would require a way for > `reftex-citation's UI to return nil. I don't see how. But, again, I > may be missing something... Your analysis seems right. I don't come up with a good solution yet. However, most users would type C-c [ to use `reftex-citation' directly, which works without the reported issue. Thus I expect the importance of this bug is low enough. If it doesn't actually harm users, "won'tfix" would be a suitable treatment to this bug. What do you think? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 12 06:59:03 2023 Received: (at 64921) by debbugs.gnu.org; 12 Aug 2023 10:59:03 +0000 Received: from localhost ([127.0.0.1]:48815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUmKl-0006EF-1V for submit@debbugs.gnu.org; Sat, 12 Aug 2023 06:59:03 -0400 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]:42306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUmKj-0006Dc-MZ for 64921@debbugs.gnu.org; Sat, 12 Aug 2023 06:59:02 -0400 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6bd092cba5dso1808610a34.1 for <64921@debbugs.gnu.org>; Sat, 12 Aug 2023 03:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691837936; x=1692442736; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ya85lNQVB5tULSqIOAjGZoVDZFWZxMVn6v/eUQTr77g=; b=kQVsU+aHL5ijQ8tn43TcWLw2dRyrT3do0lNgbKmaoLoGH15YPqD0VGEbXnHggKgz7x lMtQD0a3tjpgPWwpAylqNva7zwjNl7yi2LC1poo3fNBDOH4TWG1jxu8VRrHyxq2gqNvg Z4W2kjVS/DXfwHhhGcr5Xhhv+84gvI+6AIuiBtx87diXkFDmmPDVHpMIEmCJR+yuSvxX BJbZVlv7fIq0MKN5AXOj7sQiS6QEgWxYbokT+U0YDsnR+WXSD7rxOnz//7trg6UuqqMK NGMjAY2Mmsllkk3WgvQD3TU5V4ujNIQONufZcxYyRP15VhoMoWC12xCTk+1r9M3PHGG7 DT0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691837936; x=1692442736; 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=Ya85lNQVB5tULSqIOAjGZoVDZFWZxMVn6v/eUQTr77g=; b=iAfaXNPivfhQ07Af8+idhtY+ewl7awRDWY/uRfcj90/Knj5Klw2OwnLaiOczZKVu/d Pq7TwbBDe5fl2iuN1AkYpU9MjzYVLIN7LvYQySwFIALN1Fprh+LcUvppIHEOTuK8gZdc PFQkXlqhxNsB+YmTEGoqVQEI59CatydGdyvDmoDEWdGagcL0vmHpbI4Ugy1ETDnjCISA RJxlbVaKHwC6a8xTZz1Nbm/BEDyTberzIMdUAF0vKHPSHzDp75TIWBB9xNvDofRT1eIP 5YA3OSO29+MNm5okC6aaXoxb5qBgKp3nV5WG7Gn3C0OWWox85NzWNIyoyr0CRP0WrKgU +0MA== X-Gm-Message-State: AOJu0YytxIqemAAy0qlJbc/Vg8kDcnsKqcCQ+iXyZteDNqbmDcW9fdIj kIVsDT3/wacSCXhU4wrGQBcggqAYH7/rnhqup23OsjsJJEQv1Q== X-Google-Smtp-Source: AGHT+IHZSTwO48Xh0Vu9bzBsr6/SllcmK8NXBkXeaCPiMBTWfsFzzgDKjUaZeDdfgUhU37HlFSwzEubi0AK/Sxl9qUs= X-Received: by 2002:a9d:749a:0:b0:6b9:a91c:d1e with SMTP id t26-20020a9d749a000000b006b9a91c0d1emr2542232otk.13.1691837935871; Sat, 12 Aug 2023 03:58:55 -0700 (PDT) MIME-Version: 1.0 References: <29418.1691817652@localhost> In-Reply-To: <29418.1691817652@localhost> From: Gustavo Barros Date: Sat, 12 Aug 2023 07:58:44 -0300 Message-ID: Subject: Re: bug#64921: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX To: Ikumi Keita Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64921 Cc: 64921@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 Keita, On Sat, 12 Aug 2023 at 02:21, Ikumi Keita wrote: > > I can confirm the reported behavior. > Thanks for checking and looking into this. > > Indeed, the loop in `LaTeX-arg-biblatex-cites' takes the form: > > #+begin_src emacs-lisp > > (while items > > ;; ... handling of optional arguments > > (setq items (if (and (fboundp 'reftex-citation) > > (fboundp 'reftex-plug-flag) > > (reftex-plug-flag 3)) > > ;; Use RefTeX when enabled. > > (reftex-citation t) > > ;; Multiple citation keys in each argument are allowed. > > (TeX-completing-read-multiple > > (TeX-argument-prompt optional prompt "Key(s)") > > (LaTeX-bibitem-list)))) > > ;; ... macro/argument is inserted, but value of `items' is left untouched > > ) > > #+end_src > > So, since `items' is not touched after it is set with > > `(reftex-citation t)', leaving the loop would require a way for > > `reftex-citation's UI to return nil. I don't see how. But, again, I > > may be missing something... > > Your analysis seems right. I don't come up with a good solution yet. > However, most users would type C-c [ to use `reftex-citation' directly, > which works without the reported issue. Thus I expect the importance > of this bug is low enough. > > If it doesn't actually harm users, "won'tfix" would be a suitable > treatment to this bug. What do you think? That would be disappointing. The sole purpose of this function is to handle the insertion of arguments of citation lists and it doesn't work with RefTeX? Also, I respectfully disagree with the assessment that "it doesn't actually harm users". Indeed, `reftex-citation' is very convenient, and also my favorite, but it is not a full replacement for `TeX-insert-macro' for citation commands. `biblatex' has over 50 citation commands, and `reftex-citation's dispatcher would become impractical if we actually tried to have them all available there. It is great for our most used ones, but for those odd birds, we still need `TeX-insert-macro'. Regarding what to do, I see two ways to handle it. Either make "q"/"C-g" not delete the citation when leaving, or simply not loop, handling just the first bibkey. Perhaps there's good reason why "q"/"C-g" reverts the whole operation. But it cannot be too difficult simply not to loop at `LaTeX-arg-biblatex-cites'. And that is actually how `reftex-citation' works for citation lists, it only inserts the first argument. In my experience, trying to use `biblatex' citation lists with AUCTeX+RefTeX is an uphill battle. This task is probably the single largest source of patches I must maintain in my config. I'm ready to agree that the syntax of these citation macros are unfortunate, both because they may take an arbitrary number of arguments and because they use parentheses for the global pre/postnotes. The latter alone is enough to beat `reftex-what-macro' and put RefTeX in a good deal of trouble. I don't know, it is true that the case is tricky. But what I've been getting of late in related reports is that it is "not relevant", or "not relevant enough". Is it true though that `biblatex's citation lists don't deserve better support? Best regards, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 15 02:18:28 2023 Received: (at 64921) by debbugs.gnu.org; 15 Aug 2023 06:18:28 +0000 Received: from localhost ([127.0.0.1]:34859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVnNr-0000Wx-Oy for submit@debbugs.gnu.org; Tue, 15 Aug 2023 02:18:28 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:57162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVnNp-0000Wm-BO for 64921@debbugs.gnu.org; Tue, 15 Aug 2023 02:18:26 -0400 Received: from localhost (p887025-ipngn4201yosida.nagano.ocn.ne.jp [114.175.41.25]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 2DABA62; Tue, 15 Aug 2023 15:18:23 +0900 (JST) From: Ikumi Keita To: Gustavo Barros Subject: Re: bug#64921: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX In-reply-to: References: <29418.1691817652@localhost> Comments: In-reply-to Gustavo Barros message dated "Sat, 12 Aug 2023 07:58:44 -0300." X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Tue, 15 Aug 2023 15:18:22 +0900 Message-ID: <1967.1692080302@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64921 Cc: 64921@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 (-) --=-=-= Content-Type: text/plain Hi Gustavo, >>>>> Gustavo Barros writes: > Also, I respectfully disagree with the assessment that "it doesn't > actually harm users". Indeed, `reftex-citation' is very convenient, > and also my favorite, but it is not a full replacement for > `TeX-insert-macro' for citation commands. `biblatex' has over 50 > citation commands, and `reftex-citation's dispatcher would become > impractical if we actually tried to have them all available there. It > is great for our most used ones, but for those odd birds, we still > need `TeX-insert-macro'. Hmm. I know almost nothing about biblatex, so I didn't know that. Thanks. > Regarding what to do, I see two ways to handle it. Either make > "q"/"C-g" not delete the citation when leaving, or simply not loop, > handling just the first bibkey. Perhaps there's good reason why > "q"/"C-g" reverts the whole operation. But it cannot be too difficult > simply not to loop at `LaTeX-arg-biblatex-cites'. And that is actually > how `reftex-citation' works for citation lists, it only inserts the > first argument. Thank you for suggestion. Does the attached patch give you good results? (By the way, the reason that "q"/"C-g" deletes the trace of the previous input is that `TeX-insert-macro' introduced `atomic-change-group' a year ago[1].) [1] Thread beginning with https://lists.gnu.org/r/auctex-devel/2022-08/msg00057.html Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=patch Content-Description: no-loop diff --git a/style/biblatex.el b/style/biblatex.el index 3254ce85..3160e074 100644 --- a/style/biblatex.el +++ b/style/biblatex.el @@ -203,8 +203,8 @@ for citation keys." (TeX-argument-insert (TeX-read-string (TeX-argument-prompt t nil "Global postnote")) (equal prenote "")))) - (let ((items t) (noinsert nil)) - (while items + (let ((items t) (noinsert nil) (reftex--done nil)) + (while (and items (not reftex--done)) ;; Prompt for prenote and postnote of the current keys. (and TeX-arg-cite-note-p (not current-prefix-arg) (let ((TeX-arg-opening-brace "[") @@ -221,7 +221,9 @@ for citation keys." (fboundp 'reftex-plug-flag) (reftex-plug-flag 3)) ;; Use RefTeX when enabled. - (reftex-citation t) + (prog1 + (reftex-citation t) + (setq reftex--done t)) ;; Multiple citation keys in each argument are allowed. (TeX-completing-read-multiple (TeX-argument-prompt optional prompt "Key(s)") --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 15 10:49:15 2023 Received: (at 64921) by debbugs.gnu.org; 15 Aug 2023 14:49:15 +0000 Received: from localhost ([127.0.0.1]:36439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVvMB-0008Am-3Q for submit@debbugs.gnu.org; Tue, 15 Aug 2023 10:49:15 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]:52552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVvM6-0008AW-Pu for 64921@debbugs.gnu.org; Tue, 15 Aug 2023 10:49:13 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-56ccdb2c7bbso3813683eaf.1 for <64921@debbugs.gnu.org>; Tue, 15 Aug 2023 07:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692110945; x=1692715745; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/YJl7xzeIc7YBIZ7uy8VimluxOtB+qGNrRhX5zK5Sdo=; b=gScHnxQmc3rghR08X8AHe2NqhHzLjS+tETpP0IlqlauiHkiosQU2j1BcgNlQB37Gx9 5KAI6kYsKXLTgT4WOrBpzOQo/TAVO8mXLVHP5l57Sx+fCavdHG4uOIxtF0BdzWqMsYTO IBOD2QrRMkvSUcLL8IezIz4RBJg28Xm8xaYg1uXT69Iq7xbrOpPWopJ5ZFP95LyDCskT 4Z7lbArHBohBQy+WGxlO78ZVs5yT3QT7/pggWllTm4gRP9bjpQyOut84bMOq86wSpuPy Sgah+g5nCGK15OrJZwOBFl3ooC3JLAeMLAPY1JNgVK2a64wrfG15EERr8aUbuXrXjkFt z3TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692110945; x=1692715745; 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=/YJl7xzeIc7YBIZ7uy8VimluxOtB+qGNrRhX5zK5Sdo=; b=gJlcQRK4E7V1Fd47PVGYIDcP+ysVw34rNSXhoh9KxN8soxssVuVRxZUYFYYtv5IgVO WKjS/CfMngedm3clCXK0OHhFZZSaYp131zPP6p6JqSXKj/xDbal1WNNooaj8EhaeOIGT RGMRv14oDyaTvgENU1Ntzn82ORrT2+QliczAimHW9Z0GboZf3k/lNf/I3YI50SquxLwD ysmlbzy+WoaiQuR/eckEVGLzbghGvabLOU6gA+6mWtt8h4ee/j6OP90FJklFC/hsiJPL 8S+Znf3MN7FeQ3KW7jagOySveFY/wjzLfqLuY9j88ARRNQIpqvg/r/lytLfAdkbIngJj Ro/g== X-Gm-Message-State: AOJu0Yx3SDe+bb+Z92nGM/kOnPkPW9nFAB/bQkXDZidtjKhwKSm6iN1A 4D/fvSvwT4COyOwfEJM8Easr5TvwuYIscbkpyQmm+JkQpY7jtw== X-Google-Smtp-Source: AGHT+IHlZPpz5OAJRrtsS2UKwqayW6grKa7WX61I4/rzeJByjO9547by2AWMrmK6OVU3z9MvnkVcK85bDQn+Dxe/u7k= X-Received: by 2002:a05:6870:31c5:b0:1bf:2e81:e1e1 with SMTP id x5-20020a05687031c500b001bf2e81e1e1mr13407311oac.33.1692110944986; Tue, 15 Aug 2023 07:49:04 -0700 (PDT) MIME-Version: 1.0 References: <29418.1691817652@localhost> <1967.1692080302@localhost> In-Reply-To: <1967.1692080302@localhost> From: Gustavo Barros Date: Tue, 15 Aug 2023 11:48:53 -0300 Message-ID: Subject: Re: bug#64921: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX To: Ikumi Keita Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64921 Cc: 64921@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 Keita, On Tue, 15 Aug 2023 at 03:18, Ikumi Keita wrote: > > Thank you for suggestion. Does the attached patch give you good results? > It behaves the same as `reftex-citation`, so it looks good to me. Thank you very much! > (By the way, the reason that "q"/"C-g" deletes the trace of the previous > input is that `TeX-insert-macro' introduced `atomic-change-group' a year > ago[1].) I see. The thread does not actually cover the reason for the change, but it makes sense. Also, I don't know why "q" (`reftex-select-quit') counts as "abnormal exit" or if it really should, given that now `TeX-insert-macro' uses `atomic-change-group'. But, given the patch you provided, the difference is arguably inconsequential (at least for the case at hand). Best regards, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 17 03:25:06 2023 Received: (at 64921) by debbugs.gnu.org; 17 Aug 2023 07:25:06 +0000 Received: from localhost ([127.0.0.1]:42689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWXNS-0005GU-Jy for submit@debbugs.gnu.org; Thu, 17 Aug 2023 03:25:06 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:34028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWXNP-0005G1-AG for 64921@debbugs.gnu.org; Thu, 17 Aug 2023 03:25:04 -0400 Received: from localhost (42-144-34-11.rev.home.ne.jp [42.144.34.11]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 183F65C; Thu, 17 Aug 2023 16:25:01 +0900 (JST) From: Ikumi Keita To: Gustavo Barros Subject: Re: bug#64921: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX In-reply-to: References: <29418.1691817652@localhost> <1967.1692080302@localhost> Comments: In-reply-to Gustavo Barros message dated "Tue, 15 Aug 2023 11:48:53 -0300." X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8216.1692257096.1@localhost> Date: Thu, 17 Aug 2023 16:24:57 +0900 Message-ID: <8217.1692257097@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64921 Cc: 64921@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 (-) >>>>> Gustavo Barros writes: > On Tue, 15 Aug 2023 at 03:18, Ikumi Keita wrote: >> >> Thank you for suggestion. Does the attached patch give you good results? >> > It behaves the same as `reftex-citation`, so it looks good to me. > Thank you very much! Thank you for confirmation. I pushed the fix to the git repository. >> (By the way, the reason that "q"/"C-g" deletes the trace of the previous >> input is that `TeX-insert-macro' introduced `atomic-change-group' a year >> ago[1].) > I see. The thread does not actually cover the reason for the change, > but it makes sense. Also, I don't know why "q" (`reftex-select-quit') > counts as "abnormal exit" or if it really should, given that now > `TeX-insert-macro' uses `atomic-change-group'. I think RefTeX by design sends quit signal for input "q", which breaks the elisp execution. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 17 06:33:39 2023 Received: (at 64921) by debbugs.gnu.org; 17 Aug 2023 10:33:39 +0000 Received: from localhost ([127.0.0.1]:42835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWaJv-0001jE-Hq for submit@debbugs.gnu.org; Thu, 17 Aug 2023 06:33:39 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:57463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWaJr-0001ix-J4 for 64921@debbugs.gnu.org; Thu, 17 Aug 2023 06:33:38 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6bd0a0a675dso6288591a34.2 for <64921@debbugs.gnu.org>; Thu, 17 Aug 2023 03:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692268410; x=1692873210; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kBSgGgkD+GCSDKC3+LrjalO75fCdTz/zk9JsSjaWA1M=; b=kmF9Ga4eqMB5C9r044kDaKhJosk0vhr8/LUPrR9QZ/MK0HhC6Fm3t3MgeKP41UDUZO I1FZ2FLClZU/9yBxpxdM8lhJAEwEUOWDtCYLoULq+CdfzQhz713HZvEunocX04HvhtCI b+TjZNdLW+AjuUUo+Svi7090C0bAkKMZ7gJEnRJEJDgqMDXNniPxlt0DKaAG2woBrdLm UHUUbCZRuDYxBCXbNqbTh9LrXO2AJtjkiSRMXnGiOIxvqwpg9TzlqVoEzbOOG7OYVNLe 3f96+2SpoutoINVlLv3ATX4kqW4sSYGIT9q3NjH/OeOLcsnKFbuYWjEKFrbTLxCD/X2M 4GkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692268410; x=1692873210; 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=kBSgGgkD+GCSDKC3+LrjalO75fCdTz/zk9JsSjaWA1M=; b=jl/VUwbsj5fIzOxLhMoEZXMxC2/xA8koc0YQcL1J2+Ww50acR7rH+pTvvHkILJp6ZX 136UxzYv+Xtbp35ScDCoLzqVuefmyyqgMgSasAxvXsIDaPos/2zG7B0DoA2Pbo8sQLlj SNmBkRCqPN/iJosU2CGZB1pHmZCfnv9hGmk/5A0gcpjtHM6I2ETxDd9c2pjtPtUPJ97O VWN0BMUO6YAcclhDJqJh2q3YaI3XFbiNkOGIIEr5nAHHfV7P5wEPkiwLMPgy5a/hEDP4 0Vs78FvsNz04LaX4fr4kWkYCmexBpNE+fpAQW4npomahpMlQE7rD6d10BwaVcvo+M+4q ZvWw== X-Gm-Message-State: AOJu0YyjmF0yFaTm4P0enea3x215dzB8taPAMuqcil4+PHCAAuJuDiJX u7E4aJ7XpD3LTDNeqBC7NNIYSFXLRo17hncp4DhAoKNlqoBHrg== X-Google-Smtp-Source: AGHT+IGwAKJ9fVgoOLE+uzNgVRjq9R54V3y7R/mCiUX9MSmsc7DfCjonizj1sKDhZbrWNFJHrukziilwto25aHdDBYI= X-Received: by 2002:a9d:6c55:0:b0:6b9:2989:c261 with SMTP id g21-20020a9d6c55000000b006b92989c261mr4904199otq.21.1692268409782; Thu, 17 Aug 2023 03:33:29 -0700 (PDT) MIME-Version: 1.0 References: <29418.1691817652@localhost> <1967.1692080302@localhost> <8217.1692257097@localhost> In-Reply-To: <8217.1692257097@localhost> From: Gustavo Barros Date: Thu, 17 Aug 2023 07:33:18 -0300 Message-ID: Subject: Re: bug#64921: 13.2.1; Infinite loop in LaTeX-arg-biblatex-cites with RefTeX To: Ikumi Keita Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64921 Cc: 64921@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 (-) On Thu, 17 Aug 2023 at 04:25, Ikumi Keita wrote: > > Thank you for confirmation. I pushed the fix to the git repository. > Thank you very much. Best, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 22 03:04:45 2023 Received: (at control) by debbugs.gnu.org; 22 Aug 2023 07:04:45 +0000 Received: from localhost ([127.0.0.1]:58440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYLRV-0005kw-FK for submit@debbugs.gnu.org; Tue, 22 Aug 2023 03:04:45 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:45600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYLRT-0005km-QA for control@debbugs.gnu.org; Tue, 22 Aug 2023 03:04:44 -0400 Received: from localhost (42-144-34-11.rev.home.ne.jp [42.144.34.11]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id D78DC5C for ; Tue, 22 Aug 2023 16:04:38 +0900 (JST) To: control@debbugs.gnu.org From: Ikumi Keita Subject: control message for bug #64921 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <33753.1692687876.1@localhost> Date: Tue, 22 Aug 2023 16:04:36 +0900 Message-ID: <33754.1692687876@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) close 64921 quit From unknown Sat Sep 20 21:09:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Sep 2023 11:24:05 +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