diff options
| author | Richard M. Stallman | 2005-01-04 20:36:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-01-04 20:36:28 +0000 |
| commit | 6bfb8bd66a890522ab6ad5964250920e6f144dbd (patch) | |
| tree | eb3822cde3eb20e676064925817cd8aede54a52c | |
| parent | 59b568a702293eaf48248477ec25f38f81828bc1 (diff) | |
| download | emacs-6bfb8bd66a890522ab6ad5964250920e6f144dbd.tar.gz emacs-6bfb8bd66a890522ab6ad5964250920e6f144dbd.zip | |
(Man-fontify-manpage): Turn off undo generation.
| -rw-r--r-- | lisp/man.el | 82 |
1 files changed, 42 insertions, 40 deletions
diff --git a/lisp/man.el b/lisp/man.el index 735805f1bba..a384bf34e29 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -822,6 +822,7 @@ Same for the ANSI bold and normal escape sequences." | |||
| 822 | (goto-char (point-min)) | 822 | (goto-char (point-min)) |
| 823 | ;; Fontify ANSI escapes. | 823 | ;; Fontify ANSI escapes. |
| 824 | (let ((faces nil) | 824 | (let ((faces nil) |
| 825 | (buffer-undo-list t) | ||
| 825 | (start (point))) | 826 | (start (point))) |
| 826 | ;; http://www.isthe.com/chongo/tech/comp/ansi_escapes.html | 827 | ;; http://www.isthe.com/chongo/tech/comp/ansi_escapes.html |
| 827 | ;; suggests many codes, but we only handle: | 828 | ;; suggests many codes, but we only handle: |
| @@ -853,46 +854,47 @@ Same for the ANSI bold and normal escape sequences." | |||
| 853 | (delete-region (match-beginning 0) (match-end 0)) | 854 | (delete-region (match-beginning 0) (match-end 0)) |
| 854 | (setq start (point)))) | 855 | (setq start (point)))) |
| 855 | ;; Other highlighting. | 856 | ;; Other highlighting. |
| 856 | (if (< (buffer-size) (position-bytes (point-max))) | 857 | (let ((buffer-undo-list t)) |
| 857 | ;; Multibyte characters exist. | 858 | (if (< (buffer-size) (position-bytes (point-max))) |
| 858 | (progn | 859 | ;; Multibyte characters exist. |
| 859 | (goto-char (point-min)) | 860 | (progn |
| 860 | (while (search-forward "__\b\b" nil t) | 861 | (goto-char (point-min)) |
| 861 | (backward-delete-char 4) | 862 | (while (search-forward "__\b\b" nil t) |
| 862 | (put-text-property (point) (1+ (point)) 'face Man-underline-face)) | 863 | (backward-delete-char 4) |
| 863 | (goto-char (point-min)) | 864 | (put-text-property (point) (1+ (point)) 'face Man-underline-face)) |
| 864 | (while (search-forward "\b\b__" nil t) | 865 | (goto-char (point-min)) |
| 865 | (backward-delete-char 4) | 866 | (while (search-forward "\b\b__" nil t) |
| 866 | (put-text-property (1- (point)) (point) 'face Man-underline-face)))) | 867 | (backward-delete-char 4) |
| 867 | (goto-char (point-min)) | 868 | (put-text-property (1- (point)) (point) 'face Man-underline-face)))) |
| 868 | (while (search-forward "_\b" nil t) | 869 | (goto-char (point-min)) |
| 869 | (backward-delete-char 2) | 870 | (while (search-forward "_\b" nil t) |
| 870 | (put-text-property (point) (1+ (point)) 'face Man-underline-face)) | 871 | (backward-delete-char 2) |
| 871 | (goto-char (point-min)) | 872 | (put-text-property (point) (1+ (point)) 'face Man-underline-face)) |
| 872 | (while (search-forward "\b_" nil t) | 873 | (goto-char (point-min)) |
| 873 | (backward-delete-char 2) | 874 | (while (search-forward "\b_" nil t) |
| 874 | (put-text-property (1- (point)) (point) 'face Man-underline-face)) | 875 | (backward-delete-char 2) |
| 875 | (goto-char (point-min)) | 876 | (put-text-property (1- (point)) (point) 'face Man-underline-face)) |
| 876 | (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t) | 877 | (goto-char (point-min)) |
| 877 | (replace-match "\\1") | 878 | (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t) |
| 878 | (put-text-property (1- (point)) (point) 'face Man-overstrike-face)) | 879 | (replace-match "\\1") |
| 879 | (goto-char (point-min)) | 880 | (put-text-property (1- (point)) (point) 'face Man-overstrike-face)) |
| 880 | (while (re-search-forward "o\b\\+\\|\\+\bo" nil t) | 881 | (goto-char (point-min)) |
| 881 | (replace-match "o") | 882 | (while (re-search-forward "o\b\\+\\|\\+\bo" nil t) |
| 882 | (put-text-property (1- (point)) (point) 'face 'bold)) | 883 | (replace-match "o") |
| 883 | (goto-char (point-min)) | 884 | (put-text-property (1- (point)) (point) 'face 'bold)) |
| 884 | (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) | 885 | (goto-char (point-min)) |
| 885 | (replace-match "+") | 886 | (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) |
| 886 | (put-text-property (1- (point)) (point) 'face 'bold)) | 887 | (replace-match "+") |
| 887 | (goto-char (point-min)) | 888 | (put-text-property (1- (point)) (point) 'face 'bold)) |
| 888 | ;; Try to recognize common forms of cross references. | 889 | (goto-char (point-min)) |
| 889 | (Man-highlight-references) | 890 | ;; Try to recognize common forms of cross references. |
| 890 | (Man-softhyphen-to-minus) | 891 | (Man-highlight-references) |
| 891 | (goto-char (point-min)) | 892 | (Man-softhyphen-to-minus) |
| 892 | (while (re-search-forward Man-heading-regexp nil t) | 893 | (goto-char (point-min)) |
| 893 | (put-text-property (match-beginning 0) | 894 | (while (re-search-forward Man-heading-regexp nil t) |
| 894 | (match-end 0) | 895 | (put-text-property (match-beginning 0) |
| 895 | 'face Man-overstrike-face)) | 896 | (match-end 0) |
| 897 | 'face Man-overstrike-face))) | ||
| 896 | (message "%s man page formatted" Man-arguments)) | 898 | (message "%s man page formatted" Man-arguments)) |
| 897 | 899 | ||
| 898 | (defun Man-highlight-references () | 900 | (defun Man-highlight-references () |