branch: externals/auctex
commit 0d8f8a2dd252f86a0484b1cd9989064c869a8ac1
Author: Ikumi Keita <[email protected]>
Commit: Ikumi Keita <[email protected]>
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.