aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1998-11-07 02:03:33 +0000
committerKarl Heuer1998-11-07 02:03:33 +0000
commitf66f0ee8ff370fe9a11106369e69672b0d2d2adb (patch)
tree8e91da49b714a48b6913e55100d72b8cccfe00d8
parentaa5fcebf0dbe2eba35fb46b6fb6f6b3c23f4abd4 (diff)
downloademacs-f66f0ee8ff370fe9a11106369e69672b0d2d2adb.tar.gz
emacs-f66f0ee8ff370fe9a11106369e69672b0d2d2adb.zip
(texinfo-format-scan):
Detect the case of two @-commands in a row; process just the first. (texinfo-append-refill): If line has a @c, insert the @refill before it. (texinfo-format-refill): Return with point where the @refill was.
-rw-r--r--lisp/textmodes/texinfmt.el94
1 files changed, 49 insertions, 45 deletions
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index d04db1a9a4a..d102e8aa5f6 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -617,17 +617,14 @@ Do not append @refill to paragraphs containing @w{TEXT} or @*."
617 ;; 4. Else go to end of paragraph and insert @refill 617 ;; 4. Else go to end of paragraph and insert @refill
618 (forward-paragraph) 618 (forward-paragraph)
619 (forward-line -1) 619 (forward-line -1)
620 (end-of-line) 620 (let ((line-beg (point)))
621 (delete-region 621 (end-of-line)
622 (point) 622 (delete-region
623 (save-excursion (skip-chars-backward " \t") (point))) 623 (point)
624 ;; `looking-at-backward' not available in v. 18.57 624 (save-excursion (skip-chars-backward " \t") (point)))
625 ;; (if (not (looking-at-backward "@refill\\|@bye")) ;) 625 (search-backward "@c" line-beg t)
626 (if (not (re-search-backward 626 (unless (re-search-backward "@refill\\|@bye" line-beg t)
627 "@refill\\|@bye" 627 (insert "@refill")))
628 (save-excursion (beginning-of-line) (point))
629 t))
630 (insert "@refill"))
631 (forward-line 1)))))) 628 (forward-line 1))))))
632 629
633 630
@@ -875,6 +872,11 @@ lower types.")
875 (forward-word 1) 872 (forward-word 1)
876 (forward-char 1)) 873 (forward-char 1))
877 (setq texinfo-command-end (point)) 874 (setq texinfo-command-end (point))
875 ;; Detect the case of two @-commands in a row;
876 ;; process just the first one.
877 (goto-char (1+ texinfo-command-start))
878 (skip-chars-forward "^@" texinfo-command-end)
879 (setq texinfo-command-end (point))
878 ;; Handle let aliasing 880 ;; Handle let aliasing
879 (setq texinfo-command-name 881 (setq texinfo-command-name
880 (let (trial 882 (let (trial
@@ -2603,41 +2605,43 @@ Default is to leave the number of spaces as is."
2603 "Refill paragraph. Also, indent first line as set by @paragraphindent. 2605 "Refill paragraph. Also, indent first line as set by @paragraphindent.
2604Default is to leave paragraph indentation as is." 2606Default is to leave paragraph indentation as is."
2605 (texinfo-discard-command) 2607 (texinfo-discard-command)
2606 (forward-paragraph -1) 2608 (let ((position (point-marker)))
2607 (if (looking-at "[ \t\n]*$") (forward-line 1)) 2609 (forward-paragraph -1)
2608 ;; Do not indent if an entry in a list, table, or deffn, 2610 (if (looking-at "[ \t\n]*$") (forward-line 1))
2609 ;; or if paragraph is preceded by @noindent. 2611 ;; Do not indent if an entry in a list, table, or deffn,
2610 ;; Otherwise, indent 2612 ;; or if paragraph is preceded by @noindent.
2611 (cond 2613 ;; Otherwise, indent
2612 ;; delete a @noindent line and do not indent paragraph 2614 (cond
2613 ((save-excursion (forward-line -1) 2615 ;; delete a @noindent line and do not indent paragraph
2614 (looking-at "^@noindent")) 2616 ((save-excursion (forward-line -1)
2617 (looking-at "^@noindent"))
2618 (forward-line -1)
2619 (delete-region (point) (progn (forward-line 1) (point))))
2620 ;; do nothing if "asis"
2621 ((equal texinfo-paragraph-indent "asis"))
2622 ;; do no indenting in list, etc.
2623 ((> texinfo-stack-depth 0))
2624 ;; otherwise delete existing whitespace and indent
2625 (t
2626 (delete-region (point) (progn (skip-chars-forward " \t") (point)))
2627 (insert (make-string texinfo-paragraph-indent ? ))))
2628 (forward-paragraph 1)
2615 (forward-line -1) 2629 (forward-line -1)
2616 (delete-region (point) (progn (forward-line 1) (point)))) 2630 (end-of-line)
2617 ;; do nothing if "asis" 2631 ;; Do not fill a section title line with asterisks, hyphens, etc. that
2618 ((equal texinfo-paragraph-indent "asis")) 2632 ;; are used to underline it. This could occur if the line following
2619 ;; do no indenting in list, etc. 2633 ;; the underlining is not an index entry and has text within it.
2620 ((> texinfo-stack-depth 0)) 2634 (let* ((previous-paragraph-separate paragraph-separate)
2621 ;; otherwise delete existing whitespace and indent 2635 (paragraph-separate
2622 (t 2636 (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+"))
2623 (delete-region (point) (progn (skip-chars-forward " \t") (point))) 2637 (previous-paragraph-start paragraph-start)
2624 (insert (make-string texinfo-paragraph-indent ? )))) 2638 (paragraph-start
2625 (forward-paragraph 1) 2639 (concat paragraph-start "\\|[-=.]+\\|\\*\\*+")))
2626 (forward-line -1) 2640 (unwind-protect
2627 (end-of-line) 2641 (fill-paragraph nil)
2628 ;; Do not fill a section title line with asterisks, hyphens, etc. that 2642 (setq paragraph-separate previous-paragraph-separate)
2629 ;; are used to underline it. This could occur if the line following 2643 (setq paragraph-start previous-paragraph-start)))
2630 ;; the underlining is not an index entry and has text within it. 2644 (goto-char position)))
2631 (let* ((previous-paragraph-separate paragraph-separate)
2632 (paragraph-separate
2633 (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+"))
2634 (previous-paragraph-start paragraph-start)
2635 (paragraph-start
2636 (concat paragraph-start "\\|[-=.]+\\|\\*\\*+")))
2637 (unwind-protect
2638 (fill-paragraph nil)
2639 (setq paragraph-separate previous-paragraph-separate)
2640 (setq paragraph-start previous-paragraph-start))))
2641 2645
2642(put 'noindent 'texinfo-format 'texinfo-noindent) 2646(put 'noindent 'texinfo-format 'texinfo-noindent)
2643(defun texinfo-noindent () 2647(defun texinfo-noindent ()