Commit 55fb4ff7 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Man-bgproc-sentinel): Check here for failure to find

any man page in the output, and report the error here.
(Man-arguments): Make it permanent local.
(Man-goto-page): New arg NOERROR.  Never kill the current buffer.
(Man-mode): Pass t for NOERROR.
parent 69517e25
2005-07-23 Richard M. Stallman <rms@gnu.org>
* man.el (Man-bgproc-sentinel): Check here for failure to find
any man page in the output, and report the error here.
(Man-arguments): Make it permanent local.
(Man-goto-page): New arg NOERROR. Never kill the current buffer.
(Man-mode): Pass t for NOERROR.
* progmodes/grep.el (grep-error-face): Use font-lock-keyword-face
(grep-mode-font-lock-keywords):
Don't use compilation-...-face for messages that are not file names.
* progmodes/compile.el (compilation-mode-font-lock-keywords):
Don't use compilation-...-face for messages that are not file names.
2005-07-22 Juri Linkov <juri@jurta.org> 2005-07-22 Juri Linkov <juri@jurta.org>
   
* simple.el (line-move-1): Fix comments. * simple.el (line-move-1): Fix comments.
......
...@@ -352,6 +352,7 @@ Otherwise, the value is whatever the function ...@@ -352,6 +352,7 @@ Otherwise, the value is whatever the function
(make-variable-buffer-local 'Man-page-mode-string) (make-variable-buffer-local 'Man-page-mode-string)
(make-variable-buffer-local 'Man-original-frame) (make-variable-buffer-local 'Man-original-frame)
(make-variable-buffer-local 'Man-arguments) (make-variable-buffer-local 'Man-arguments)
(put 'Man-arguments 'permanent-local t)
(setq-default Man-sections-alist nil) (setq-default Man-sections-alist nil)
(setq-default Man-refpages-alist nil) (setq-default Man-refpages-alist nil)
...@@ -1005,8 +1006,15 @@ manpage command." ...@@ -1005,8 +1006,15 @@ manpage command."
(if Man-fontify-manpage-flag (if Man-fontify-manpage-flag
(Man-fontify-manpage) (Man-fontify-manpage)
(Man-cleanup-manpage)) (Man-cleanup-manpage))
(run-hooks 'Man-cooked-hook) (run-hooks 'Man-cooked-hook)
(Man-mode) (Man-mode)
(if (not Man-page-list)
(let ((args Man-arguments))
(kill-buffer (current-buffer))
(error "Can't find the %s manpage" args)))
(set-buffer-modified-p nil) (set-buffer-modified-p nil)
)) ))
;; Restore case-fold-search before calling ;; Restore case-fold-search before calling
...@@ -1082,7 +1090,7 @@ The following key bindings are currently in effect in the buffer: ...@@ -1082,7 +1090,7 @@ The following key bindings are currently in effect in the buffer:
(Man-build-page-list) (Man-build-page-list)
(Man-strip-page-headers) (Man-strip-page-headers)
(Man-unindent) (Man-unindent)
(Man-goto-page 1) (Man-goto-page 1 t)
(run-mode-hooks 'Man-mode-hook)) (run-mode-hooks 'Man-mode-hook))
(defsubst Man-build-section-alist () (defsubst Man-build-section-alist ()
...@@ -1342,35 +1350,32 @@ Specify which REFERENCE to use; default is based on word at point." ...@@ -1342,35 +1350,32 @@ Specify which REFERENCE to use; default is based on word at point."
(interactive) (interactive)
(quit-window)) (quit-window))
(defun Man-goto-page (page) (defun Man-goto-page (page noerror)
"Go to the manual page on page PAGE." "Go to the manual page on page PAGE."
(interactive (interactive
(if (not Man-page-list) (if (not Man-page-list)
(let ((args Man-arguments)) (error "Not a man page buffer")
(kill-buffer (current-buffer))
(error "Can't find the %s manpage" args))
(if (= (length Man-page-list) 1) (if (= (length Man-page-list) 1)
(error "You're looking at the only manpage in the buffer") (error "You're looking at the only manpage in the buffer")
(list (read-minibuffer (format "Go to manpage [1-%d]: " (list (read-minibuffer (format "Go to manpage [1-%d]: "
(length Man-page-list))))))) (length Man-page-list)))))))
(if (not Man-page-list) (if (and (not Man-page-list) (not noerror))
(let ((args Man-arguments)) (error "Not a man page buffer"))
(kill-buffer (current-buffer)) (when Man-page-list
(error "Can't find the %s manpage" args))) (if (or (< page 1)
(if (or (< page 1) (> page (length Man-page-list)))
(> page (length Man-page-list))) (error "No manpage %d found" page))
(error "No manpage %d found" page)) (let* ((page-range (nth (1- page) Man-page-list))
(let* ((page-range (nth (1- page) Man-page-list)) (page-start (car page-range))
(page-start (car page-range)) (page-end (car (cdr page-range))))
(page-end (car (cdr page-range)))) (setq Man-current-page page
(setq Man-current-page page Man-page-mode-string (Man-make-page-mode-string))
Man-page-mode-string (Man-make-page-mode-string)) (widen)
(widen) (goto-char page-start)
(goto-char page-start) (narrow-to-region page-start page-end)
(narrow-to-region page-start page-end) (Man-build-section-alist)
(Man-build-section-alist) (Man-build-references-alist)
(Man-build-references-alist) (goto-char (point-min)))))
(goto-char (point-min))))
(defun Man-next-manpage () (defun Man-next-manpage ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment