]> git.eshelyaron.com Git - emacs.git/commitdiff
Support \pagebreak[0] for paragraph-separate in latex-mode
authorKevin Ryde <user42_kevin@yahoo.com.au>
Wed, 30 Oct 2019 21:32:45 +0000 (22:32 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 30 Oct 2019 21:35:19 +0000 (22:35 +0100)
* textmodes/tex-mode.el (latex-mode): In 'paragraph-separate' allow
optional argument ('[0]', etc.) for '\pagebreak[0]'.  (Bug#19039)

lisp/textmodes/tex-mode.el

index 3d7cc62e265b5f10e5d783f3198c3fd50ac08fc2..9b92a2fc60e956619edd10239c39a2fb5ae5a9b0 100644 (file)
@@ -1139,6 +1139,7 @@ subshell is initiated, `tex-shell-hook' is run."
   ;; A line containing just $$ is treated as a paragraph separator.
   ;; A line starting with $$ starts a paragraph,
   ;; but does not separate paragraphs if it has more stuff on it.
+  ;; For \pagebreak allow latex optional arg like \pagebreak[2]
   (setq paragraph-start
        (concat "[ \t]*\\(\\$\\$\\|"
                "\\\\[][]\\|"
@@ -1162,7 +1163,7 @@ subshell is initiated, `tex-shell-hook' is run."
                                              "noindent" "newpage" "footnote"
                                              "marginpar" "parbox" "caption"))
                "\\|\\$\\$\\|[a-z]*\\(space\\|skip\\|page[a-z]*\\)"
-               "\\>\\)[ \t]*\\($\\|%\\)\\)"))
+               "\\>\\)[][0-9 \t]*\\($\\|%\\)\\)"))
   (setq-local imenu-create-index-function #'latex-imenu-create-index)
   (setq-local tex-face-alist tex-latex-face-alist)
   (add-hook 'fill-nobreak-predicate #'latex-fill-nobreak-predicate nil t)