annotate lisp/apropos.el @ 5176:8b2f75cecb89

rename objects* (.c, .h and .el files) to fontcolor* -------------------- ChangeLog entries follow: -------------------- etc/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * dbxrc.in: Rename objects.c -> fontcolor.c. lisp/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * dumped-lisp.el (preloaded-file-list): * font.el (font-tty-find-closest-color): * fontcolor.el: * fontcolor.el (ws-object-property-1): Removed. * fontcolor.el (fontcolor-property-1): New. * fontcolor.el (font-name): * fontcolor.el (font-ascent): * fontcolor.el (font-descent): * fontcolor.el (font-width): * fontcolor.el (font-height): * fontcolor.el (font-proportional-p): * fontcolor.el (font-properties): * fontcolor.el (font-truename): * fontcolor.el (color-name): * fontcolor.el (color-rgb-components): * x-faces.el: Rename objects.el -> fontcolor.el. lwlib/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * lwlib-colors.h: objects*.h -> fontcolor*.h. man/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * internals/internals.texi (A Summary of the Various XEmacs Modules): * internals/internals.texi (Modules for other Display-Related Lisp Objects): objects*.[ch] -> fontcolor*.[ch]. nt/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * xemacs.dsp: * xemacs.mak: * xemacs.mak (OPT_OBJS): objects*.[ch] -> fontcolor*.[ch]. src/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * EmacsFrame.c: * Makefile.in.in (x_objs): * Makefile.in.in (mswindows_objs): * Makefile.in.in (tty_objs): * Makefile.in.in (gtk_objs): * Makefile.in.in (objs): * console-tty.h: * console-x-impl.h: * console-x-impl.h (struct x_device): * console-x.h: * console-xlike-inc.h: * depend: * device-gtk.c: * device-msw.c: * device-x.c: * device-x.c (x_init_device): * device-x.c (x_finish_init_device): * device.c: * devslots.h (MARKED_SLOT): * emacs.c (main_1): * event-Xt.c: * event-gtk.c: * event-msw.c: * faces.c: * font-mgr.c: * fontcolor-gtk-impl.h: * fontcolor-gtk.c: * fontcolor-gtk.c (syms_of_fontcolor_gtk): * fontcolor-gtk.c (console_type_create_fontcolor_gtk): * fontcolor-gtk.c (vars_of_fontcolor_gtk): * fontcolor-gtk.h: * fontcolor-impl.h: * fontcolor-msw-impl.h: * fontcolor-msw.c: * fontcolor-msw.c (syms_of_fontcolor_mswindows): * fontcolor-msw.c (console_type_create_fontcolor_mswindows): * fontcolor-msw.c (reinit_vars_of_fontcolor_mswindows): * fontcolor-msw.c (vars_of_fontcolor_mswindows): * fontcolor-msw.h: * fontcolor-msw.h (mswindows_color_to_string): * fontcolor-tty-impl.h: * fontcolor-tty.c: * fontcolor-tty.c (syms_of_fontcolor_tty): * fontcolor-tty.c (console_type_create_fontcolor_tty): * fontcolor-tty.c (vars_of_fontcolor_tty): * fontcolor-tty.h: * fontcolor-x-impl.h: * fontcolor-x.c: * fontcolor-x.c (syms_of_fontcolor_x): * fontcolor-x.c (console_type_create_fontcolor_x): * fontcolor-x.c (vars_of_fontcolor_x): * fontcolor-x.c (Xatoms_of_fontcolor_x): * fontcolor-x.h: * fontcolor.c: * fontcolor.c (syms_of_fontcolor): * fontcolor.c (specifier_type_create_fontcolor): * fontcolor.c (reinit_specifier_type_create_fontcolor): * fontcolor.c (reinit_vars_of_fontcolor): * fontcolor.c (vars_of_fontcolor): * fontcolor.h: * fontcolor.h (set_face_boolean_attached_to): * frame-gtk.c: * frame-x.c: * glyphs-eimage.c: * glyphs-gtk.c: * glyphs-msw.c: * glyphs-widget.c: * glyphs-x.c: * glyphs.c: * gtk-glue.c: * gtk-glue.c (xemacs_type_register): * gtk-xemacs.c: * inline.c: * intl-win32.c: * lisp.h: * lrecord.h: * mule-charset.c: * native-gtk-toolbar.c: * redisplay-msw.c: * redisplay-tty.c: * redisplay.c: * select-x.c: * select.c: * symsinit.h: * toolbar-msw.c: * toolbar-msw.c (TOOLBAR_ITEM_ID_BITS): * toolbar-x.c: * ui-gtk.c: * window.c: Rename objects*.[ch] -> fontcolor*.[ch]. Fix up all references to the old files (e.g. in #include statements, Makefiles, functions like syms_of_objects_x(), etc.). tests/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * reproduce-crashes.el (8): objects*.[ch] -> fontcolor*.[ch].
author Ben Wing <ben@xemacs.org>
date Mon, 22 Feb 2010 06:49:30 -0600
parents 445bd1969ed0
children 2e528066e2fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; apropos.el --- apropos commands for users and programmers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1989, 1994, 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Author: Joe Wells <jbw@bigbird.bu.edu>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Rewritten: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Maintainer: SL Baur <steve@xemacs.org>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Keywords: help
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
613
023b83f4e54b [xemacs-hg @ 2001-06-10 10:42:16 by ben]
ben
parents: 502
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;;; Synched up with: Last synched with FSF 19.34, diverged since.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;; The ideas for this package were derived from the C code in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;; src/keymap.c and elsewhere. The functions in this file should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 ;; always be byte-compiled for speed. Someone should rewrite this in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;; C (as part of src/keymap.c) for speed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 ;; The idea for super-apropos is based on the original implementation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 ;; by Lynn Slater <lrs@esl.com>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 ;;; ChangeLog:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 ;; Fixed bug, current-local-map can return nil.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 ;; Change, doesn't calculate key-bindings unless needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 ;; Added super-apropos capability, changed print functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 ;;; Made fast-apropos and super-apropos share code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 ;;; Sped up fast-apropos again.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 ;; Added apropos-do-all option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 ;;; Added fast-command-apropos.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 ;; Changed doc strings to comments for helping functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 ;;; Made doc file buffer read-only, buried it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 ;; Only call substitute-command-keys if do-all set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 ;; Optionally use configurable faces to make the output more legible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 ;; Differentiate between command, function and macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 ;; Apropos-command (ex command-apropos) does cmd and optionally user var.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 ;; Apropos shows all 3 aspects of symbols (fn, var and plist)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 ;; Apropos-documentation (ex super-apropos) now finds all it should.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 ;; New apropos-value snoops through all values and optionally plists.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ;; Reading DOC file doesn't load nroff.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 ;; Added hypertext following of documentation, mouse-2 on variable gives value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 ;; from buffer in active window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 ;; I see a degradation of maybe 10-20% only.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 ;; [sb -- FSF protects the face declarations with `if window-system'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 ;; I see no reason why we should do so]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 (defvar apropos-do-all nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 "*Whether the apropos commands should do more.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 Slows them down more or less. Set this non-nil if you have a fast machine.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 ;; XEmacs addition
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 444
diff changeset
72 (defvar apropos-symbol-face (if-boundp 'font-lock-keyword-face
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 font-lock-keyword-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 'bold)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 "*Face for symbol name in apropos output or `nil'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 This looks good, but slows down the commands several times.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 ;; XEmacs addition
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 444
diff changeset
79 (defvar apropos-keybinding-face (if-boundp 'font-lock-string-face
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 font-lock-string-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 'underline)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 "*Face for keybinding display in apropos output or `nil'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 This looks good, but slows down the commands several times.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 ;; XEmacs addition
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 444
diff changeset
86 (defvar apropos-label-face (if-boundp 'font-lock-comment-face
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 font-lock-comment-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 'italic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 "*Face for label (Command, Variable ...) in apropos output or `nil'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 If this is `nil' no mouse highlighting occurs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 This looks good, but slows down the commands several times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 When this is a face name, as it is initially, it gets transformed to a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 text-property list for efficiency.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 ;; XEmacs addition
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 444
diff changeset
96 (defvar apropos-property-face (if-boundp 'font-lock-variable-name-face
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 font-lock-variable-name-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 'bold-italic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 "*Face for property name in apropos output or `nil'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 This looks good, but slows down the commands several times.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (defvar apropos-match-face 'secondary-selection
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 "*Face for matching part in apropos-documentation/value output or `nil'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 This looks good, but slows down the commands several times.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 (defvar apropos-mode-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 (let ((map (make-sparse-keymap)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 (define-key map [(control m)] 'apropos-follow)
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
110 (define-key map [return] 'apropos-follow)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 (define-key map [(button2up)] 'apropos-mouse-follow)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (define-key map [(button2)] 'undefined)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 map)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 "Keymap used in Apropos mode.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 (defvar apropos-regexp nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 "Regexp used in current apropos run.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 (defvar apropos-files-scanned ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 "List of elc files already scanned in current run of `apropos-documentation'.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 (defvar apropos-accumulator ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 "Alist of symbols already found in current apropos run.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 (defvar apropos-item ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 "Current item in or for apropos-accumulator.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 (defvar apropos-mode-hook nil) ; XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 (defun apropos-mode ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 "Major mode for following hyperlinks in output of apropos commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 \\{apropos-mode-map}"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 (kill-all-local-variables)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 (use-local-map apropos-mode-map)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 (setq major-mode 'apropos-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 mode-name "Apropos")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 (run-hooks 'apropos-mode-hook)) ; XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 ;; For auld lang syne:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 (fset 'command-apropos 'apropos-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 (defun apropos-command (apropos-regexp &optional do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 "Shows commands (interactively callable functions) that match REGEXP.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 With optional prefix ARG or if `apropos-do-all' is non-nil, also show
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 variables."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 ;; XEmacs: All code related to special treatment of buffer has been removed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 (interactive (list (read-string (concat "Apropos command "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 (if (or current-prefix-arg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 apropos-do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 "or variable ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 "(regexp): "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 current-prefix-arg))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 (or do-all (setq do-all apropos-do-all))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 (setq apropos-accumulator
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 (apropos-internal apropos-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 (if do-all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 (lambda (symbol) (or (commandp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 (user-variable-p symbol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 'commandp)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 (apropos-print
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 (lambda (p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 (let (doc symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 (while p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 (setcar p (list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 (setq symbol (car p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (if (commandp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 (if (setq doc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 ;; XEmacs change: if obsolete,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 ;; only mention that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 (or (function-obsoleteness-doc symbol)
2275
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
178 (condition-case nil
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
179 (documentation symbol t)
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
180 (void-function "(aliased to undefined function)")
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
181 (error "(unexpected error from `documention')"))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 (substring doc 0 (string-match "\n" doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 "(not documented)"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 (and do-all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 (user-variable-p symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 (if (setq doc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 (or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 ;; XEmacs change: if obsolete,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 ;; only mention that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 (variable-obsoleteness-doc symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 (documentation-property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 symbol 'variable-documentation t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 (substring doc 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 (string-match "\n" doc))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 (setq p (cdr p)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 (defun apropos (apropos-regexp &optional do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 "Show all bound symbols whose names match REGEXP.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 With optional prefix ARG or if `apropos-do-all' is non-nil, also show unbound
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 symbols and key bindings, which is a little more time-consuming.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 Returns list of symbols and documentation found."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 (interactive "sApropos symbol (regexp): \nP")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 ;; XEmacs change: hitting ENTER by mistake is a common mess-up and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 ;; shouldn't make Emacs hang for a long time trying to list all symbols.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (or (> (length apropos-regexp) 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 (error "Must pass non-empty regexp to `apropos'"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 (setq apropos-accumulator
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 (apropos-internal apropos-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 (and (not do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 (not apropos-do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 (lambda (symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 (or (fboundp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 (boundp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 (find-face symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 (symbol-plist symbol))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 (apropos-print
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 (or do-all apropos-do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 (lambda (p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 (let (symbol doc)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 (while p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 (setcar p (list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 (setq symbol (car p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 (if (fboundp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 (if (setq doc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 ;; XEmacs change: if obsolete,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 ;; only mention that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 (or (function-obsoleteness-doc symbol)
2275
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
231 (condition-case nil
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
232 (documentation symbol t)
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
233 (void-function "(aliased to undefined function)")
445bd1969ed0 [xemacs-hg @ 2004-09-15 08:30:25 by stephent]
stephent
parents: 776
diff changeset
234 (error "(unexpected error from `documention')"))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 (substring doc 0 (string-match "\n" doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 "(not documented)"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 (if (boundp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 (if (setq doc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 (or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 ;; XEmacs change: if obsolete,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 ;; only mention that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 (variable-obsoleteness-doc symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 (documentation-property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 symbol 'variable-documentation t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 (substring doc 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (string-match "\n" doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 "(not documented)"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 (if (setq doc (symbol-plist symbol))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 (if (eq (/ (length doc) 2) 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 (format "1 property (%s)" (car doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 (format "%d properties" (/ (length doc) 2))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 (if (get symbol 'widget-type)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 (if (setq doc (documentation-property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 symbol 'widget-documentation t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 (substring doc 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 (string-match "\n" doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 "(not documented)"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (if (find-face symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 (if (setq doc (face-doc-string symbol))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 (substring doc 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 (string-match "\n" doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 "(not documented)"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 (when (get symbol 'custom-group)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 (if (setq doc (documentation-property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 symbol 'group-documentation t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 (substring doc 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 (string-match "\n" doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 "(not documented)"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 (setq p (cdr p)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 (defun apropos-value (apropos-regexp &optional do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 "Show all symbols whose value's printed image matches REGEXP.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 With optional prefix ARG or if `apropos-do-all' is non-nil, also looks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 at the function and at the names and values of properties.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 Returns list of symbols and values found."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 (interactive "sApropos value (regexp): \nP")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 (or do-all (setq do-all apropos-do-all))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 (setq apropos-accumulator ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 (let (f v p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 (mapatoms
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 (lambda (symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 (setq f nil v nil p nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 (or (memq symbol '(apropos-regexp do-all apropos-accumulator
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 symbol f v p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 (setq v (apropos-value-internal 'boundp symbol 'symbol-value)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 (if do-all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 (setq f (apropos-value-internal 'fboundp symbol 'symbol-function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 p (apropos-format-plist symbol "\n " t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 (if (or f v p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 (setq apropos-accumulator (cons (list symbol f v p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 apropos-accumulator))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 (apropos-print nil nil t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 (defun apropos-documentation (apropos-regexp &optional do-all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 "Show symbols whose documentation contain matches for REGEXP.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 With optional prefix ARG or if `apropos-do-all' is non-nil, also use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 documentation that is not stored in the documentation file and show key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 bindings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 Returns list of symbols and documentation found."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 (interactive "sApropos documentation (regexp): \nP")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 (or do-all (setq do-all apropos-do-all))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 (setq apropos-accumulator () apropos-files-scanned ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 (let ((standard-input (get-buffer-create " apropos-temp"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 f v)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 (unwind-protect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 (set-buffer standard-input)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 (apropos-documentation-check-doc-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 (if do-all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 (mapatoms
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 (lambda (symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 (setq f (apropos-safe-documentation symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 v (get symbol 'variable-documentation))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 (when (integerp v) (setq v nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 (setq f (apropos-documentation-internal f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 v (apropos-documentation-internal v))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 (if (or f v)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 (if (setq apropos-item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 (cdr (assq symbol apropos-accumulator)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 (if f
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 (setcar apropos-item f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 (if v
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 (setcar (cdr apropos-item) v)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 (setq apropos-accumulator
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 (cons (list symbol f v)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 apropos-accumulator)))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 (apropos-print nil nil t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 (kill-buffer standard-input))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 (defun apropos-value-internal (predicate symbol function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 (if (funcall predicate symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 (setq symbol (prin1-to-string (funcall function symbol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 (if (string-match apropos-regexp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 (if apropos-match-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 (put-text-property (match-beginning 0) (match-end 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 'face apropos-match-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 symbol))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 symbol)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 (defun apropos-documentation-internal (doc)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 (if (consp doc)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 (apropos-documentation-check-elc-file (car doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 (and doc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 (string-match apropos-regexp doc)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 (if apropos-match-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 (put-text-property (match-beginning 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 (match-end 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 'face apropos-match-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 (setq doc (copy-sequence doc))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 doc))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 (defun apropos-format-plist (pl sep &optional compare)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 (setq pl (symbol-plist pl))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 (let (p p-out)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 (while pl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 (setq p (format "%s %S" (car pl) (nth 1 pl)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 (if (or (not compare) (string-match apropos-regexp p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 (if apropos-property-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 (put-text-property 0 (length (symbol-name (car pl)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 'face apropos-property-face p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 (setq p nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 (if p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 (and compare apropos-match-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 (put-text-property (match-beginning 0) (match-end 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 'face apropos-match-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 (setq p-out (concat p-out (if p-out sep) p))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 (setq pl (nthcdr 2 pl)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 p-out))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 ;; Finds all documentation related to APROPOS-REGEXP in internal-doc-file-name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 (defun apropos-documentation-check-doc-file ()
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
386 (let (type symbol (sepa 2) sepb start end doc)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 (insert ?\^_)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 (backward-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 (insert-file-contents (concat doc-directory internal-doc-file-name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 (forward-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 (while (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 (setq sepb (search-forward "\^_"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 (not (eobp)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 (beginning-of-line 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 (if (save-restriction
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 (narrow-to-region (point) (1- sepb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 (re-search-forward apropos-regexp nil t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 (progn
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
399 (setq start (match-beginning 0)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 end (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 (goto-char (1+ sepa))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 (or (setq type (if (eq ?F (preceding-char))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 1 ; function documentation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 2) ; variable documentation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 symbol (read)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
406 start (- start (point) 1)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 end (- end (point) 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 doc (buffer-substring (1+ (point)) (1- sepb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 apropos-item (assq symbol apropos-accumulator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 (setq apropos-item (list symbol nil nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 apropos-accumulator (cons apropos-item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 apropos-accumulator)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 (if apropos-match-face
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
414 (put-text-property start end 'face apropos-match-face doc))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 (setcar (nthcdr type apropos-item) doc)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 (setq sepa (goto-char sepb)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 (defun apropos-documentation-check-elc-file (file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 (if (member file apropos-files-scanned)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 nil
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
421 (let (symbol doc start end this-is-a-variable)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 (setq apropos-files-scanned (cons file apropos-files-scanned))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 (insert-file-contents file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 (while (search-forward "\n#@" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 ;; Read the comment length, and advance over it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 (setq end (read)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
428 start (1+ (point))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 end (+ (point) end -1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 (forward-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 (if (save-restriction
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 ;; match ^ and $ relative to doc string
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
433 (narrow-to-region start end)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 (re-search-forward apropos-regexp nil t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 (goto-char (+ end 2))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
437 (setq doc (buffer-substring start end)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
438 end (- (match-end 0) start)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
439 start (- (match-beginning 0) start)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 this-is-a-variable (looking-at "(def\\(var\\|const\\) ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 symbol (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 (skip-chars-forward "(a-z")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 (forward-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 (read))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 symbol (if (consp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 (nth 1 symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 symbol))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 (if (if this-is-a-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 (get symbol 'variable-documentation)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 (and (fboundp symbol) (apropos-safe-documentation symbol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 (or (setq apropos-item (assq symbol apropos-accumulator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 (setq apropos-item (list symbol nil nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 apropos-accumulator (cons apropos-item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 apropos-accumulator)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 (if apropos-match-face
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
457 (put-text-property start end 'face apropos-match-face
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 doc))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 (setcar (nthcdr (if this-is-a-variable 2 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 apropos-item)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 doc)))))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 (defun apropos-safe-documentation (function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 "Like documentation, except it avoids calling `get_doc_string'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 Will return nil instead."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 (while (and function (symbolp function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 (setq function (if (fboundp function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 (symbol-function function))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 (if (eq (car-safe function) 'macro)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 (setq function (cdr function)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 ;; XEmacs change from: (setq function (if (byte-code-function-p function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 (setq function (if (compiled-function-p function)
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 613
diff changeset
475 (if-fboundp 'compiled-function-doc-string
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 (compiled-function-doc-string function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 (if (> (length function) 4)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 (aref function 4)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 (if (eq (car-safe function) 'autoload)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 (nth 2 function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 (if (eq (car-safe function) 'lambda)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 (if (stringp (nth 2 function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 (nth 2 function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 (if (stringp (nth 3 function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 (nth 3 function)))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 (if (integerp function)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 (defun apropos-print (do-keys doc-fn spacing)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 "Output result of various apropos commands with `apropos-regexp'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 APROPOS-ACCUMULATOR is a list. Optional DOC-FN is called for each element
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 of apropos-accumulator and may modify it resulting in (symbol fn-doc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 var-doc [plist-doc]). Returns sorted list of symbols and documentation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 found."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 (if (null apropos-accumulator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 (message "No apropos matches for `%s'" apropos-regexp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 (if doc-fn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 (funcall doc-fn apropos-accumulator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 (setq apropos-accumulator
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 (sort apropos-accumulator (lambda (a b)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 (string-lessp (car a) (car b)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 (and apropos-label-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 (or (symbolp apropos-label-face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 (facep apropos-label-face)) ; XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 (setq apropos-label-face `(face ,apropos-label-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 mouse-face highlight)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 (let ((help-buffer-prefix-string "Apropos"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 (with-displaying-help-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 (lambda ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 (with-current-buffer standard-output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 (run-hooks 'apropos-mode-hook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 (let ((p apropos-accumulator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 (old-buffer (current-buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 symbol item point1 point2)
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
518 ;; Mostly useless but to provide better keymap
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
519 ;; explanation. help-mode-map will be used instead.
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
520 (use-local-map apropos-mode-map)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 ;; XEmacs change from (if window-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 (if (device-on-window-system-p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 (princ "If you move the mouse over text that changes color,\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 (princ (substitute-command-keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 "you can click \\[apropos-mouse-follow] to get more information.\n"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 (princ (substitute-command-keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 "Type \\[apropos-follow] in this buffer to get full documentation.\n\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 (while (consp p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 (or (not spacing) (bobp) (terpri))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 (setq apropos-item (car p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 symbol (car apropos-item)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 p (cdr p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 point1 (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 (princ symbol) ; print symbol name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 (setq point2 (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 ;; Calculate key-bindings if we want them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 (and do-keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 (commandp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 (indent-to 30 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 (if (let ((keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 (set-buffer old-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 (where-is-internal symbol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 filtered)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 ;; Copy over the list of key sequences,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 ;; omitting any that contain a buffer or a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 (while keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 (let ((key (car keys))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 (i 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 loser)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 (while (< i (length key))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 (if (or (framep (aref key i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 (bufferp (aref key i)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 (setq loser t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 (setq i (1+ i)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 (or loser
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 (setq filtered (cons key filtered))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 (setq keys (cdr keys)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 (setq item filtered))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 ;; Convert the remaining keys to a string and insert.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 (princ
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 (mapconcat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 (lambda (key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 (setq key (key-description key))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 (if apropos-keybinding-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 (put-text-property 0 (length key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 'face apropos-keybinding-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 key))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 item ", "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 (princ "Type ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 (princ "M-x")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 (put-text-property (- (point) 3) (point)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 'face apropos-keybinding-face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 (princ (format " %s " (symbol-name symbol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 (princ "RET")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 (put-text-property (- (point) 3) (point)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 'face apropos-keybinding-face)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 (terpri)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 ;; only now so we don't propagate text attributes all over
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 (put-text-property point1 point2 'item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 (if (eval `(or ,@(cdr apropos-item)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 (car apropos-item)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585 apropos-item))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 (if apropos-symbol-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 (put-text-property point1 point2 'face apropos-symbol-face))
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
588 ;; Add text-property on symbol, too.
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
589 (put-text-property point1 point2 'keymap apropos-mode-map)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 (apropos-print-doc 'describe-function 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 (if (commandp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 "Command"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 (if (apropos-macrop symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 "Macro"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 "Function"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 do-keys)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 (if (get symbol 'custom-type)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 (apropos-print-doc 'customize-variable-other-window 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 "User Option" do-keys)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 (apropos-print-doc 'describe-variable 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 "Variable" do-keys))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 (apropos-print-doc 'customize-other-window 6 "Group" do-keys)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 (apropos-print-doc 'customize-face-other-window 5 "Face" do-keys)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 (apropos-print-doc 'widget-browse-other-window 4 "Widget" do-keys)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 (apropos-print-doc 'apropos-describe-plist 3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 "Plist" nil)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 apropos-regexp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 (prog1 apropos-accumulator
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 (setq apropos-accumulator ())))) ; permit gc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 (defun apropos-macrop (symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 "Return t if SYMBOL is a Lisp macro."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 (and (fboundp symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 (consp (setq symbol
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 (symbol-function symbol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 (or (eq (car symbol) 'macro)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 (if (eq (car symbol) 'autoload)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 (memq (nth 4 symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 '(macro t))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 (defun apropos-print-doc (action i str do-keys)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 (with-current-buffer standard-output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 (if (stringp (setq i (nth i apropos-item)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 (insert " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 (put-text-property (- (point) 2) (1- (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 'action action)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 (insert str ": ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 (if apropos-label-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 (add-text-properties (- (point) (length str) 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 (1- (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 apropos-label-face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 (add-text-properties (- (point) (length str) 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 (1- (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 (list 'keymap apropos-mode-map))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 (insert (if do-keys (substitute-command-keys i) i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 (or (bolp) (terpri))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 (defun apropos-mouse-follow (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 (interactive "e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 ;; XEmacs change: We're using the standard help buffer code now, don't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 ;; do special tricks about trying to preserve current-buffer about mouse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 ;; clicks.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 ;; XEmacs change from:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 ;; (set-buffer (window-buffer (posn-window (event-start event))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 ;; (goto-char (posn-point (event-start event)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 (set-buffer (event-buffer event))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 (goto-char (event-closest-point event))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 ;; XEmacs change: following code seems useless
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 ;;(or (and (not (eobp)) (get-text-property (point) 'mouse-face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 ;; (and (not (bobp)) (get-text-property (1- (point)) 'mouse-face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 ;; (error "There is nothing to follow here"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 (apropos-follow)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 (defun apropos-follow (&optional other)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 (let* (;; Properties are always found at the beginning of the line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 (bol (save-excursion (beginning-of-line) (point)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 ;; If there is no `item' property here, look behind us.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665 (item (get-text-property bol 'item))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 (item-at (if item nil (previous-single-property-change bol 'item)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 ;; Likewise, if there is no `action' property here, look in front.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 (action (get-text-property bol 'action))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 (action-at (if action nil (next-single-property-change bol 'action))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 (and (null item) item-at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 (setq item (get-text-property (1- item-at) 'item)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 (and (null action) action-at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 (setq action (get-text-property action-at 'action)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 (if (not (and item action))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 (error "There is nothing to follow here"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676 (if (consp item) (error "There is nothing to follow in `%s'" (car item)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 (if other (set-buffer other))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 (funcall action item)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 (defun apropos-describe-plist (symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 "Display a pretty listing of SYMBOL's plist."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 (let ((help-buffer-prefix-string "Apropos-plist"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 (with-displaying-help-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 (lambda ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 (run-hooks 'apropos-mode-hook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 (princ "Symbol ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 (prin1 symbol)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690 (princ "'s plist is\n (")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 (with-current-buffer standard-output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 (if apropos-symbol-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 (put-text-property 8 (- (point) 14) 'face apropos-symbol-face)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 (princ (apropos-format-plist symbol "\n "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 (princ ")")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 (terpri)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 (print-help-return-message))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 (symbol-name symbol))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 (provide 'apropos) ; XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 ;;; apropos.el ends here