aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì1994-11-07 12:13:16 +0000
committerFrancesco Potortì1994-11-07 12:13:16 +0000
commit98fd70174f19111c17f46fc3491c95e99941e5c9 (patch)
treec193c42e44aaacaae9e094f254bd5c9ab01f0b31
parenteceb584fa6f083babd8ba03d45d6fa43dbf9f126 (diff)
downloademacs-98fd70174f19111c17f46fc3491c95e99941e5c9.tar.gz
emacs-98fd70174f19111c17f46fc3491c95e99941e5c9.zip
* man.el (Man-reuse-okay-flag): Deleted.
(man, Man-getpage-in-background): Second arg deleted. References to Man-reuse-okay-flag deleted. (Man-follow-manual-reference): First arg deleted. Call Man-getpage-in-background with one argument only.
-rw-r--r--lisp/man.el65
1 files changed, 22 insertions, 43 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 52645b61515..7f77d867c3a 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -3,8 +3,8 @@
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/24 15:34:50 $ 6;; Last-Modified: $Date: 1994/10/27 19:08:03 $
7;; Version: $Revision: 1.55 $ 7;; Version: $Revision: 1.56 $
8;; Keywords: help 8;; Keywords: help
9;; Adapted-By: ESR, pot 9;; Adapted-By: ESR, pot
10 10
@@ -83,9 +83,8 @@
83;; headers, and after the page footer. But it is possible to compute 83;; headers, and after the page footer. But it is possible to compute
84;; the number of blank lines before the page footer by euristhics 84;; the number of blank lines before the page footer by euristhics
85;; only. Is it worth doing? 85;; only. Is it worth doing?
86;; - Allow the Man-reuse-okay-flag to be set to 'always, meaning that all 86;; - Allow a user option to mean that all the manpages should go in
87;; the manpages should go in the same buffer, where they can be browsed 87;; the same buffer, where they can be browsed with M-n and M-p.
88;; with M-n and M-p.
89;; - Allow completion on the manpage name when calling man. This 88;; - Allow completion on the manpage name when calling man. This
90;; requires a reliable list of places where manpages can be found. The 89;; requires a reliable list of places where manpages can be found. The
91;; drawback would be that if the list is not complete, the user might 90;; drawback would be that if the list is not complete, the user might
@@ -145,13 +144,6 @@ Any other value of `Man-notify-method' is equivalent to `meek'.")
145(defvar Man-frame-parameters nil 144(defvar Man-frame-parameters nil
146 "*Frame parameter list for creating a new frame for a manual page.") 145 "*Frame parameter list for creating a new frame for a manual page.")
147 146
148(defvar Man-reuse-okay-flag t
149 "*Reuse a manpage buffer if possible.
150If non-nil, and a manpage buffer already exists with the same
151invocation, man just indicates the manpage is ready according to the
152value of `Man-notify-method'. When nil, it always fires off a
153background process,putting the results in a uniquely named buffer.")
154
155(defvar Man-downcase-section-letters-flag t 147(defvar Man-downcase-section-letters-flag t
156 "*Letters in sections are converted to lower case. 148 "*Letters in sections are converted to lower case.
157Some Un*x man commands can't handle uppercase letters in sections, for 149Some Un*x man commands can't handle uppercase letters in sections, for
@@ -503,31 +495,25 @@ default section number is selected from `Man-auto-section-alist'."
503(defalias 'manual-entry 'man) 495(defalias 'manual-entry 'man)
504 496
505;;;###autoload 497;;;###autoload
506(defun man (man-args prefix-arg) 498(defun man (man-args)
507 "Get a Un*x manual page and put it in a buffer. 499 "Get a Un*x manual page and put it in a buffer.
508This command is the top-level command in the man package. It runs a Un*x 500This command is the top-level command in the man package. It runs a Un*x
509command to retrieve and clean a manpage in the background and places the 501command to retrieve and clean a manpage in the background and places the
510results in a Man mode (manpage browsing) buffer. See variable 502results in a Man mode (manpage browsing) buffer. See variable
511`Man-notify-method' for what happens when the buffer is ready. 503`Man-notify-method' for what happens when the buffer is ready.
512Normally, if a buffer already exists for this man page, it will display 504If a buffer already exists for this man page, it will display immediately."
513immediately; either a prefix argument or a nil value to `Man-reuse-okay-flag'
514overrides this and forces the man page to be regenerated."
515 (interactive 505 (interactive
516 (list 506 (list (let* ((default-entry (Man-default-man-entry))
517 ;; first argument 507 (input (read-string
518 (let* ((default-entry (Man-default-man-entry)) 508 (format "Manual entry%s: "
519 (input (read-string 509 (if (string= default-entry "")
520 (format "Manual entry%s: " 510 ""
521 (if (string= default-entry "") 511 (format " (default %s)" default-entry))))))
522 "" 512 (if (string= input "")
523 (format " (default %s)" default-entry)))))) 513 (if (string= default-entry "")
524 (if (string= input "") 514 (error "No man args given")
525 (if (string= default-entry "") 515 default-entry)
526 (error "No man args given") 516 input))))
527 default-entry)
528 input))
529 ;; second argument
530 current-prefix-arg))
531 517
532 ;; Init the man package variables, if not already done. 518 ;; Init the man package variables, if not already done.
533 (Man-init-defvars) 519 (Man-init-defvars)
@@ -536,20 +522,15 @@ overrides this and forces the man page to be regenerated."
536 ;; "section subject" syntax and possibly downcase the section. 522 ;; "section subject" syntax and possibly downcase the section.
537 (setq man-args (Man-translate-references man-args)) 523 (setq man-args (Man-translate-references man-args))
538 524
539 (Man-getpage-in-background man-args (consp prefix-arg))) 525 (Man-getpage-in-background man-args))
540 526
541 527
542(defun Man-getpage-in-background (topic &optional override-reuse-p) 528(defun Man-getpage-in-background (topic)
543 "Uses TOPIC to build and fire off the manpage and cleaning command. 529 "Uses TOPIC to build and fire off the manpage and cleaning command."
544Optional OVERRIDE-REUSE-P, when non-nil, means to
545start a background process even if a buffer already exists and
546`Man-reuse-okay-flag' is non-nil."
547 (let* ((man-args topic) 530 (let* ((man-args topic)
548 (bufname (concat "*Man " man-args "*")) 531 (bufname (concat "*Man " man-args "*"))
549 (buffer (get-buffer bufname))) 532 (buffer (get-buffer bufname)))
550 (if (and Man-reuse-okay-flag 533 (if buffer
551 (not override-reuse-p)
552 buffer)
553 (Man-notify-when-ready buffer) 534 (Man-notify-when-ready buffer)
554 (require 'env) 535 (require 'env)
555 (message "Invoking %s %s in the background" manual-program man-args) 536 (message "Invoking %s %s in the background" manual-program man-args)
@@ -564,8 +545,7 @@ start a background process even if a buffer already exists and
564 (set-process-sentinel 545 (set-process-sentinel
565 (start-process manual-program buffer "sh" "-c" 546 (start-process manual-program buffer "sh" "-c"
566 (format (Man-build-man-command) man-args)) 547 (format (Man-build-man-command) man-args))
567 'Man-bgproc-sentinel)) 548 'Man-bgproc-sentinel)))))
568 )))
569 549
570(defun Man-notify-when-ready (man-buffer) 550(defun Man-notify-when-ready (man-buffer)
571 "Notify the user when MAN-BUFFER is ready. 551 "Notify the user when MAN-BUFFER is ready.
@@ -744,7 +724,6 @@ The following variables may be of some use. Try
744\"\\[describe-variable] <variable-name> RET\" for more information: 724\"\\[describe-variable] <variable-name> RET\" for more information:
745 725
746Man-notify-method What happens when manpage formatting is done. 726Man-notify-method What happens when manpage formatting is done.
747Man-reuse-okay-flag Reuse already formatted buffer.
748Man-downcase-section-letters-flag Force section letters to lower case. 727Man-downcase-section-letters-flag Force section letters to lower case.
749Man-circular-pages-flag Treat multiple manpage list as circular. 728Man-circular-pages-flag Treat multiple manpage list as circular.
750Man-auto-section-alist List of major modes and their section numbers. 729Man-auto-section-alist List of major modes and their section numbers.