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: Arash Esbati
Subject: Re: main 510d82b3: Add folding support for TeX quotes
Date: Wed, 30 Oct 2024 10:58:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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]