bug-auctex
[Top][All Lists]
Advanced

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

bug#47757: 13.0.6; Point position after indent-for-tab-command with LaTe


From: Tassilo Horn
Subject: bug#47757: 13.0.6; Point position after indent-for-tab-command with LaTeX-syntactic-comments
Date: Sun, 18 Apr 2021 09:17:52 +0200
User-agent: mu4e 1.5.11; emacs 28.0.50

Gustavo Barros <gusbrs.2016@gmail.com> writes:

Hi Gustavo,

> I'm sorry to report that I've missed a problem in my testing.

Hehe, yesterday evening I've release 13.0.7 on ELPA, code-name "Gustavo
did the testing". ;-)

But no worries!

> The commit to fix the interaction between `LaTeX-back-to-indentation'
> and `electric-indent-mode' seems to have broken paragraph filling in
> comments.

Ouch, indeed.  I've hopefully just fixed it in git using this definition
which changes the behavior from "move point to the comment content only
for indent commands" to "don't move point there for newline commands":

--8<---------------cut here---------------start------------->8---
(defun LaTeX-back-to-indentation (&optional force-type)
  "Move point to the first non-whitespace character on this line.
If it is commented and comments are formatted syntax-aware move
point to the first non-whitespace character after the comment
character(s), but only if `this-command' is not a newline
command, i.e., `TeX-newline' or the value of
`TeX-newline-function'.  The optional argument FORCE-TYPE can be
used to force point being moved to the inner or outer indentation
in case of a commented line.  The symbols 'inner and 'outer are
recognized."
  (if (or (and force-type
               (eq force-type 'inner))
          (and (not force-type)
               (or (and (TeX-in-line-comment)
                        (eq major-mode 'doctex-mode))
                   (and (TeX-in-commented-line)
                        ;; Only move after the % if we're not
                        ;; performing a newline command (bug#47757).
                        (not (memq this-command
                                   `( TeX-newline
                                      ,TeX-newline-function)))
                        LaTeX-syntactic-comments))))
      (progn
        (beginning-of-line)
        ;; Should this be anchored at the start of the line?
        (TeX-re-search-forward-unescaped
         (concat "\\(?:" TeX-comment-start-regexp "+[ \t]*\\)+")
         (line-end-position) t))
    (back-to-indentation)))
--8<---------------cut here---------------end--------------->8---

Please give it a try.  I'll release 13.0.8 if you don't find another
regression.

Thanks,
Tassilo





reply via email to

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