annotate lisp/=man.el @ 1255:ff06503c93b4

* gud.el (gud-def): Doc fix. (gud-gdb-marker-filter, gud-sdb-marker-filter, gud-dbx-marker-filter): Rename the argument `s' or `str' to `string', and change all uses; these definitions were referring to `string', which is unbound in the lexical context, but which happens to end up being bound to the right thing by the caller, gud-filter. (sdb): Set comint-prompt-regexp, not comint-prompt-pattern; the latter doesn't exist. (gud-dbx-debugger-setup): Use the argument `f', not the variable `file', which happens to be bound in the caller. (gud-filter-insert): The variable `start' is never used. The variable `moving' is unnecessary. The variable `old-buffer' and the unwind-protect form are unneeded, since save-excursion can do their work. The binding of output-after-point should be done after switching to the process's buffer, not in whatever random buffer happens to be current when the process filter is called. There's no need to set the process mark if we've just inserted at its location using insert-before-markers. (gud-read-address): Don't bother setting the variable `result'; it is never used. * gud.el (gud-mode-map): Bind gud-refresh to C-c C-l, not C-c l; the latter is reserved for the user's purposes. * gud.el (gdb, sdb, dbx): Use C-c C-r ("resume") for continuing, instead of C-c C-c. C-c C-c should be comint-interrupt-subjob; it's important to have that available, and the C-c C-c binding is consistent with all the other comint-derived modes.
author Jim Blandy <jimb@redhat.com>
date Tue, 29 Sep 1992 07:45:05 +0000
parents 213978acbc1e
children 4d9550377364
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
659
505130d1ddf8 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
1 ;;; man.el --- read in and display parts of Unix manual.
505130d1ddf8 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
2
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
3 ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 659
diff changeset
5 ;; Maintainer: FSF
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: unix
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 659
diff changeset
7
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
9
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 659
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
13 ;; any later version.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
14
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
19
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
23
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 659
diff changeset
24 ;;; Code:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 659
diff changeset
25
256
7e4c7ef44243 *** empty log message ***
Roland McGrath <roland@gnu.org>
parents: 225
diff changeset
26 ;;;###autoload
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
27 (defun manual-entry (topic &optional section)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
28 "Display the Unix manual entry for TOPIC.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
29 TOPIC is either the title of the entry, or has the form TITLE(SECTION)
225
5ed62d0099e4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 103
diff changeset
30 where SECTION is the desired section of the manual, as in \"tty(4)\"."
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
31 (interactive "sManual entry (topic): ")
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
32 (if (= (length topic) 0)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
33 (error "Must specify topic"))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
34 (if (and (null section)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
35 (string-match "\\`[ \t]*\\([^( \t]+\\)[ \t]*(\\(.+\\))[ \t]*\\'" topic))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
36 (setq section (substring topic (match-beginning 2)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
37 (match-end 2))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
38 topic (substring topic (match-beginning 1)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
39 (match-end 1))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
40 (with-output-to-temp-buffer (concat "*" topic " Manual Entry*")
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
41 (buffer-disable-undo standard-output)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
42 (save-excursion
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
43 (set-buffer standard-output)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
44 (message "Looking for formatted entry for %s%s..."
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
45 topic (if section (concat "(" section ")") ""))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
46 (let ((dirlist manual-formatted-dirlist)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
47 (case-fold-search nil)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
48 name)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
49 (if (and section (or (file-exists-p
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
50 (setq name (concat manual-formatted-dir-prefix
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
51 (substring section 0 1)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
52 "/"
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
53 topic "." section)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
54 (file-exists-p
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
55 (setq name (concat manual-formatted-dir-prefix
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
56 section
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
57 "/"
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
58 topic "." section)))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
59 (insert-man-file name)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
60 (while dirlist
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
61 (let* ((dir (car dirlist))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
62 (name1 (concat dir "/" topic "."
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
63 (or section
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
64 (substring
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
65 dir
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
66 (1+ (or (string-match "\\.[^./]*$" dir)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
67 -2))))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
68 completions)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
69 (if (file-exists-p name1)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
70 (insert-man-file name1)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
71 (condition-case ()
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
72 (progn
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
73 (setq completions (file-name-all-completions
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
74 (concat topic "." (or section ""))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
75 dir))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
76 (while completions
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
77 (insert-man-file (concat dir "/" (car completions)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
78 (setq completions (cdr completions))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
79 (file-error nil)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
80 (goto-char (point-max)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
81 (setq dirlist (cdr dirlist)))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
82
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
83 (if (= (buffer-size) 0)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
84 (progn
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
85 (message "No formatted entry, invoking man %s%s..."
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
86 (if section (concat section " ") "") topic)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
87 (if section
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
88 (call-process manual-program nil t nil section topic)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
89 (call-process manual-program nil t nil topic))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
90 (if (< (buffer-size) 80)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
91 (progn
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
92 (goto-char (point-min))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
93 (end-of-line)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
94 (error (buffer-substring 1 (point)))))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
95
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
96 (message "Cleaning manual entry for %s..." topic)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
97 (nuke-nroff-bs)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
98 (set-buffer-modified-p nil)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
99 (setq buffer-read-only t)
74
2c14d4cb1256 *** empty log message ***
root <root>
parents: 58
diff changeset
100 (view-mode nil 'bury-buffer)
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
101 (message ""))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
102
225
5ed62d0099e4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 103
diff changeset
103 ;; Hint: BS stands for more things than "back space"
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
104 (defun nuke-nroff-bs ()
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
105 (interactive "*")
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
106 ;; Nuke headers: "MORE(1) UNIX Programmer's Manual MORE(1)"
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
107 ;; We expext to find a footer just before the header except at the beginning.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
108 (goto-char (point-min))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
109 (while (re-search-forward "^ *\\([A-Za-z][-_.A-Za-z0-9]*([0-9A-Z]+)\\).*\\1$" nil t)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
110 (let (start end)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
111 ;; Put START and END around footer and header and garbage blank lines.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
112 ;; Fixed line counts are risky, but allow us to preserve
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
113 ;; significant blank lines.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
114 (setq start (save-excursion (forward-line -10) (point)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
115 (setq end (save-excursion (forward-line 4) (point)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
116 (delete-region start end)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
117 ;; Catch the final footer.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
118 (goto-char (point-max))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
119 (delete-region (point) (save-excursion (forward-line -7) (point)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
120
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
121 ;; Nuke underlining and overstriking (only by the same letter)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
122 (goto-char (point-min))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
123 (while (search-forward "\b" nil t)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
124 (let* ((preceding (char-after (- (point) 2)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
125 (following (following-char)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
126 (cond ((= preceding following)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
127 ;; x\bx
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
128 (delete-char -2))
103
5f14cf951acb *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 74
diff changeset
129 ((and (= preceding ?o) (= following ?\+))
5f14cf951acb *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 74
diff changeset
130 ;; o\b+
5f14cf951acb *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 74
diff changeset
131 (delete-char -2))
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
132 ((= preceding ?\_)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
133 ;; _\b
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
134 (delete-char -2))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
135 ((= following ?\_)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
136 ;; \b_
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
137 (delete-region (1- (point)) (1+ (point)))))))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
138
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
139 ;; Zap ESC7, ESC8, and ESC9.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
140 ;; This is for Sun man pages like "man 1 csh"
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
141 (goto-char (point-min))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
142 (while (re-search-forward "\e[789]" nil t)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
143 (replace-match ""))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
144
474
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
145 ;; Convert o^H+ into o.
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
146 (goto-char (point-min))
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
147 (while (re-search-forward "o\010\\+" nil t)
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
148 (replace-match "o"))
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
149
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
150 ;; Nuke the dumb reformatting message
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
151 (goto-char (point-min))
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
152 (while (re-search-forward "Reformatting page. Wait... done\n\n" nil t)
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
153 (replace-match ""))
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 256
diff changeset
154
58
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
155 ;; Crunch blank lines
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
156 (goto-char (point-min))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
157 (while (re-search-forward "\n\n\n\n*" nil t)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
158 (replace-match "\n\n"))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
159
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
160 ;; Nuke blanks lines at start.
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
161 (goto-char (point-min))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
162 (skip-chars-forward "\n")
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
163 (delete-region (point-min) (point)))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
164
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
165
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
166 (defun insert-man-file (name)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
167 ;; Insert manual file (unpacked as necessary) into buffer
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
168 (if (or (equal (substring name -2) ".Z")
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
169 (string-match "/cat[0-9][a-z]?\\.Z/" name))
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
170 (call-process "zcat" name t nil)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
171 (if (equal (substring name -2) ".z")
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
172 (call-process "pcat" nil t nil name)
035f2a0c8d64 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
173 (insert-file-contents name))))
659
505130d1ddf8 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
174
505130d1ddf8 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
175 ;;; man.el ends here