GNU bug report logs - #73840
[PATCH] Improved folding for citations

Previous Next

Package: auctex;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Wed, 16 Oct 2024 20:01:01 UTC

Severity: normal

Tags: patch

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 73840 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: ultrono <at> gmail.com
Cc: 73840 <at> debbugs.gnu.org, arash <at> gnu.org
Subject: Re: bug#73840: [PATCH] Improved folding for citations
Date: Tue, 22 Oct 2024 00:25:54 +0900
Hi Paul,

>>>>> Arash Esbati <arash <at> gnu.org> writes:
> Paul Nelson <ultrono <at> gmail.com> writes:

>> OK, I did this with RefTeX (checking if it's bound and enabled).  For
>> bibtex.el, I just require'd it inside the internal function where it's
>> used.  I also implemented your correction to the docs.  Please find
>> attached the updated patch.  Any further feedback welcome.

Looking at your proposal again, a minor concern arose in my mind. The
new function `TeX-fold--bib-abbrev' can return nil, especially when
RefTeX isn't active. Then, let's look at this piece of code:
----------------------------------------------------------------------
(defun TeX-fold-cite-display (keys &rest _args)
[...]
  (let* (...
[...]
         (key-list (split-string keys "[ \f\t\n\r\v,]+"))
         (references
          (mapcar #'TeX-fold--bib-abbrev key-list))
         (joined-references (string-join references ", ")))
----------------------------------------------------------------------
This calls `TeX-fold--bib-abbrev' repeatedly on each element of
`key-list', so the result `references' can be a list of multiple `nil's.
In that case, `joined-references' seems to have unexpected form:

(let ((r (list nil nil nil)))
  (string-join r ", ")) --> ", , "

(However, maybe we should always turn on RefTeX in LaTeX mode buffers
and forget about usages without RefTeX. It wouldn't hurt after all,
since RefTeX is part of Emacs for quite a long period; I suppose there
are practically no users who don't activate RefTeX in AUCTeX LaTeX
mode.)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




This bug report was last modified 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.