Function: woman-find-file
woman-find-file is an autoloaded, interactive and byte-compiled
function defined in woman.el.gz.
Signature
(woman-find-file FILE-NAME &optional REFORMAT)
Documentation
Find, decode and browse a specific UN*X man-page source file FILE-NAME.
Use existing buffer if possible; reformat only if prefix arg given.
When called interactively, optional argument REFORMAT forces reformatting
of an existing WoMan buffer formatted earlier.
No external programs are used, except that gunzip will be used to
decompress the file if appropriate. See the documentation for the
woman command for further details.
Probably introduced at or before Emacs version 21.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/woman.el.gz
;;;###autoload
(defun woman-find-file (file-name &optional reformat)
"Find, decode and browse a specific UN*X man-page source file FILE-NAME.
Use existing buffer if possible; reformat only if prefix arg given.
When called interactively, optional argument REFORMAT forces reformatting
of an existing WoMan buffer formatted earlier.
No external programs are used, except that `gunzip' will be used to
decompress the file if appropriate. See the documentation for the
`woman' command for further details."
(interactive "fBrowse UN*X manual file: \nP")
(setq woman-last-file-name
(setq file-name (expand-file-name file-name))) ; to canonicalize
(let ((alist-tail woman-buffer-alist) exists)
(setq woman-buffer-number 0)
(while (and alist-tail (not (string= file-name (car (car alist-tail)))))
(setq alist-tail (cdr alist-tail)
woman-buffer-number (1+ woman-buffer-number)))
(or (and (setq exists
(and alist-tail (WoMan-find-buffer))) ; buffer exists
(not reformat))
;; Format new buffer or reformat current buffer:
(let* ((bufname (file-name-nondirectory file-name))
(case-fold-search t)
(compressed
(and (string-match-p woman-file-compression-regexp bufname) t)))
(if compressed
(setq bufname (file-name-sans-extension bufname)))
(setq bufname (if exists
(buffer-name)
(woman-make-bufname bufname)))
(woman-really-find-file file-name compressed bufname)
(or exists
(setq woman-buffer-alist
(cons (cons file-name bufname) woman-buffer-alist)
woman-buffer-number 0)))))
(Man-build-section-list)
(Man-build-references-alist)
(goto-char (point-min)))