emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 5f79e96 08/12: Don't move past % if the current


From: Tassilo Horn
Subject: [elpa] externals/auctex 5f79e96 08/12: Don't move past % if the current command is a non-indent command
Date: Sat, 17 Apr 2021 15:13:22 -0400 (EDT)

branch: externals/auctex
commit 5f79e96eb7febff107ed042646c99f7331469426
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Don't move past % if the current command is a non-indent command
    
    * latex.el (LaTeX-back-to-indentation): Don't move past % if the
    current command is a non-indent command (bug#47757).
---
 latex.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/latex.el b/latex.el
index c4d7355..f85e5e0 100644
--- a/latex.el
+++ b/latex.el
@@ -3681,16 +3681,25 @@ outer indentation in case of a commented line.  The 
symbols
   "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).  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."
+character(s), but only if `this-command' is an actual indentation
+command.  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 actually
+                        ;; performing an indent command and something
+                        ;; else like our `TeX-newline-function' which
+                        ;; will be invoked automatically by
+                        ;; `electric-indent-mode' (bug#47757).
+                        (memq this-command
+                              `(,indent-line-function
+                                indent-for-tab-command
+                                LaTeX-indent-line))
                         LaTeX-syntactic-comments))))
       (progn
         (beginning-of-line)



reply via email to

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