Como atualizar a página man no modo man page enquanto edita a fonte de roff:
;;;; MAN / man
(defvar *curr-man* "~/mansv/ls.1")
(defun edman ()
"edit the current work-in-progress man page"
(interactive)
(find-file *curr-man*) )
(defun upman () ; edit: better version of this function below
"update the current work-in-progress man page"
(interactive)
(buffer-menu)
(revert-buffer)
(with-temp-buffer
(progn
(insert-buffer-substring "*Buffer List*")
(beginning-of-buffer)
(let ((man-buffer (format "*Man %s*" *curr-man*)))
(if (word-search-forward man-buffer (point-max) t) ; t = nil on fail
(kill-buffer man-buffer) ))
(man *curr-man*)
(edman)
(kill-buffer "*Buffer List*") )))
EDITAR
Esperamos que esta versão de upman
seja mais estável. Observe a introdução de um novo global.
(defun upman ()
"update the current work-in-progress man page"
(interactive)
(if (get-buffer *curr-man-file*) (save-buffer))
(let ((man-buffer (format "*Man %s*" *curr-man*)))
(if (get-buffer man-buffer) (kill-buffer man-buffer))
(man *curr-man*)
(edman) ))