Mercurial > emacs
comparison lisp/man.el @ 9620:1f58befcd1f1
* man.el (Man-init-defvars): Corrections to Man-filter-list.
(Man-fontify-manpage): Added cleaning of ksh manpage daggers.
(Man-fontify-manpage): Added cleaning of ksh manpage daggers.
(Man-bgproc-sentinel): Unconditionally call Man-cleanup-manpage.
author | Francesco Potortì <pot@gnu.org> |
---|---|
date | Thu, 20 Oct 1994 10:04:17 +0000 |
parents | 1ce43418547c |
children | 5186676f806f |
comparison
equal
deleted
inserted
replaced
9619:1c985426ad84 | 9620:1f58befcd1f1 |
---|---|
1 ;;; man.el --- browse UNIX manual pages | 1 ;;; man.el --- browse UNIX manual pages |
2 | 2 |
3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Barry A. Warsaw <bwarsaw@cen.com> | 5 ;; Author: Barry A. Warsaw <bwarsaw@cen.com> |
6 ;; Last-Modified: $Date: 1994/10/01 13:27:15 $ | 6 ;; Last-Modified: $Date: 1994/10/06 10:28:26 $ |
7 ;; Version: $Revision: 1.51 $ | 7 ;; Version: $Revision: 1.52 $ |
8 ;; Keywords: help | 8 ;; Keywords: help |
9 ;; Adapted-By: ESR, pot | 9 ;; Adapted-By: ESR, pot |
10 | 10 |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 | 12 |
344 Man-sed-command | 344 Man-sed-command |
345 (list | 345 (list |
346 (if Man-sed-script | 346 (if Man-sed-script |
347 (concat "-e '" Man-sed-script "'") | 347 (concat "-e '" Man-sed-script "'") |
348 "") | 348 "") |
349 "-e '/^[\001-\032]*$/d'" | |
349 "-e '/\e[789]/s///g'" | 350 "-e '/\e[789]/s///g'" |
350 "-e '/o\b+/s//o/g'" | |
351 "-e '/|\b-[-|\b]*/s//+/g'" | |
352 "-e '/^\\n$/D'" | |
353 "-e '/[Nn]o such file or directory/d'" | 351 "-e '/[Nn]o such file or directory/d'" |
354 "-e '/Reformatting page. Wait/d'" | 352 "-e '/Reformatting page. Wait/d'" |
355 "-e '/Reformatting entry. Wait/d'" | 353 "-e '/Reformatting entry. Wait/d'" |
356 "-e '/^[ \t]*Hewlett-Packard[ \t]Company[ \t]*-[ \t][0-9]*[ \t]-/d'" | 354 "-e '/^[ \t]*Hewlett-Packard[ \t]Company[ \t]*-[ \t][0-9]*[ \t]-/d'" |
357 "-e '/^[ \t]*Hewlett-Packard[ \t]*-[ \t][0-9]*[ \t]-.*$/d'" | 355 "-e '/^[ \t]*Hewlett-Packard[ \t]*-[ \t][0-9]*[ \t]-.*$/d'" |
359 "-e '/^[ \t]*Page[ \t][0-9]*.*(printed[ \t][0-9\\/]*)$/d'" | 357 "-e '/^[ \t]*Page[ \t][0-9]*.*(printed[ \t][0-9\\/]*)$/d'" |
360 "-e '/^Printed[ \t][0-9].*[0-9]$/d'" | 358 "-e '/^Printed[ \t][0-9].*[0-9]$/d'" |
361 "-e '/^[ \t]*X[ \t]Version[ \t]1[01].*Release[ \t][0-9]/d'" | 359 "-e '/^[ \t]*X[ \t]Version[ \t]1[01].*Release[ \t][0-9]/d'" |
362 "-e '/^[A-za-z].*Last[ \t]change:/d'" | 360 "-e '/^[A-za-z].*Last[ \t]change:/d'" |
363 "-e '/^Sun[ \t]Release[ \t][0-9].*[0-9]$/d'" | 361 "-e '/^Sun[ \t]Release[ \t][0-9].*[0-9]$/d'" |
362 "-e '/[ \t]*Copyright [0-9]* UNIX System Laboratories, Inc.$/d'" | |
364 )) | 363 )) |
365 (cons | 364 (cons |
366 Man-awk-command | 365 Man-awk-command |
367 (list | 366 (list |
368 "'\n" | 367 "'\n" |
628 (goto-char (point-min)) | 627 (goto-char (point-min)) |
629 (while (search-forward "\b_" nil t) | 628 (while (search-forward "\b_" nil t) |
630 (backward-delete-char 2) | 629 (backward-delete-char 2) |
631 (put-text-property (1- (point)) (point) 'face 'underline)) | 630 (put-text-property (1- (point)) (point) 'face 'underline)) |
632 (goto-char (point-min)) | 631 (goto-char (point-min)) |
633 (while (re-search-forward "\e[789]" nil t) | |
634 (backward-delete-char 2)) | |
635 (goto-char (point-min)) | |
636 (while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t) | 632 (while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t) |
637 (replace-match "\\1") | 633 (replace-match "\\1") |
638 (put-text-property (1- (point)) (point) 'face 'bold)) | 634 (put-text-property (1- (point)) (point) 'face 'bold)) |
639 (goto-char (point-min)) | 635 (goto-char (point-min)) |
640 (while (search-forward "o\b+" nil t) | 636 (while (search-forward "o\b+" nil t) |
641 (backward-delete-char 2) | 637 (backward-delete-char 2) |
642 (put-text-property (1- (point)) (point) 'face 'bold)) | 638 (put-text-property (1- (point)) (point) 'face 'bold)) |
643 (goto-char (point-min)) | 639 (goto-char (point-min)) |
644 (while (re-search-forward "|\b-[-|\b]*" nil t) | 640 (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) |
645 (replace-match "+") | 641 (replace-match "+") |
646 (put-text-property (1- (point)) (point) 'face 'bold)) | 642 (put-text-property (1- (point)) (point) 'face 'bold)) |
647 (message "%s man page made up" Man-arguments)) | 643 (message "%s man page made up" Man-arguments)) |
648 | 644 |
649 (defun Man-cleanup-manpage () | 645 (defun Man-cleanup-manpage () |
650 "Remove overstriking and underlining from the current buffer." | 646 "Remove overstriking and underlining from the current buffer." |
651 (interactive) | 647 (interactive) |
652 (message "Please wait: cleaning up the %s man page..." Man-arguments) | 648 (message "Please wait: cleaning up the %s man page..." |
649 Man-arguments) | |
650 (or Man-sed-script | |
651 (progn | |
652 (goto-char (point-min)) | |
653 (while (search-forward "_\b" nil t) (backward-delete-char 2)) | |
654 (goto-char (point-min)) | |
655 (while (search-forward "\b_" nil t) (backward-delete-char 2)) | |
656 (goto-char (point-min)) | |
657 (while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t) | |
658 (replace-match "\\1")) | |
659 (goto-char (point-min)) | |
660 (while (re-search-forward "\e\\[[0-9]+m" nil t) (replace-match "")) | |
661 (goto-char (point-min)) | |
662 (while (search-forward "o\b+" nil t) (backward-delete-char 2)) | |
663 )) | |
653 (goto-char (point-min)) | 664 (goto-char (point-min)) |
654 (while (re-search-forward "\e\\[[0-9]+m" nil t) (replace-match "")) | 665 (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) (replace-match "+")) |
655 (goto-char (point-min)) | |
656 (while (search-forward "_\b" nil t) (backward-delete-char 2)) | |
657 (goto-char (point-min)) | |
658 (while (search-forward "\b_" nil t) (backward-delete-char 2)) | |
659 (goto-char (point-min)) | |
660 (while (re-search-forward "\e[789]" nil t) (backward-delete-char 2)) | |
661 (goto-char (point-min)) | |
662 (while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t) | |
663 (replace-match "\\1")) | |
664 (goto-char (point-min)) | |
665 (while (search-forward "o\b+" nil t) (backward-delete-char 2)) | |
666 (goto-char (point-min)) | |
667 (while (re-search-forward "|\b-[-|\b]*" nil t) (replace-match "+")) | |
668 (message "%s man page cleaned up" Man-arguments)) | 666 (message "%s man page cleaned up" Man-arguments)) |
669 | 667 |
670 (defun Man-bgproc-sentinel (process msg) | 668 (defun Man-bgproc-sentinel (process msg) |
671 "Manpage background process sentinel." | 669 "Manpage background process sentinel." |
672 (let ((Man-buffer (process-buffer process)) | 670 (let ((Man-buffer (process-buffer process)) |
700 )) | 698 )) |
701 (if delete-buff | 699 (if delete-buff |
702 (kill-buffer Man-buffer) | 700 (kill-buffer Man-buffer) |
703 (if Man-fontify-manpage-flag | 701 (if Man-fontify-manpage-flag |
704 (Man-fontify-manpage) | 702 (Man-fontify-manpage) |
705 (if (not Man-sed-script) | 703 (Man-cleanup-manpage)) |
706 (Man-cleanup-manpage))) | |
707 (run-hooks 'Man-cooked-hook) | 704 (run-hooks 'Man-cooked-hook) |
708 (Man-mode) | 705 (Man-mode) |
709 (set-buffer-modified-p nil) | 706 (set-buffer-modified-p nil) |
710 )) | 707 )) |
711 ;; Restore case-fold-search before calling | 708 ;; Restore case-fold-search before calling |