[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 5179308 18/26: Change default value of LaTeX-fil
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 5179308 18/26: Change default value of LaTeX-fill-break-at-separators |
Date: |
Fri, 13 Nov 2015 17:00:38 +0000 |
branch: externals/auctex
commit 5179308ed7eae182e1ff6cfe5bbc596097fba31b
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Change default value of LaTeX-fill-break-at-separators
* latex.el (LaTeX-fill-break-at-separators): Change default value
to opening only inline and display math switches.
* tests/latex/latex-filling-in.tex: New test file.
* tests/latex/latex-filling-out.tex: Ditto.
* tests/latex/latex-test.el (LaTeX-indent-tabular-test/in)
(LaTeX-indent-tabular-test/out): Remove variables defined with
`defvar'.
(AUCTeX-set-ert-path): New function for setting the path of the
ERT test files.
(LaTeX-filling): New ERT test.
---
ChangeLog | 16 ++++++++++++
latex.el | 4 ++-
tests/latex/latex-filling-in.tex | 1 +
tests/latex/latex-filling-out.tex | 5 ++++
tests/latex/latex-test.el | 47 +++++++++++++++++++++++++++++-------
5 files changed, 63 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 48ac03b..1b94fca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-11-10 Mos� Giordano <address@hidden>
+
+ * latex.el (LaTeX-fill-break-at-separators): Change default value
+ to opening only inline and display math switches.
+
+ * tests/latex/latex-filling-in.tex: New test file.
+
+ * tests/latex/latex-filling-out.tex: Ditto.
+
+ * tests/latex/latex-test.el (LaTeX-indent-tabular-test/in)
+ (LaTeX-indent-tabular-test/out): Remove variables defined with
+ `defvar'.
+ (AUCTeX-set-ert-path): New function for setting the path of the
+ ERT test files.
+ (LaTeX-filling): New ERT test.
+
2015-11-10 Tassilo Horn <address@hidden>
* tex-buf.el (TeX-revert-document-buffer): New function.
diff --git a/latex.el b/latex.el
index be466b8..f702f90 100644
--- a/latex.el
+++ b/latex.el
@@ -3357,7 +3357,9 @@ recognized."
;;; Filling
-(defcustom LaTeX-fill-break-at-separators nil
+;; The default value should try not to break formulae across lines (this is
+;; useful for preview-latex) and give a meaningful filling.
+(defcustom LaTeX-fill-break-at-separators '(\\\( \\\[)
"List of separators before or after which respectively a line
break will be inserted if they do not fit into one line."
:group 'LaTeX
diff --git a/tests/latex/latex-filling-in.tex b/tests/latex/latex-filling-in.tex
new file mode 100644
index 0000000..4cc184b
--- /dev/null
+++ b/tests/latex/latex-filling-in.tex
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod \(0 = 1\)
tempor incidunt ut $a^{2} + b^{2} = c^{2}$ labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit
laboriosam, nisi ut aliquid ex ea commodi consequatur.
diff --git a/tests/latex/latex-filling-out.tex
b/tests/latex/latex-filling-out.tex
new file mode 100644
index 0000000..cdb767a
--- /dev/null
+++ b/tests/latex/latex-filling-out.tex
@@ -0,0 +1,5 @@
+Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod
+\(0 = 1\) tempor incidunt ut $a^{2} + b^{2} = c^{2}$ labore et dolore
+magna aliqua. Ut enim ad minim veniam, quis nostrum exercitationem
+ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi
+consequatur.
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index ac662db..0ca942a 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -1,6 +1,6 @@
;;; latex-test.el --- tests for LaTeX mode
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
;; This file is part of AUCTeX.
@@ -24,14 +24,27 @@
(require 'ert)
(require 'latex)
-(defvar LaTeX-indent-tabular-test/in
- (expand-file-name "tabular-in.tex"
- (when load-file-name
- (file-name-directory load-file-name))))
-(defvar LaTeX-indent-tabular-test/out
- (expand-file-name "tabular-out.tex"
- (when load-file-name
- (file-name-directory load-file-name))))
+(defun AUCTeX-set-ert-path (&rest sym-val)
+ "Set first element of SYM-VAL to the next one, and so on.
+
+The value is the path to the test file, make sure it is expanded
+in the right directory even when the ERT test from the command
+line and from another directory."
+ (while sym-val
+ (set (pop sym-val)
+ (expand-file-name (pop sym-val)
+ (when load-file-name
+ (file-name-directory load-file-name))))))
+
+(AUCTeX-set-ert-path
+ 'LaTeX-indent-tabular-test/in
+ "tabular-in.tex"
+ 'LaTeX-indent-tabular-test/out
+ "tabular-out.tex"
+ 'LaTeX-filling/in
+ "latex-filling-in.tex"
+ 'LaTeX-filling/out
+ "latex-filling-out.tex")
(ert-deftest LaTeX-indent-tabular ()
(should (string=
@@ -44,4 +57,20 @@
(insert-file-contents LaTeX-indent-tabular-test/out)
(buffer-string)))))
+;; Test LaTeX code with math modes is indented as expected. This has mostly to
+;; do with the value of `LaTeX-fill-break-at-separators' and how
+;; `LaTeX-fill-move-to-break-point' handles it. If the test fails, try to look
+;; there.
+(ert-deftest LaTeX-filling ()
+ (should (string=
+ (with-temp-buffer
+ (insert-file-contents LaTeX-filling/in)
+ (LaTeX-mode)
+ (let ((fill-column 70))
+ (fill-paragraph))
+ (buffer-string))
+ (with-temp-buffer
+ (insert-file-contents LaTeX-filling/out)
+ (buffer-string)))))
+
;;; latex-test.el ends here
- [elpa] externals/auctex d56502e 05/26: Support node name completion in texinfo, (continued)
- [elpa] externals/auctex d56502e 05/26: Support node name completion in texinfo, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex a2f8bc6 08/26: Fix Texinfo-make-node-list, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 52275f9 03/26: Improve style., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex b3153ec 16/26: Add function for reverting document buffer, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 4527e8a 10/26: Update documentation., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex f52479b 11/26: Improve checking of a TeX distribution and make it optional, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex fb09c26 06/26: Warn about duplicate texinfo nodes, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex a4c6a19 21/26: Update release-related Makefile rules, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex cb4e33e 12/26: Set output extension for Texinfo files, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex d465076 22/26: Update for upcoming release, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 5179308 18/26: Change default value of LaTeX-fill-break-at-separators,
Tassilo Horn <=
- [elpa] externals/auctex cc72777 19/26: More ERT tests, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex df7dbbd 23/26: Release_11.89, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 3aa4bdb 17/26: Add ChangeLog entry, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 0c9b98a 14/26: Fix compatibility with XEmacs in tex-info.el, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 11af8e6 20/26: Improve has-no-display-manager predicate, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 7363de1 26/26: Adapt to ChangeLog dropping, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 7427d62 24/26: Drop ChangeLog, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 590651f 25/26: Merge branch 'master' into elpa, Tassilo Horn, 2015/11/13