[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex fade32d568 54/77: Don't break line inside \verb-
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex fade32d568 54/77: Don't break line inside \verb-like macro (bug#56160) |
Date: |
Fri, 26 Aug 2022 16:06:37 -0400 (EDT) |
branch: externals/auctex
commit fade32d56824f99363b8ab4f9cedce4518571dd4
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Don't break line inside \verb-like macro (bug#56160)
* latex.el (LaTeX-common-initialization): Add `LaTeX-verbatim-p' to
`fill-nobreak-predicate'.
(LaTeX-fill-move-to-break-point): Drop incomplete code which is no
longer needed with the above addition.
Complement doc string.
---
latex.el | 43 ++++++++-----------------------------------
1 file changed, 8 insertions(+), 35 deletions(-)
diff --git a/latex.el b/latex.el
index c32c8ed59f..ac4b0c548e 100644
--- a/latex.el
+++ b/latex.el
@@ -4752,7 +4752,8 @@ space does not end a sentence, so don't break a line
there."
fill-prefix)))
(defun LaTeX-fill-move-to-break-point (linebeg)
- "Move to the position where the line should be broken."
+ "Move to the position where the line should be broken.
+See `fill-move-to-break-point' for the meaning of LINEBEG."
(fill-move-to-break-point linebeg)
;; Prevent line break between 2-byte char and 1-byte char.
(when (and (or (and (not (looking-at LaTeX-nospace-between-char-regexp))
@@ -4777,40 +4778,6 @@ space does not end a sentence, so don't break a line
there."
(1- (- (point) linebeg)))
(not (TeX-escaped-p (match-beginning 0))))
(goto-char (match-beginning 0)))
- ;; Cater for \verb|...| (and similar) contructs which should not be
- ;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
- ;; doc.sty) where |...| is allowed. Arbitrary delimiters may be
- ;; chosen with \MakeShortVerb{<char>}.) This could probably be
- ;; handled with `fill-nobreak-predicate', but this is not available
- ;; in XEmacs.
- (let ((final-breakpoint (point))
- (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
"\\)\\([^a-z@*]\\)")
- (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))))
- ;; 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")
- ;; 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))))))
- (goto-char final-breakpoint))
(when LaTeX-fill-break-at-separators
(let ((orig-breakpoint (point))
(final-breakpoint (point))
@@ -7385,6 +7352,12 @@ function would return non-nil and `(match-string 1)'
would return
(set (make-local-variable 'paragraph-ignore-fill-prefix) t)
(set (make-local-variable 'fill-paragraph-function) #'LaTeX-fill-paragraph)
(set (make-local-variable 'adaptive-fill-mode) nil)
+ ;; Cater for \verb|...| (and similar) contructs which should not be
+ ;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
+ ;; doc.sty) where |...| is allowed. Arbitrary delimiters may be
+ ;; chosen with \MakeShortVerb{<char>}.)
+ (add-to-list (make-local-variable 'fill-nobreak-predicate)
+ #'LaTeX-verbatim-p t)
(or LaTeX-largest-level
(setq LaTeX-largest-level (LaTeX-section-level "section")))
- [elpa] externals/auctex e9af1e68fb 15/77: Fix preview-latex to work with desktop.el again, (continued)
- [elpa] externals/auctex e9af1e68fb 15/77: Fix preview-latex to work with desktop.el again, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex e30fda8130 26/77: ; Really silence the compiler for the change in 37e5a450, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ba6e5ef69c 07/77: ; Fix warnings reported by 'make dynvars-check', Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 4163bb5c42 66/77: Fix `autoconf` warnings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 054b38887b 42/77: Fix (void-variable compilation-in-progress) error, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex b24dcb4feb 40/77: Track changes in LaTeX kernel 2022-06-01, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex e3657144f5 53/77: Partial fix of region preview with TeX-output-dir feature, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 9a3078e510 68/77: Fix comments and doc strings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 3447aa75c3 32/77: ; Further fixes about single quotes in docstrings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 30f7a1ca68 63/77: Don't use void function texinfo-outline-level, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex fade32d568 54/77: Don't break line inside \verb-like macro (bug#56160),
Tassilo Horn <=
- [elpa] externals/auctex 9b5cf4b550 27/77: Fix insertion of second optional argument, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 39e0062235 46/77: Introduce face and keyword class for underlined text, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex d1d1bd819d 47/77: Control the opening and closing braces during insertion, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 6e25d11aa6 44/77: Add comment, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ce4bb7c1b6 58/77: ; * style/doc.el: Delete spurious `declare-function'., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 06db9e302b 75/77: Add new style/tcolorboxlib-theorems.el, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex f2138e9a74 33/77: New option for saving auto parsed information (bug#55511), Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 4486056d50 16/77: Add new style/ltcaption.el, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 019bcc9cc3 48/77: ; * style/proc.el: Fix a typo., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 7d7e563862 34/77: * doc/changes.texi: Add NEWS item for the previous commit., Tassilo Horn, 2022/08/26