auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: main 510d82b3: Add folding support for TeX quotes


From: Paul Nelson
Subject: Re: main 510d82b3: Add folding support for TeX quotes
Date: Wed, 30 Oct 2024 13:19:30 +0100

Hi Arash,

> Wouldn't `bound-and-true-p' be easier here, i.e.:

Indeed it would.  I can submit a touch-up patch re. this, or just
bundle it with the next (final?) folding patch that I send.

Paul

On Wed, Oct 30, 2024 at 10:58 AM Arash Esbati <arash@gnu.org> wrote:
>
> Hi all,
>
> Ikumi Keita <ikumi@ikumi.que.jp> writes:
>
> > branch: main
> > commit 510d82b3b356dbbd007fd085662afea99e947fb7
> > Author: Paul Nelson <ultrono@gmail.com>
> > Commit: Ikumi Keita <ikumi@ikumi.que.jp>
>
> Thanks for providing and installing this.  I have a minor comment:
>
> > +      ;; Fold quotes if TeX-fold-quotes-on-insert is t
> > +      (when (and (boundp 'TeX-fold-mode)
> > +                 (boundp 'TeX-fold-quotes-on-insert)
> > +                 (fboundp 'TeX-fold-quotes)
> > +                 TeX-fold-mode
> > +                 TeX-fold-quotes-on-insert
>
> Wouldn't `bound-and-true-p' be easier here, i.e.:
>
> (when (and (bound-and-true-p TeX-fold-mode)
>            (bound-and-true-p TeX-fold-quotes-on-insert)
>            (fboundp 'TeX-fold-quotes))
>
> > +                 (not (eq (char-before) ?\")))  ; Don't fold single quotes
> > +        (save-excursion
> > +          (let* ((end (point))
> > +                 (start (- end
> > +                           (length
> > +                            (if (string= (buffer-substring-no-properties
> > +                                          (max (point-min)
> > +                                               (- end (length open-quote)))
> > +                                          end)
> > +                                         open-quote)
> > +                                open-quote
> > +                              close-quote)))))
> > +            (when start
> > +              (TeX-fold-quotes start end))))))))
> > +
>
> Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]