comparison lisp/textmodes/tex-mode.el @ 5425:3dd5ff54e1cd

(slitex-mode, latex-mode): Set paragraph-start and paragraph-separate to a specific list of control sequences. (tex-common-initialization): Make paragraph-start and paragraph-separate match a line of $$.
author Richard M. Stallman <rms@gnu.org>
date Mon, 03 Jan 1994 11:36:14 +0000
parents b3a689b41d39
children cde2cde50796
comparison
equal deleted inserted replaced
5424:51eecae04837 5425:3dd5ff54e1cd
380 (setq major-mode 'latex-mode) 380 (setq major-mode 'latex-mode)
381 (setq tex-command latex-run-command) 381 (setq tex-command latex-run-command)
382 (setq tex-start-of-header "\\documentstyle") 382 (setq tex-start-of-header "\\documentstyle")
383 (setq tex-end-of-header "\\begin{document}") 383 (setq tex-end-of-header "\\begin{document}")
384 (setq tex-trailer "\\end{document}\n") 384 (setq tex-trailer "\\end{document}\n")
385 ;; A line containing just $$ is treated as a paragraph separator.
386 ;; A line starting with $$ starts a paragraph,
387 ;; but does not separate paragraphs if it has more stuff on it.
388 (setq paragraph-start "^[ \t]*$\\|^[\f%]\\|^[ \t]*\\$\\$\\|\
389 ^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|\
390 ^\\\\chapter\\>\\|^\\\\section\\>\\|\
391 ^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|\
392 ^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|\
393 ^\\\\item\\>\\|^\\\\bibitem\\>\\|^\\\\newline\\>\\|^\\\\noindent\\>\\|\
394 ^\\\\[a-z]*space\\>\\|^\\\\[a-z]*skip\\>\\|\
395 ^\\\\newpage\\>\\|^\\\\[a-z]*page\\|^\\\\footnote\\>\\|\
396 ^\\\\marginpar\\>\\|^\\\\parbox\\>\\|^\\\\caption\\>")
397 (setq paragraph-separate "^[ \t]*$\\|^[\f\\\\%]\\|^[ \t]*\\$\\$[ \t]*$\\|\
398 ^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|\
399 ^\\\\chapter\\>\\|^\\\\section\\>\\|\
400 ^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|\
401 ^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|\
402 ^\\\\item[ \t]*$\\|^\\\\bibitem[ \t]*$\\|^\\\\newline[ \t]*$\\|^\\\\noindent[ \t]*$\\|\
403 ^\\\\[a-z]*space[ \t]*$\\|^\\\\[a-z]*skip[ \t]*$\\|\
404 ^\\\\newpage[ \t]*$\\|^\\\\[a-z]*page[a-z]*[ \t]*$\\|^\\\\footnote[ \t]*$\\|\
405 ^\\\\marginpar[ \t]*$\\|^\\\\parbox[ \t]*$\\|^\\\\caption[ \t]*$")
385 (run-hooks 'text-mode-hook 'tex-mode-hook 'latex-mode-hook)) 406 (run-hooks 'text-mode-hook 'tex-mode-hook 'latex-mode-hook))
386 407
387 ;;;###autoload 408 ;;;###autoload
388 (defun slitex-mode () 409 (defun slitex-mode ()
389 "Major mode for editing files of input for SliTeX. 410 "Major mode for editing files of input for SliTeX.
432 (setq major-mode 'slitex-mode) 453 (setq major-mode 'slitex-mode)
433 (setq tex-command slitex-run-command) 454 (setq tex-command slitex-run-command)
434 (setq tex-start-of-header "\\documentstyle{slides}") 455 (setq tex-start-of-header "\\documentstyle{slides}")
435 (setq tex-end-of-header "\\begin{document}") 456 (setq tex-end-of-header "\\begin{document}")
436 (setq tex-trailer "\\end{document}\n") 457 (setq tex-trailer "\\end{document}\n")
458 ;; A line containing just $$ is treated as a paragraph separator.
459 ;; A line starting with $$ starts a paragraph,
460 ;; but does not separate paragraphs if it has more stuff on it.
461 (setq paragraph-start "^[ \t]*$\\|^[\f%]\\|^[ \t]*\\$\\$\\|\
462 ^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|\
463 ^\\\\chapter\\>\\|^\\\\section\\>\\|\
464 ^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|\
465 ^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|\
466 ^\\\\item\\>\\|^\\\\bibitem\\>\\|^\\\\newline\\>\\|^\\\\noindent\\>\\|\
467 ^\\\\[a-z]*space\\>\\|^\\\\[a-z]*skip\\>\\|\
468 ^\\\\newpage\\>\\|^\\\\[a-z]*page\\|^\\\\footnote\\>\\|\
469 ^\\\\marginpar\\>\\|^\\\\parbox\\>\\|^\\\\caption\\>")
470 (setq paragraph-separate "^[ \t]*$\\|^[\f\\\\%]\\|^[ \t]*\\$\\$[ \t]*$\\|\
471 ^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|\
472 ^\\\\chapter\\>\\|^\\\\section\\>\\|\
473 ^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|\
474 ^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|\
475 ^\\\\item[ \t]*$\\|^\\\\bibitem[ \t]*$\\|^\\\\newline[ \t]*$\\|^\\\\noindent[ \t]*$\\|\
476 ^\\\\[a-z]*space[ \t]*$\\|^\\\\[a-z]*skip[ \t]*$\\|\
477 ^\\\\newpage[ \t]*$\\|^\\\\[a-z]*page[a-z]*[ \t]*$\\|^\\\\footnote[ \t]*$\\|\
478 ^\\\\marginpar[ \t]*$\\|^\\\\parbox[ \t]*$\\|^\\\\caption[ \t]*$")
437 (run-hooks 479 (run-hooks
438 'text-mode-hook 'tex-mode-hook 'latex-mode-hook 'slitex-mode-hook)) 480 'text-mode-hook 'tex-mode-hook 'latex-mode-hook 'slitex-mode-hook))
439 481
440 (defun tex-common-initialization () 482 (defun tex-common-initialization ()
441 (kill-all-local-variables) 483 (kill-all-local-variables)
462 (modify-syntax-entry ?~ " ") 504 (modify-syntax-entry ?~ " ")
463 (modify-syntax-entry ?' "w")) 505 (modify-syntax-entry ?' "w"))
464 (set-syntax-table tex-mode-syntax-table)) 506 (set-syntax-table tex-mode-syntax-table))
465 (make-local-variable 'paragraph-start) 507 (make-local-variable 'paragraph-start)
466 ;; A line containing just $$ is treated as a paragraph separator. 508 ;; A line containing just $$ is treated as a paragraph separator.
467 (setq paragraph-start "^[ \t]*$\\|^[\f\\\\%]\\|^[ \t]*\\$\\$[ \t]*$") 509 (setq paragraph-start "^[ \t]*$\\|^[\f\\\\%]\\|^[ \t]*\\$\\$")
468 (make-local-variable 'paragraph-separate) 510 (make-local-variable 'paragraph-separate)
469 (setq paragraph-separate paragraph-start) 511 ;; A line starting with $$ starts a paragraph,
512 ;; but does not separate paragraphs if it has more stuff on it.
513 (setq paragraph-separate "^[ \t]*$\\|^[\f\\\\%]\\|^[ \t]*\\$\\$[ \t]*$")
470 (make-local-variable 'comment-start) 514 (make-local-variable 'comment-start)
471 (setq comment-start "%") 515 (setq comment-start "%")
472 (make-local-variable 'comment-start-skip) 516 (make-local-variable 'comment-start-skip)
473 (setq comment-start-skip "\\(\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)") 517 (setq comment-start-skip "\\(\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)")
474 (make-local-variable 'comment-indent-function) 518 (make-local-variable 'comment-indent-function)