GNU bug report logs - #35140
12.1; Scan errors in doctex mode with ^^A-comments after braces

Previous Next

Package: auctex;

Reported by: Markus Kohm <komascript <at> gmx.info>

Date: Thu, 4 Apr 2019 12:38:02 UTC

Severity: normal

Found in version 12.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: Markus Kohm <komascript <at> gmx.info>, 35140 <at> debbugs.gnu.org
Subject: bug#35140: 12.1; Scan errors in doctex mode with ^^A-comments after braces
Date: Tue, 01 Mar 2022 12:52:39 +0100
Hi Keita,

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

> Thus I'm inclined to an idea just to fontify "^^A" type comments with
> normal comment face, not bothering with changing its syntax. Attached is
> a patch that implements this idea.
>
> What do others think about this?

I don't think AUCTeX suffers if the syntax after "^^A" isn't change so
we could do it.  One other idea would be to raise this issue also on
Emacs devel list since Emacs has the same issue as well or ping Stefan
M. to have a look at this thread before we make a final decision.  What
do you think?

> +(defun font-latex-doctex-match-^^A (limit)
> +  "In docTeX mode, match comment started by ^^A before LIMIT."
> +  (catch 'found
> +    (while (TeX-search-forward-unescaped "^^A" limit t)

While we're at it, can we change this to:

  (while (TeX-re-search-forward-unescaped "\\^\\^[AX]" limit t)

as well?  doc v3 also accepts ^^X as comment starter.

> +      (when (eq (char-after (line-beginning-position)) ?\%)
> +        (forward-line 1)
> +        ;; Adjust `font-latex--updated-region-end' if necessary.
> +        (let ((p (point)))
> +          (if (< font-latex--updated-region-end limit)
> +              (setq font-latex--updated-region-end limit))
> +          (when (< font-latex--updated-region-end p)
> +            (font-lock-unfontify-region
> +             font-latex--updated-region-end p)
> +            (setq font-latex--updated-region-end p))
> +          (set-match-data (list (match-beginning 0) p)))
> +        (throw 'found t)))))
>  
>  ;; Copy and adaptation of `doctex-font-lock-syntactic-face-function'
>  ;; in `tex-mode.el' of CVS Emacs (March 2004)

Best, Arash




This bug report was last modified 3 years and 139 days ago.

Previous Next


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