aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì1994-10-06 10:28:26 +0000
committerFrancesco Potortì1994-10-06 10:28:26 +0000
commitd0aede3f50076ffda6d2991a5e77d3e0fae4df72 (patch)
tree8bb00b7d1506291d301063bee8bfeca0e95c4d1a
parent0fb53770ced9c9e1f34c318d2bebf0e37e46bcb5 (diff)
downloademacs-d0aede3f50076ffda6d2991a5e77d3e0fae4df72.tar.gz
emacs-d0aede3f50076ffda6d2991a5e77d3e0fae4df72.zip
* man.el (Man-notify, Man-current-page, Man-page-list,
Man-filter-list, Man-original-frame, Man-arguments, Man-fontify-manpage-flag, Man-sections-alist, Man-refpages-alist, Man-uses-untabify-flag, Man-page-mode-string, Man-sed-script): Added defvar's to keep the compiler quiet. (Man-getpage-in-background): Start buffer name with "*Man ". instead of "*man " to avoid conflict with "*mail*". (Man-match-substring): Defsubst moved before first call. (Man-build-page-list, Man-strip-page-headers, Man-unindent): Use defun instead of defsubst, for code clarity purpose.
-rw-r--r--lisp/man.el51
1 files changed, 34 insertions, 17 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 919d1ad9e2d..40629865bd2 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/09/29 12:42:45 $ 6;; Last-Modified: $Date: 1994/10/01 13:27:15 $
7;; Version: $Revision: 1.50 $ 7;; Version: $Revision: 1.51 $
8;; Keywords: help 8;; Keywords: help
9;; Adapted-By: ESR, pot 9;; Adapted-By: ESR, pot
10 10
@@ -92,11 +92,28 @@
92;; be led to believe that the manpages in the missing directories do 92;; be led to believe that the manpages in the missing directories do
93;; not exist. 93;; not exist.
94 94
95
95;;; Code: 96;;; Code:
96 97
97(require 'assoc) 98(require 'assoc)
98 99
99;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 100;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
101;; empty defvars (keep the compiler quiet)
102
103(defvar Man-notify)
104(defvar Man-current-page)
105(defvar Man-page-list)
106(defvar Man-filter-list)
107(defvar Man-original-frame)
108(defvar Man-arguments)
109(defvar Man-fontify-manpage-flag)
110(defvar Man-sections-alist)
111(defvar Man-refpages-alist)
112(defvar Man-uses-untabify-flag)
113(defvar Man-page-mode-string)
114(defvar Man-sed-script)
115
116;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
100;; user variables 117;; user variables
101 118
102(defvar manual-program "man" 119(defvar manual-program "man"
@@ -307,7 +324,7 @@ This is necessary if one wants to dump man.el with emacs."
307 ;; Man-untabify-command nil nil nil 324 ;; Man-untabify-command nil nil nil
308 ;; (append Man-untabify-command-args 325 ;; (append Man-untabify-command-args
309 ;; (list "/etc/passwd"))))) 326 ;; (list "/etc/passwd")))))
310 "Use `untabify', because Man-untabify-command cannot do that.") 327 "When non-nil use `untabify' instead of Man-untabify-command.")
311 328
312 (defconst Man-sed-script 329 (defconst Man-sed-script
313 (cond 330 (cond
@@ -373,6 +390,16 @@ commands appear in the association list. The final output is placed in
373the manpage buffer.") 390the manpage buffer.")
374) 391)
375 392
393(defsubst Man-match-substring (&optional n string)
394 "Return the substring matched by the last search.
395Optional arg N means return the substring matched by the Nth paren
396grouping. Optional second arg STRING means return a substring from
397that string instead of from the current buffer."
398 (if (null n) (setq n 0))
399 (if string
400 (substring string (match-beginning n) (match-end n))
401 (buffer-substring (match-beginning n) (match-end n))))
402
376(defsubst Man-make-page-mode-string () 403(defsubst Man-make-page-mode-string ()
377 "Formats part of the mode line for Man mode." 404 "Formats part of the mode line for Man mode."
378 (format "%s page %d of %d" 405 (format "%s page %d of %d"
@@ -433,16 +460,6 @@ and the Man-section-translations-alist variables)."
433 slist nil)))) 460 slist nil))))
434 (concat Man-specified-section-option section " " name)))) 461 (concat Man-specified-section-option section " " name))))
435 462
436(defsubst Man-match-substring (&optional n string)
437 "Return the substring matched by the last search.
438Optional arg N means return the substring matched by the Nth paren
439grouping. Optinal second arg STRING means return a substring from
440that string instead of from the current buffer."
441 (if (null n) (setq n 0))
442 (if string
443 (substring string (match-beginning n) (match-end n))
444 (buffer-substring (match-beginning n) (match-end n))))
445
446 463
447;; ====================================================================== 464;; ======================================================================
448;; default man entry: get word under point 465;; default man entry: get word under point
@@ -526,7 +543,7 @@ Optional OVERRIDE-REUSE-P, when non-nil, means to
526start a background process even if a buffer already exists and 543start a background process even if a buffer already exists and
527`Man-reuse-okay-flag' is non-nil." 544`Man-reuse-okay-flag' is non-nil."
528 (let* ((man-args topic) 545 (let* ((man-args topic)
529 (bufname (concat "*man " man-args "*")) 546 (bufname (concat "*Man " man-args "*"))
530 (buffer (get-buffer bufname))) 547 (buffer (get-buffer bufname)))
531 (if (and Man-reuse-okay-flag 548 (if (and Man-reuse-okay-flag
532 (not override-reuse-p) 549 (not override-reuse-p)
@@ -798,7 +815,7 @@ The following key bindings are currently in effect in the buffer:
798 (aput 'Man-refpages-alist word)))) 815 (aput 'Man-refpages-alist word))))
799 (skip-chars-forward " \t\n,"))))))) 816 (skip-chars-forward " \t\n,")))))))
800 817
801(defsubst Man-build-page-list () 818(defun Man-build-page-list ()
802 "Build the list of separate manpages in the buffer." 819 "Build the list of separate manpages in the buffer."
803 (setq Man-page-list nil) 820 (setq Man-page-list nil)
804 (let ((page-start (point-min)) 821 (let ((page-start (point-min))
@@ -830,7 +847,7 @@ The following key bindings are currently in effect in the buffer:
830 (setq page-start page-end) 847 (setq page-start page-end)
831 ))) 848 )))
832 849
833(defsubst Man-strip-page-headers () 850(defun Man-strip-page-headers ()
834 "Strip all the page headers but the first from the manpage." 851 "Strip all the page headers but the first from the manpage."
835 (let ((buffer-read-only nil) 852 (let ((buffer-read-only nil)
836 (case-fold-search nil) 853 (case-fold-search nil)
@@ -855,7 +872,7 @@ The following key bindings are currently in effect in the buffer:
855 (replace-match ""))) 872 (replace-match "")))
856 (setq page-list (cdr page-list))))) 873 (setq page-list (cdr page-list)))))
857 874
858(defsubst Man-unindent () 875(defun Man-unindent ()
859 "Delete the leading spaces that indent the manpage." 876 "Delete the leading spaces that indent the manpage."
860 (let ((buffer-read-only nil) 877 (let ((buffer-read-only nil)
861 (case-fold-search nil) 878 (case-fold-search nil)