diff options
| author | Stefan Monnier | 2006-09-22 19:09:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-09-22 19:09:45 +0000 |
| commit | 8cc8239e5e33846c4d74b0a5d89429ff6daa0177 (patch) | |
| tree | 03455db681734ea612643632d0418f1c99b22ec6 | |
| parent | eb8c8b04558797385bac20d434c4d36b24937957 (diff) | |
| download | emacs-8cc8239e5e33846c4d74b0a5d89429ff6daa0177.tar.gz emacs-8cc8239e5e33846c4d74b0a5d89429ff6daa0177.zip | |
Make sure all the end-of-region markers we use have
a non-nil insertion-type.
(woman0-so): Move things around so we can use copy-marker.
(woman0-roff-buffer, woman2-process-escapes-to-eol, woman2-roff-buffer):
Adjust marker type.
(woman2-process-escapes): Check marker type.
(woman-horizontal-line): Dispense with the use of a marker.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/woman.el | 30 |
2 files changed, 25 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 575f25b23a7..89d22c0bb5a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2006-09-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * woman.el: Make sure all the end-of-region markers we use have | ||
| 4 | a non-nil insertion-type. | ||
| 5 | (woman0-so): Move things around so we can use copy-marker. | ||
| 6 | (woman0-roff-buffer, woman2-process-escapes-to-eol, woman2-roff-buffer): | ||
| 7 | Adjust marker type. | ||
| 8 | (woman2-process-escapes): Check marker type. | ||
| 9 | (woman-horizontal-line): Dispense with the use of a marker. | ||
| 10 | |||
| 1 | 2006-09-22 Jay Belanger <belanger@truman.edu> | 11 | 2006-09-22 Jay Belanger <belanger@truman.edu> |
| 2 | 12 | ||
| 3 | * calc/calc-lang.el: Add Greek letters to math-variable-table | 13 | * calc/calc-lang.el: Add Greek letters to math-variable-table |
diff --git a/lisp/woman.el b/lisp/woman.el index 3ee3e3f98d6..55396f607eb 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -438,6 +438,7 @@ | |||
| 438 | 438 | ||
| 439 | (eval-when-compile ; to avoid compiler warnings | 439 | (eval-when-compile ; to avoid compiler warnings |
| 440 | (require 'dired) | 440 | (require 'dired) |
| 441 | (require 'cl) | ||
| 441 | (require 'apropos)) | 442 | (require 'apropos)) |
| 442 | 443 | ||
| 443 | (defun woman-mapcan (fn x) | 444 | (defun woman-mapcan (fn x) |
| @@ -2467,6 +2468,7 @@ Start at FROM and re-scan new text as appropriate." | |||
| 2467 | (woman0-search-regex | 2468 | (woman0-search-regex |
| 2468 | (concat woman0-search-regex-start woman0-search-regex-end)) | 2469 | (concat woman0-search-regex-start woman0-search-regex-end)) |
| 2469 | woman0-rename-alist) | 2470 | woman0-rename-alist) |
| 2471 | (set-marker-insertion-type woman0-if-to t) | ||
| 2470 | (while (re-search-forward woman0-search-regex nil t) | 2472 | (while (re-search-forward woman0-search-regex nil t) |
| 2471 | (setq request (match-string 1)) | 2473 | (setq request (match-string 1)) |
| 2472 | (cond ((string= request "ig") (woman0-ig)) | 2474 | (cond ((string= request "ig") (woman0-ig)) |
| @@ -2540,7 +2542,7 @@ REQUEST is the invoking directive without the leading dot." | |||
| 2540 | ;; String delimiter can be any non-numeric character, | 2542 | ;; String delimiter can be any non-numeric character, |
| 2541 | ;; including a special character escape: | 2543 | ;; including a special character escape: |
| 2542 | (looking-at "\\(\\\\(..\\|[^0-9]\\)\\(.*\\)\\1\\(.*\\)\\1\\'")) | 2544 | (looking-at "\\(\\\\(..\\|[^0-9]\\)\\(.*\\)\\1\\(.*\\)\\1\\'")) |
| 2543 | (let ((end1 (copy-marker (match-end 2)))) ; end of first string | 2545 | (let ((end1 (copy-marker (match-end 2) t))) ; End of first string. |
| 2544 | ;; Delete 2nd and 3rd delimiters to avoid processing them: | 2546 | ;; Delete 2nd and 3rd delimiters to avoid processing them: |
| 2545 | (delete-region (match-end 3) woman0-if-to) | 2547 | (delete-region (match-end 3) woman0-if-to) |
| 2546 | (delete-region (match-end 2) (match-beginning 3)) | 2548 | (delete-region (match-end 2) (match-beginning 3)) |
| @@ -2656,9 +2658,8 @@ If DELETE is non-nil then delete from point." | |||
| 2656 | (beginning-of-line) | 2658 | (beginning-of-line) |
| 2657 | (woman-delete-line 1) | 2659 | (woman-delete-line 1) |
| 2658 | (let ((from (point)) | 2660 | (let ((from (point)) |
| 2659 | (to (make-marker)) | 2661 | (length (woman-insert-file-contents filename 0)) |
| 2660 | (length (woman-insert-file-contents filename 0))) | 2662 | (to (copy-marker (+ from length) t))) |
| 2661 | (set-marker to (+ from length)) | ||
| 2662 | (woman-pre-process-region from to) | 2663 | (woman-pre-process-region from to) |
| 2663 | (set-marker to nil) | 2664 | (set-marker to nil) |
| 2664 | (goto-char from) | 2665 | (goto-char from) |
| @@ -3442,9 +3443,7 @@ Also bound locally in `woman2-roff-buffer'.") | |||
| 3442 | (defsubst woman2-process-escapes-to-eol (&optional numeric) | 3443 | (defsubst woman2-process-escapes-to-eol (&optional numeric) |
| 3443 | "Process remaining escape sequences up to eol. | 3444 | "Process remaining escape sequences up to eol. |
| 3444 | Handle numeric arguments specially if optional argument NUMERIC is non-nil." | 3445 | Handle numeric arguments specially if optional argument NUMERIC is non-nil." |
| 3445 | (woman2-process-escapes | 3446 | (woman2-process-escapes (copy-marker (line-end-position) t) numeric)) |
| 3446 | (save-excursion (end-of-line) (point-marker)) | ||
| 3447 | numeric)) | ||
| 3448 | 3447 | ||
| 3449 | (defun woman2-nr (to) | 3448 | (defun woman2-nr (to) |
| 3450 | ".nr R +/-N M -- Assign +/-N (wrt to previous value, if any) to register R. | 3449 | ".nr R +/-N M -- Assign +/-N (wrt to previous value, if any) to register R. |
| @@ -3645,6 +3644,7 @@ expression in parentheses. Leaves point after the value." | |||
| 3645 | (woman-registers woman-registers) | 3644 | (woman-registers woman-registers) |
| 3646 | fn request translations | 3645 | fn request translations |
| 3647 | tab-stop-list) | 3646 | tab-stop-list) |
| 3647 | (set-marker-insertion-type to t) | ||
| 3648 | ;; ?roff does not squeeze multiple spaces, but does fill, so... | 3648 | ;; ?roff does not squeeze multiple spaces, but does fill, so... |
| 3649 | (fset 'canonically-space-region 'ignore) | 3649 | (fset 'canonically-space-region 'ignore) |
| 3650 | ;; Try to avoid spaces inheriting underlines from preceding text! | 3650 | ;; Try to avoid spaces inheriting underlines from preceding text! |
| @@ -3687,7 +3687,8 @@ expression in parentheses. Leaves point after the value." | |||
| 3687 | ;; Call the appropriate function: | 3687 | ;; Call the appropriate function: |
| 3688 | (funcall fn to))) | 3688 | (funcall fn to))) |
| 3689 | (if (not (eobp)) ; This should not happen, but ... | 3689 | (if (not (eobp)) ; This should not happen, but ... |
| 3690 | (woman2-format-paragraphs (point-max-marker) woman-left-margin)) | 3690 | (woman2-format-paragraphs (copy-marker (point-max) t) |
| 3691 | woman-left-margin)) | ||
| 3691 | (fset 'canonically-space-region canonically-space-region) | 3692 | (fset 'canonically-space-region canonically-space-region) |
| 3692 | (fset 'set-text-properties set-text-properties) | 3693 | (fset 'set-text-properties set-text-properties) |
| 3693 | (fset 'insert-and-inherit insert-and-inherit) | 3694 | (fset 'insert-and-inherit insert-and-inherit) |
| @@ -3899,6 +3900,7 @@ Leave 1 blank line. Format paragraphs upto TO." | |||
| 3899 | (defun woman2-process-escapes (to &optional numeric) | 3900 | (defun woman2-process-escapes (to &optional numeric) |
| 3900 | "Process remaining escape sequences up to marker TO, preserving point. | 3901 | "Process remaining escape sequences up to marker TO, preserving point. |
| 3901 | Optional argument NUMERIC, if non-nil, means the argument is numeric." | 3902 | Optional argument NUMERIC, if non-nil, means the argument is numeric." |
| 3903 | (assert (and (markerp to) (marker-insertion-type to))) | ||
| 3902 | ;; The first two cases below could be merged (maybe)! | 3904 | ;; The first two cases below could be merged (maybe)! |
| 3903 | (let ((from (point))) | 3905 | (let ((from (point))) |
| 3904 | ;; Discard zero width filler character used to hide leading dots | 3906 | ;; Discard zero width filler character used to hide leading dots |
| @@ -3968,15 +3970,13 @@ Optional argument NUMERIC, if non-nil, means the argument is numeric." | |||
| 3968 | (delete-char -1) | 3970 | (delete-char -1) |
| 3969 | (delete-char 1) | 3971 | (delete-char 1) |
| 3970 | (looking-at "\\(.\\)\\(.*\\)\\1") | 3972 | (looking-at "\\(.\\)\\(.*\\)\\1") |
| 3971 | (let ((to (make-marker)) from N c) | 3973 | (forward-char 1) |
| 3972 | (set-marker to (match-end 2)) | 3974 | (let* ((to (match-end 2))) |
| 3973 | (delete-char 1) | 3975 | (from (match-beginning 0)) |
| 3974 | (setq from (point) | 3976 | (N (woman-parse-numeric-arg)) |
| 3975 | N (woman-parse-numeric-arg)) | 3977 | (c (if (< (point) to) (following-char) ?_))) |
| 3976 | (setq c (if (< (point) to) (following-char) ?_)) | ||
| 3977 | (delete-region from to) | 3978 | (delete-region from to) |
| 3978 | (delete-char 1) | 3979 | (delete-char 1) |
| 3979 | (set-marker to nil) | ||
| 3980 | (insert (make-string N c)) | 3980 | (insert (make-string N c)) |
| 3981 | )) | 3981 | )) |
| 3982 | 3982 | ||