auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to auctex/latex.el,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/latex.el,v
Date: Tue, 25 Dec 2007 21:46:27 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    07/12/25 21:46:27

Index: latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/latex.el,v
retrieving revision 5.439
retrieving revision 5.440
diff -u -b -r5.439 -r5.440
--- latex.el    11 Oct 2007 20:30:35 -0000      5.439
+++ latex.el    25 Dec 2007 21:46:27 -0000      5.440
@@ -2883,18 +2883,26 @@
        (verb-macros (regexp-opt (append (LaTeX-verbatim-macros-with-delims)
                                         (LaTeX-verbatim-macros-with-braces)))))
     (save-excursion
+      ;; Look for the start of a verbatim macro in the current line.
       (when (re-search-backward (concat (regexp-quote TeX-esc)
                                        "\\(?:" verb-macros 
"\\)\\(address@hidden)")
                                (line-beginning-position) t)
+       ;; Determine start and end of verbatim macro.
        (let ((beg (point))
              (end (if (not (string-match "[ [{]" (match-string 1)))
                       (cdr (LaTeX-verbatim-macro-boundaries))
                     (TeX-find-macro-end))))
-         (when (and end (> (- end (line-beginning-position))
-                           (current-fill-column)))
+         ;; Determine if macro end is behind fill column.
+         (when (and end
+                    (> (- end (line-beginning-position))
+                       (current-fill-column))
+                    (> end final-breakpoint))
+           ;; Search backwards for place to break before the macro.
            (goto-char beg)
            (skip-chars-backward "^ \n")
-           (when (bolp)
+           ;; Determine if point ended up at the beginning of the line.
+           (when (save-excursion (skip-chars-backward " \t%") (bolp))
+             ;; Search forward for a place to break after the macro.
              (goto-char end)
              (skip-chars-forward "^ \n" (point-max)))
            (setq final-breakpoint (point))))))




reply via email to

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