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

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

[elpa] externals/auctex 0d8f8a2 14/48: Prevent spurious newlines to be a


From: Tassilo Horn
Subject: [elpa] externals/auctex 0d8f8a2 14/48: Prevent spurious newlines to be added
Date: Sun, 16 Sep 2018 01:47:21 -0400 (EDT)

branch: externals/auctex
commit 0d8f8a2dd252f86a0484b1cd9989064c869a8ac1
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>

    Prevent spurious newlines to be added
    
    * tex-fold.el (TeX-fold-overfull-p): Restore mandatory `and'.  The
    removal of xemacs compatibility code previously done was a bit too
    aggressive.
---
 tex-fold.el | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/tex-fold.el b/tex-fold.el
index 16dacae..82b6ca8 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -569,20 +569,21 @@ TYPE can be either 'env for environments, 'macro for 
macros or
   "Return t if an overfull line will result after adding an overlay.
 The overlay extends from OV-START to OV-END and will display the
 string DISPLAY-STRING."
-  (save-excursion
-    (goto-char ov-end)
-    (search-backward "\n" ov-start t))
-  (not (string-match "\n" display-string))
-  (> (+ (- ov-start
-          (save-excursion
-            (goto-char ov-start)
-            (line-beginning-position)))
-       (length display-string)
-       (- (save-excursion
-            (goto-char ov-end)
-            (line-end-position))
-          ov-end))
-     (current-fill-column)))
+  (and
+   (save-excursion
+     (goto-char ov-end)
+     (search-backward "\n" ov-start t))
+   (not (string-match "\n" display-string))
+   (> (+ (- ov-start
+           (save-excursion
+             (goto-char ov-start)
+             (line-beginning-position)))
+        (length display-string)
+        (- (save-excursion
+             (goto-char ov-end)
+             (line-end-position))
+           ov-end))
+      (current-fill-column))))
 
 (defun TeX-fold-macro-nth-arg (n macro-start &optional macro-end delims)
   "Return a property list of the argument number N of a macro.



reply via email to

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