GNU bug report logs -
#73840
[PATCH] Improved folding for citations
Previous Next
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):
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.