GNU bug report logs - #73938
[PATCH] Add folding support for TeX quotes

Previous Next

Package: auctex;

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

Date: Mon, 21 Oct 2024 20:45:02 UTC

Severity: normal

Tags: patch

Fixed in version 14.0.8

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73938 in the body.
You can then email your comments to 73938 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Mon, 21 Oct 2024 20:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Nelson <ultrono <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Mon, 21 Oct 2024 20:45:02 GMT) Full text and rfc822 format available.

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

From: Paul Nelson <ultrono <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [PATCH] Add folding support for TeX quotes
Date: Mon, 21 Oct 2024 22:43:21 +0200
[Message part 1 (text/plain, inline)]
Hi again,

This patch adds support for folding TeX quotes, together with a user
option for automatically folding quotes upon insertion.

Besides the new feature, I took the liberty of improving the
organization of tex-fold.el by grouping together related functions
that have been added in some of my recent patches.

Any feedback welcome.

Thanks, best,

Paul
[0001-Add-folding-support-for-TeX-quotes.patch (application/octet-stream, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Thu, 24 Oct 2024 09:45:02 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Paul Nelson <ultrono <at> gmail.com>
Cc: 73938 <at> debbugs.gnu.org
Subject: Re: bug#73938: [PATCH] Add folding support for TeX quotes
Date: Thu, 24 Oct 2024 18:43:40 +0900
Hi Paul,

>>>>> Paul Nelson <ultrono <at> gmail.com> writes:
> This patch adds support for folding TeX quotes, together with a user
> option for automatically folding quotes upon insertion.

> Besides the new feature, I took the liberty of improving the
> organization of tex-fold.el by grouping together related functions
> that have been added in some of my recent patches.

> Any feedback welcome.

Thanks for intensive contributions. I haven't tested the code yet, but
I'd suggest to move `declare-function' to the initial block of
tex-fold.el, because `declare-function' is just a declaration to the
byte compiler and does nothing at run time.

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




Information forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Tue, 29 Oct 2024 15:49:02 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Paul Nelson <ultrono <at> gmail.com>
Cc: 73938 <at> debbugs.gnu.org
Subject: Re: bug#73938: [PATCH] Add folding support for TeX quotes
Date: Wed, 30 Oct 2024 00:48:54 +0900
>>>>> Paul Nelson <ultrono <at> gmail.com> writes:
> Thanks Ikumi, I've adjusted accordingly (I'll send the final patch
> pre-merge, assuming that there will be other comments in the mean
> time)

I think it is basically OK. Please send us your latest patch. Some of
nitpicking matters:

1.
----------------------------------------------------------------------
(defun TeX-fold-quotes (start end)
  "Fold LaTeX quotes between START and END.
Replaces opening and closing quotes with `TeX-fold-open-quote' and
`TeX-fold-close-quote', respectively, except in math environments,
verbatim contexts and comments."
  (pcase-let ((`(,open-quote ,close-quote _) (TeX-get-quote-characters)))
    (save-excursion
      (goto-char start)
      (while (re-search-forward (regexp-opt (list open-quote close-quote)) end t)
----------------------------------------------------------------------
In the course of this `while' loop, the regexp is always regenerated by
`regexp-opt'. However, it is actually constant during the loop. Thus I'd
prefer something like
(let ((regexp (regexp-opt ...)))
  (while (re-search-forward regexp ...)


2.
----------------------------------------------------------------------
(defun TeX-fold-quotes (start end)
[...]
        (let ((str (if (string= (match-string 0) open-quote)
----------------------------------------------------------------------
If I understand correctly, `match-string-no-properties' would be enough
here.

3.
----------------------------------------------------------------------
(defun TeX-insert-quote (force)
[...]
        (save-excursion
          (let* ((end (point))
                 (start (- end
                           (length
                            (if (string-match-p (regexp-quote open-quote)
                                                (buffer-substring-no-properties (- end (length open-quote)) end))
----------------------------------------------------------------------
We can just use `string=' instead of regexp+regexp-quote here.

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




Information forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Tue, 29 Oct 2024 20:03:01 GMT) Full text and rfc822 format available.

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

From: Paul Nelson <ultrono <at> gmail.com>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 73938 <at> debbugs.gnu.org
Subject: Re: bug#73938: [PATCH] Add folding support for TeX quotes
Date: Tue, 29 Oct 2024 21:00:58 +0100
[Message part 1 (text/plain, inline)]
Hi Ikumi, thanks for your feedback, which I've implemented.  Please
see attached.  Paul
[0001-Add-folding-support-for-TeX-quotes.patch (application/octet-stream, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Wed, 30 Oct 2024 05:49:02 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Paul Nelson <ultrono <at> gmail.com>
Cc: 73938 <at> debbugs.gnu.org
Subject: Re: bug#73938: [PATCH] Add folding support for TeX quotes
Date: Wed, 30 Oct 2024 14:48:13 +0900
Hi Paul,

>>>>> Paul Nelson <ultrono <at> gmail.com> writes:
> Hi Ikumi, thanks for your feedback, which I've implemented.  Please
> see attached.  Paul

Thank you, I installed your change, with slight modifications to Texinfo
documentation. (LaTeX -> @LaTeX{}, two spaces after end of sentences,
etc.)

To David, Mosé, Tassilo and Arash: How about recruiting Paul as an
AUCTeX developer? I'm the latest person that was given the write
permission to AUCTeX repogitory and it was 7 years ago. It would be
prospective to have a new active developer.

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




Information forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Fri, 01 Nov 2024 08:34:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 73938 <at> debbugs.gnu.org, Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#73938: [PATCH] Add folding support for TeX quotes
Date: Fri, 01 Nov 2024 09:32:25 +0100
Hi Keita,

Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

> To David, Mosé, Tassilo and Arash: How about recruiting Paul as an
> AUCTeX developer? I'm the latest person that was given the write
> permission to AUCTeX repogitory and it was 7 years ago. It would be
> prospective to have a new active developer.

I agree, as I already said elsewhere, it would be great to have AUCTeX
developers who actually use it on a daily basis.  I'm not sure about
you, but I'm actually not using LaTeX anymore.

@Paul: Do you want to step in and look after some parts of AUCTeX?
tex-fold.el and preview.el seem to be a good start :-)

Best, Arash




bug marked as fixed in version 14.0.8, send any further explanations to 73938 <at> debbugs.gnu.org and Paul Nelson <ultrono <at> gmail.com> Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Nov 2024 22:03:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-auctex <at> gnu.org:
bug#73938; Package auctex. (Sun, 17 Nov 2024 18:34:01 GMT) Full text and rfc822 format available.

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

From: Paul Nelson <ultrono <at> gmail.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: ikumi <at> ikumi.que.jp, 73938 <at> debbugs.gnu.org
Subject: Re: bug#73938: [PATCH] Add folding support for TeX quotes
Date: Sun, 17 Nov 2024 19:32:24 +0100
Hi Arash and Ikumi,

>> To David, Mosé, Tassilo and Arash: How about recruiting Paul as an
>> AUCTeX developer? I'm the latest person that was given the write
>> permission to AUCTeX repogitory and it was 7 years ago. It would be
>> prospective to have a new active developer.
>
> I agree, as I already said elsewhere, it would be great to have AUCTeX
> developers who actually use it on a daily basis.  I'm not sure about
> you, but I'm actually not using LaTeX anymore.
>
> @Paul: Do you want to step in and look after some parts of AUCTeX?
> tex-fold.el and preview.el seem to be a good start :-)

Many thanks for the invitation.  Could you say more about what being a
"developer" involves?  I want to be upfront that I can be a bit
irregular with communication, despite best efforts, though I'm happy to
help as I can.  I certainly have a vested interest, having used AUCTeX
for nearly a couple decades, onboarded a dozen colleagues in the past
couple years, etc.

Thanks again and best,
Paul




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Dec 2024 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 184 days ago.

Previous Next


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