GNU bug report logs - #63441
Wrong Indentation with backslash in verb macros with braces

Previous Next

Package: auctex;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Thu, 11 May 2023 08:37:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Arash Esbati <arash <at> gnu.org>
Cc: 63441 <at> debbugs.gnu.org
Subject: bug#63441: Wrong Indentation with backslash in verb macros with braces
Date: Thu, 11 May 2023 22:47:01 +0900
Hi Arash,

>>>>> Arash Esbati <arash <at> gnu.org> writes:
> which is wrong.  This is due to the implementation of
> `TeX-brace-count-line' which presumes that ?\\ always escapes the next
> char, which is wrong in verb macros.  I can think of a solution like
> this:
> diff --git a/tex.el b/tex.el
> index b862d3c2..4663b217 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -5485,7 +5485,9 @@ additional characters."
>                          (setq count (- count TeX-brace-indent-level)))
>                         ((eq char ?\\)
>                          (when (< (point) limit)
> -                          (forward-char)
> +                          (unless (and (fboundp 'LaTeX-verbatim-p)
> +                                       (LaTeX-verbatim-p))
> +                            (forward-char))
>                            t))))))
>        count)))
> Any comments oder better approaches?

I don't think `fboundp' test is a right approach because it calls
`LaTeX-verbatim-p' even in non-LaTeX mode buffers after the session
loads latex.el. How about just
(TeX-verbatim-p)
instead of
(and (fboundp 'LaTeX-verbatim-p)
     (LaTeX-verbatim-p))
?

Bye,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




This bug report was last modified 2 years and 12 days ago.

Previous Next


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