annotate lisp/hyper-apropos.el @ 251:677f6a0ee643 r20-5b24

Import from CVS: tag r20-5b24
author cvs
date Mon, 13 Aug 2007 10:19:59 +0200
parents 41f2f0e326e9
children 70ad99077275
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1 ;;; hyper-apropos.el --- Hypertext emacs lisp documentation interface.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
2
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
4 ;; Copyright (C) 1994, 1995 Tinker Systems and INS Engineering Corp.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Sun Microsystems.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
6 ;; Copyright (C) 1996 Ben Wing.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
7
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
8 ;; Maintainer: Jonathan Stigelman <Stig@hackvan.com>
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
9 ;; Keywords: lisp, tools, help, docs, matching
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
10
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
12
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2 of the License, or
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
16 ;; (at your option) any later version.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
17 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful,
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
21 ;; GNU General Public License for more details.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
22 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
24 ;; along with XEmacs; if not, write to the Free Software
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
25 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
26
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
27 ;;; Synched up with: Not in FSF.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
28
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
29 ;;; Commentary:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
30
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
31 ;; based upon emacs-apropos.el by Frank C. Guida <fcg@philabs.philips.com>
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
32 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
33 ;; Rather than run apropos and print all the documentation at once,
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
34 ;; I find it easier to view a "table of contents" first, then
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
35 ;; get the details for symbols as you need them.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
36 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
37 ;; This version of apropos prints two lists of symbols matching the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
38 ;; given regexp: functions/macros and variables/constants.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
39 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
40 ;; The user can then do the following:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
41 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
42 ;; - add an additional regexp to narrow the search
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
43 ;; - display documentation for the current symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
44 ;; - find the tag for the current symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
45 ;; - show any keybindings if the current symbol is a command
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
46 ;; - invoke functions
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
47 ;; - set variables
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
48 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
49 ;; An additional feature is the ability to search the current tags
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
50 ;; table, allowing you to interrogate functions not yet loaded (this
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
51 ;; isn't available with the standard package).
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
52 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
53 ;; Mouse bindings and menus are provided for XEmacs.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
54 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
55 ;; additions by Ben Wing <wing@666.com> July 1995:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
56 ;; added support for function aliases, made programmer's apropos be the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
57 ;; default, various other hacking.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
58 ;; Massive changes by Christoph Wedler <wedler@fmi.uni-passau.de>
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
59 ;; Some changes for XEmacs 20.3 by hniksic
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
60
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
61 ;; ### The maintainer is supposed to be stig, but I haven't seen him
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
62 ;; around for ages. The real maintainer for the moment is Hrvoje
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
63 ;; Niksic <hniksic@srce.hr>.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
64
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
65 ;;; Code:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
66
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
67 (defgroup hyper-apropos nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
68 "Hypertext emacs lisp documentation interface."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
69 :group 'docs
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
70 :group 'lisp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
71 :group 'tools
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
72 :group 'help
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
73 :group 'matching)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
74
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
75 (defcustom hyper-apropos-show-brief-docs t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
76 "*If non-nil, display some documentation in the \"*Hyper Apropos*\" buffer.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
77 Setting this to nil will speed up searches."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
78 :type 'boolean
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
79 :group 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
80 (define-obsolete-variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
81 'hypropos-show-brief-docs 'hyper-apropos-show-brief-docs)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
82 ;; I changed this to true because I think it's more useful this way. --ben
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
83
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
84 (defcustom hyper-apropos-programming-apropos t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
85 "*If non-nil, list all the functions and variables.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
86 This will cause more output to be generated, and take a longer time.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
87
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
88 Otherwise, only the interactive functions and user variables will be listed."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
89 :type 'boolean
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
90 :group 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
91 (define-obsolete-variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
92 'hypropos-programming-apropos 'hyper-apropos-programming-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
93
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
94 (defcustom hyper-apropos-shrink-window nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
95 "*If non-nil, shrink *Hyper Help* buffer if possible."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
96 :type 'boolean
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
97 :group 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
98 (define-obsolete-variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
99 'hypropos-shrink-window 'hyper-apropos-shrink-window)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
100
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
101 (defcustom hyper-apropos-prettyprint-long-values t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
102 "*If non-nil, then try to beautify the printing of very long values."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
103 :type 'boolean
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
104 :group 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
105 (define-obsolete-variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
106 'hypropos-prettyprint-long-values 'hyper-apropos-prettyprint-long-values)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
107
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
108 (defgroup hyper-apropos-faces nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
109 "Faces defined by hyper-apropos."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
110 :prefix "hyper-apropos-"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
111 :group 'faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
112
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
113 (defface hyper-apropos-documentation
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
114 '((((class color) (background light))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
115 (:foreground "darkred"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
116 (((class color) (background dark))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
117 (:foreground "gray90")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
118 "Hyper-apropos documentation."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
119 :group 'hyper-apropos-faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
120
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
121 (defface hyper-apropos-hyperlink
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
122 '((((class color) (background light))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
123 (:foreground "blue4"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
124 (((class color) (background dark))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
125 (:foreground "lightseagreen"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
126 (t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
127 (:bold t)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
128 "Hyper-apropos hyperlinks."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
129 :group 'hyper-apropos-faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
130
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
131 (defface hyper-apropos-major-heading '((t (:bold t)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
132 "Hyper-apropos major heading."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
133 :group 'hyper-apropos-faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
134
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
135 (defface hyper-apropos-section-heading '((t (:bold t :italic t)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
136 "Hyper-apropos section heading."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
137 :group 'hyper-apropos-faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
138
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
139 (defface hyper-apropos-heading '((t (:bold t)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
140 "Hyper-apropos heading."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
141 :group 'hyper-apropos-faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
142
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
143 (defface hyper-apropos-warning '((t (:bold t :foreground "red")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
144 "Hyper-apropos warning."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
145 :group 'hyper-apropos-faces)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
146
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
147 ;;; Internal variables below this point
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
148
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
149 (defvar hyper-apropos-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
150 (defvar hyper-apropos-prev-wconfig)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
151
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
152 (defvar hyper-apropos-help-map
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
153 (let ((map (make-sparse-keymap)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
154 (suppress-keymap map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
155 (set-keymap-name map 'hyper-apropos-help-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
156 ;; movement
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
157 (define-key map " " 'scroll-up)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
158 (define-key map "b" 'scroll-down)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
159 (define-key map [delete] 'scroll-down)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
160 (define-key map [backspace] 'scroll-down)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
161 (define-key map "/" 'isearch-forward)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
162 (define-key map "?" 'isearch-backward)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
163 ;; follow links
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
164 (define-key map [return] 'hyper-apropos-get-doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
165 (define-key map "s" 'hyper-apropos-set-variable)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
166 (define-key map "t" 'hyper-apropos-find-tag)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
167 (define-key map "l" 'hyper-apropos-last-help)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
168 (define-key map "c" 'hyper-apropos-customize-variable)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
169 (define-key map "f" 'hyper-apropos-find-function)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
170 (define-key map [button2] 'hyper-apropos-mouse-get-doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
171 (define-key map [button3] 'hyper-apropos-popup-menu)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
172 ;; for the totally hardcore...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
173 (define-key map "D" 'hyper-apropos-disassemble)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
174 ;; administrativa
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
175 (define-key map "a" 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
176 (define-key map "n" 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
177 (define-key map "q" 'hyper-apropos-quit)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
178 map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
179 "Keybindings for the *Hyper Help* buffer and the *Hyper Apropos* buffer")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
180 (define-obsolete-variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
181 'hypropos-help-map 'hyper-apropos-help-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
182
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
183 (defvar hyper-apropos-map
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
184 (let ((map (make-sparse-keymap)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
185 (set-keymap-name map 'hyper-apropos-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
186 (set-keymap-parents map (list hyper-apropos-help-map))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
187 ;; slightly different scrolling...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
188 (define-key map " " 'hyper-apropos-scroll-up)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
189 (define-key map "b" 'hyper-apropos-scroll-down)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
190 (define-key map [delete] 'hyper-apropos-scroll-down)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
191 (define-key map [backspace] 'hyper-apropos-scroll-down)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
192 ;; act on the current line...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
193 (define-key map "w" 'hyper-apropos-where-is)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
194 (define-key map "i" 'hyper-apropos-invoke-fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
195 ;; this is already defined in the parent-keymap above, isn't it?
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
196 ;; (define-key map "s" 'hyper-apropos-set-variable)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
197 ;; more administrativa...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
198 (define-key map "P" 'hyper-apropos-toggle-programming-flag)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
199 (define-key map "k" 'hyper-apropos-add-keyword)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
200 (define-key map "e" 'hyper-apropos-eliminate-keyword)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
201 map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
202 "Keybindings for the *Hyper Apropos* buffer.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
203 This map inherits from `hyper-apropos-help-map.'")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
204 (define-obsolete-variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
205 'hypropos-map 'hyper-apropos-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
206
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
207 ;;(defvar hyper-apropos-mousable-keymap
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
208 ;; (let ((map (make-sparse-keymap)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
209 ;; (define-key map [button2] 'hyper-apropos-mouse-get-doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
210 ;; map))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
211
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
212 (defvar hyper-apropos-mode-hook nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
213 "*User function run after hyper-apropos mode initialization. Usage:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
214 \(setq hyper-apropos-mode-hook '(lambda () ... your init forms ...)).")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
215
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
216 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
218 (defconst hyper-apropos-junk-regexp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
219 "^Apropos\\|^Functions\\|^Variables\\|^$")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
220
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
221 (defvar hyper-apropos-currently-showing nil) ; symbol documented in
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
222 ; help buffer now
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
223 (defvar hyper-apropos-help-history nil) ; chain of symbols followed as links in
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
224 ; help buffer
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
225 (defvar hyper-apropos-face-history nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
226 ;;;(defvar hyper-apropos-variable-history nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
227 ;;;(defvar hyper-apropos-function-history nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
228 (defvar hyper-apropos-regexp-history nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
229 (defvar hyper-apropos-last-regexp nil) ; regex used for last apropos
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
230 (defconst hyper-apropos-apropos-buf "*Hyper Apropos*")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
231 (defconst hyper-apropos-help-buf "*Hyper Help*")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
232
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
233 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
234 (defun hyper-apropos (regexp toggle-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
235 "Display lists of functions and variables matching REGEXP
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
236 in buffer \"*Hyper Apropos*\". If optional prefix arg is given, then the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
237 value of `hyper-apropos-programming-apropos' is toggled for this search.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
238 See also `hyper-apropos-mode'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
239 (interactive (list (read-from-minibuffer "List symbols matching regexp: "
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
240 nil nil nil 'hyper-apropos-regexp-history)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
241 current-prefix-arg))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
242 (or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
243 (setq hyper-apropos-prev-wconfig (current-window-configuration)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
244 (if (string= "" regexp)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
245 (if (get-buffer hyper-apropos-apropos-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
246 (if toggle-apropos
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
247 (hyper-apropos-toggle-programming-flag)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
248 (message "Using last search results"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
249 (error "Be more specific..."))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
250 (set-buffer (get-buffer-create hyper-apropos-apropos-buf))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
251 (setq buffer-read-only nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
252 (erase-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
253 (if toggle-apropos
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
254 (set (make-local-variable 'hyper-apropos-programming-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
255 (not (default-value 'hyper-apropos-programming-apropos))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
256 (let ((flist (apropos-internal regexp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
257 (if hyper-apropos-programming-apropos
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
258 #'fboundp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
259 #'commandp)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
260 (vlist (apropos-internal regexp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
261 (if hyper-apropos-programming-apropos
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
262 #'boundp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
263 #'user-variable-p))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
264 (insert-face (format "Apropos search for: %S\n\n" regexp)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
265 'hyper-apropos-major-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
266 (insert-face "* = command (M-x) or user-variable.\n"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
267 'hyper-apropos-documentation)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
268 (insert-face "\
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
269 a = autoloaded, b = byte-compiled, i = internal, l = lambda, m = macro.\n\n"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
270 'hyper-apropos-documentation)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
271 (insert-face "Functions and Macros:\n\n" 'hyper-apropos-major-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
272 (hyper-apropos-grok-functions flist)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
273 (insert-face "\n\nVariables and Constants:\n\n"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
274 'hyper-apropos-major-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
275 (hyper-apropos-grok-variables vlist)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
276 (goto-char (point-min))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
277 (switch-to-buffer hyper-apropos-apropos-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
278 (hyper-apropos-mode regexp))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
279
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
280 (defun hyper-apropos-toggle-programming-flag ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
281 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
282 (with-current-buffer hyper-apropos-apropos-buf
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
283 (set (make-local-variable 'hyper-apropos-programming-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
284 (not hyper-apropos-programming-apropos)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
285 (message "Re-running apropos...")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
286 (hyper-apropos hyper-apropos-last-regexp nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
287
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
288 (defun hyper-apropos-grok-functions (fns)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
289 (let (bind doc type)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
290 (dolist (fn fns)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
291 (setq bind (symbol-function fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
292 type (cond ((subrp bind) ?i)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
293 ((compiled-function-p bind) ?b)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
294 ((consp bind) (or (cdr
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
295 (assq (car bind) '((autoload . ?a)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
296 (lambda . ?l)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
297 (macro . ?m))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
298 ??))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
299 (t ?\ )))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
300 (insert type (if (commandp fn) "* " " "))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
301 (let ((e (insert-face (format "%S" fn) 'hyper-apropos-hyperlink)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
302 (set-extent-property e 'mouse-face 'highlight))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
303 (insert-char ?\ (let ((l (- 30 (length (format "%S" fn)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
304 (if (natnump l) l 0)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
305 (and hyper-apropos-show-brief-docs
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
306 (setq doc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
307 ;; A symbol's function slot can point to an unbound symbol.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
308 ;; In that case, `documentation' will fail.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
309 (ignore-errors
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
310 (documentation fn)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
311 (if (string-match
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
312 "^([^\n\t )]+[\t ]*\\([^\n)]+\\)?)\\(:[\t ]*\\|\n?\\'\\)"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
313 doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
314 (setq doc (substring doc (match-end 0) (string-match "\n" doc)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
315 t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
316 (insert-face (if doc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
317 (concat " - "
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
318 (substring doc 0 (string-match "\n" doc)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
319 " Not documented.")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
320 'hyper-apropos-documentation))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
321 (insert ?\n))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
322
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
323 (defun hyper-apropos-grok-variables (vars)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
324 (let (doc userp)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
325 (dolist (var vars)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
326 (setq userp (user-variable-p var))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
327 (insert (if userp " * " " "))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
328 (let ((e (insert-face (format "%S" var) 'hyper-apropos-hyperlink)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
329 (set-extent-property e 'mouse-face 'highlight))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
330 (insert-char ?\ (let ((l (- 30 (length (format "%S" var)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
331 (if (natnump l) l 0)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
332 (and hyper-apropos-show-brief-docs
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
333 (setq doc (documentation-property var 'variable-documentation))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
334 (insert-face (if doc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
335 (concat " - " (substring doc (if userp 1 0)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
336 (string-match "\n" doc)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
337 " - Not documented.")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
338 'hyper-apropos-documentation))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
339 (insert ?\n))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
340
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
341 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
342
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
343 (defun hyper-apropos-mode (regexp)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
344 "Improved apropos mode for displaying Emacs documentation. Function and
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
345 variable names are displayed in the buffer \"*Hyper Apropos*\".
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
346
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
347 Functions are preceded by a single character to indicates their types:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
348 a = autoloaded, b = byte-compiled, i = internal, l = lambda, m = macro.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
349 Interactive functions are also preceded by an asterisk.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
350 Variables are preceded by an asterisk if they are user variables.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
351
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
352 General Commands:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
353
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
354 SPC - scroll documentation or apropos window forward
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
355 b - scroll documentation or apropos window backward
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
356 k - eliminate all hits that don't contain keyword
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
357 n - new search
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
358 / - isearch-forward
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
359 q - quit and restore previous window configuration
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
360
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
361 Operations for Symbol on Current Line:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
362
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
363 RET - toggle display of symbol's documentation
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
364 (also on button2 in xemacs)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
365 w - show the keybinding if symbol is a command
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
366 i - invoke function on current line
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
367 s - set value of variable on current line
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
368 t - display the C or lisp source (find-tag)"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
369 (delete-other-windows)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
370 (setq mode-name "Hyper-Apropos"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
371 major-mode 'hyper-apropos-mode
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
372 buffer-read-only t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
373 truncate-lines t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
374 hyper-apropos-last-regexp regexp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
375 modeline-buffer-identification
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
376 (list (cons modeline-buffer-id-left-extent "Hyper Apropos: ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
377 (cons modeline-buffer-id-right-extent (concat "\"" regexp "\""))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
378 (use-local-map hyper-apropos-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
379 (run-hooks 'hyper-apropos-mode-hook))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
380
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
381 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
382
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
383 ;; similar to `describe-key-briefly', copied from prim/help.el by CW
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
384
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
385 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
386 (defun hyper-describe-key (key)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
387 (interactive "kDescribe key: ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
388 (hyper-describe-key-briefly key t))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
389
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
390 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
391 (defun hyper-describe-key-briefly (key &optional show)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
392 (interactive "kDescribe key briefly: \nP")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
393 (let (menup defn interm final msg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
394 (setq defn (key-or-menu-binding key 'menup))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
395 (if (or (null defn) (integerp defn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
396 (or (numberp show) (message "%s is undefined" (key-description key)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
397 (cond ((stringp defn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
398 (setq interm defn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
399 final (key-binding defn)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
400 ((vectorp defn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
401 (setq interm (append defn nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
402 (while (and interm
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
403 (member (key-binding (vector (car interm)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
404 '(universal-argument digit-argument)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
405 (setq interm (cdr interm)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
406 (while (and interm
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
407 (not (setq final (key-binding (vconcat interm)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
408 (setq interm (butlast interm)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
409 (if final
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
410 (setq interm (vconcat interm))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
411 (setq interm defn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
412 final (key-binding defn)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
413 (setq msg (format
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
414 "%s runs %s%s%s"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
415 ;; This used to say 'This menu item' but it could also
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
416 ;; be a scrollbar event. We can't distinguish at the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
417 ;; moment.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
418 (if menup "This item" (key-description key))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
419 ;;(if (symbolp defn) defn (key-description defn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
420 (if (symbolp defn) defn (prin1-to-string defn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
421 (if final (concat ", " (key-description interm) " runs ") "")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
422 (if final
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
423 (if (symbolp final) final (prin1-to-string final))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
424 "")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
425 (if (numberp show)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
426 (or (not (symbolp defn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
427 (memq (symbol-function defn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
428 '(zkey-init-kbd-macro zkey-init-kbd-fn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
429 (progn (princ msg) (princ "\n")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
430 (message "%s" msg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
431 (if final (setq defn final))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
432 (if (and (or (symbolp defn) (symbolp (setq defn (car-safe defn))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
433 defn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
434 show)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
435 (hyper-apropos-get-doc defn t))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
436
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
437 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
438 (defun hyper-describe-face (symbol &optional this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
439 "Describe face..
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
440 See also `hyper-apropos' and `hyper-describe-function'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
441 ;; #### - perhaps a prefix arg should suppress the prompt...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
442 (interactive
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
443 (let (v val)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
444 (setq v (hyper-apropos-this-symbol)) ; symbol under point
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
445 (or (find-face v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
446 (setq v (variable-at-point)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
447 (setq val (let ((enable-recursive-minibuffers t))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
448 (completing-read
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
449 (concat (if (hyper-apropos-follow-ref-buffer current-prefix-arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
450 "Follow face"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
451 "Describe face")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
452 (if v
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
453 (format " (default %s): " v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
454 ": "))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
455 (mapcar (function (lambda (x) (list (symbol-name x))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
456 (face-list))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
457 nil t nil 'hyper-apropos-face-history)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
458 (list (if (string= val "")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
459 (progn (push (symbol-name v) hyper-apropos-face-history) v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
460 (intern-soft val))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
461 current-prefix-arg)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
462 (if (null symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
463 (message "Sorry, nothing to describe.")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
464 (or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
465 (setq hyper-apropos-prev-wconfig (current-window-configuration)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
466 (hyper-apropos-get-doc symbol t nil this-ref-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
467
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
468 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
469 (defun hyper-describe-variable (symbol &optional this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
470 "Hypertext drop-in replacement for `describe-variable'.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
471 See also `hyper-apropos' and `hyper-describe-function'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
472 ;; #### - perhaps a prefix arg should suppress the prompt...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
473 (interactive (list (hyper-apropos-read-variable-symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
474 (if (hyper-apropos-follow-ref-buffer current-prefix-arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
475 "Follow variable"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
476 "Describe variable"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
477 current-prefix-arg))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
478 (if (null symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
479 (message "Sorry, nothing to describe.")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
480 (or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
481 (setq hyper-apropos-prev-wconfig (current-window-configuration)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
482 (hyper-apropos-get-doc symbol t nil this-ref-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
483
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
484 (defun hyper-where-is (symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
485 "Print message listing key sequences that invoke specified command."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
486 (interactive (list (hyper-apropos-read-function-symbol "Where is function")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
487 (if (null symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
488 (message "Sorry, nothing to describe.")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
489 (where-is symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
490
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
491 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
492 (defun hyper-describe-function (symbol &optional this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
493 "Hypertext replacement for `describe-function'. Unlike `describe-function'
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
494 in that the symbol under the cursor is the default if it is a function.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
495 See also `hyper-apropos' and `hyper-describe-variable'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
496 ;; #### - perhaps a prefix arg should suppress the prompt...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
497 (interactive (list (hyper-apropos-read-function-symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
498 (if (hyper-apropos-follow-ref-buffer current-prefix-arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
499 "Follow function"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
500 "Describe function"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
501 current-prefix-arg))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
502 (if (null symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
503 (message "Sorry, nothing to describe.")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
504 (or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
505 (setq hyper-apropos-prev-wconfig (current-window-configuration)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
506 (hyper-apropos-get-doc symbol t nil this-ref-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
507
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
508 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
509 (defun hyper-apropos-read-variable-symbol (prompt &optional predicate)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
510 "Hypertext drop-in replacement for `describe-variable'.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
511 See also `hyper-apropos' and `hyper-describe-function'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
512 ;; #### - perhaps a prefix arg should suppress the prompt...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
513 (or predicate (setq predicate 'boundp))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
514 (let (v val)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
515 (setq v (hyper-apropos-this-symbol)) ; symbol under point
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
516 (or (funcall predicate v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
517 (setq v (variable-at-point)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
518 (or (funcall predicate v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
519 (setq v nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
520 (setq val (let ((enable-recursive-minibuffers t))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
521 (completing-read
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
522 (concat prompt
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
523 (if v
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
524 (format " (default %s): " v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
525 ": "))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
526 obarray predicate t nil 'variable-history)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
527 (if (string= val "")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
528 (progn (push (symbol-name v) variable-history) v)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
529 (intern-soft val))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
530 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
531 (define-obsolete-function-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
532 'hypropos-read-variable-symbol 'hyper-apropos-read-variable-symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
533
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
534 (defun hyper-apropos-read-function-symbol (prompt)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
535 "Read function symbol from minibuffer."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
536 (let ((fn (hyper-apropos-this-symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
537 val)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
538 (or (fboundp fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
539 (setq fn (function-at-point)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
540 (setq val (let ((enable-recursive-minibuffers t))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
541 (completing-read (if fn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
542 (format "%s (default %s): " prompt fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
543 (format "%s: " prompt))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
544 obarray 'fboundp t nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
545 'function-history)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
546 (if (equal val "")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
547 (progn (push (symbol-name fn) function-history) fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
548 (intern-soft val))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
549
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
550 (defun hyper-apropos-last-help (arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
551 "Go back to the last symbol documented in the *Hyper Help* buffer."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
552 (interactive "P")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
553 (let ((win (get-buffer-window hyper-apropos-help-buf)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
554 (or arg (setq arg (if win 1 0)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
555 (cond ((= arg 0))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
556 ((<= (length hyper-apropos-help-history) arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
557 ;; go back as far as we can...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
558 (setcdr (nreverse hyper-apropos-help-history) nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
559 (t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
560 (setq hyper-apropos-help-history
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
561 (nthcdr arg hyper-apropos-help-history))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
562 (if (or win (> arg 0))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
563 (hyper-apropos-get-doc (car hyper-apropos-help-history) t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
564 (display-buffer hyper-apropos-help-buf))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
565
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
566 (defun hyper-apropos-insert-face (string &optional face)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
567 "Insert STRING and fontify some parts with face `hyper-apropos-hyperlink'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
568 (let ((beg (point)) end)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
569 (insert-face string (or face 'hyper-apropos-documentation))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
570 (setq end (point))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
571 (goto-char beg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
572 (while (re-search-forward
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
573 "`\\([-a-zA-Z0-9_][-a-zA-Z0-9_][-a-zA-Z0-9_.]+\\)'"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
574 end 'limit)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
575 (let ((e (make-extent (match-beginning 1) (match-end 1))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
576 (set-extent-face e 'hyper-apropos-hyperlink)
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
577 (set-extent-property e 'mouse-face 'highlight)))
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
578 (goto-char beg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
579 (while (re-search-forward
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
580 "M-x \\([-a-zA-Z0-9_][-a-zA-Z0-9_][-a-zA-Z0-9_.]+\\)"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
581 end 'limit)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
582 (let ((e (make-extent (match-beginning 1) (match-end 1))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
583 (set-extent-face e 'hyper-apropos-hyperlink)
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
584 (set-extent-property e 'mouse-face 'highlight)))))
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
585
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
586 (defun hyper-apropos-insert-keybinding (keys string)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
587 (if keys
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
588 (insert " (" string " bound to \""
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
589 (mapconcat 'key-description
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
590 (sort* keys #'< :key #'length)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
591 "\", \"")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
592 "\")\n")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
593
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
594 (defun hyper-apropos-insert-section-heading (alias-desc &optional desc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
595 (or desc (setq desc alias-desc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
596 alias-desc nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
597 (if alias-desc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
598 (setq desc (concat alias-desc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
599 (if (memq (aref desc 0)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
600 '(?a ?e ?i ?o ?u))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
601 ", an " ", a ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
602 desc)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
603 (aset desc 0 (upcase (aref desc 0))) ; capitalize
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
604 (goto-char (point-max))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
605 (newline 3) (delete-blank-lines) (newline 2)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
606 (hyper-apropos-insert-face desc 'hyper-apropos-section-heading))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
607
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
608 (defun hyper-apropos-insert-value (string symbol val)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
609 (insert-face string 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
610 (insert (if (symbol-value symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
611 (if (or (null val) (eq val t) (integerp val))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
612 (prog1
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
613 (symbol-value symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
614 (set symbol nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
615 "see below")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
616 "is void")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
617
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
618 (defun hyper-apropos-follow-ref-buffer (this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
619 (and (not this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
620 (eq major-mode 'hyper-apropos-help-mode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
621 hyper-apropos-ref-buffer
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
622 (buffer-live-p hyper-apropos-ref-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
623
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
624 (defun hyper-apropos-get-alias (symbol alias-p next-symbol &optional use)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
625 "Return (TERMINAL-SYMBOL . ALIAS-DESC)."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
626 (let (aliases)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
627 (while (funcall alias-p symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
628 (setq aliases (cons (if use (funcall use symbol) symbol) aliases))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
629 (setq symbol (funcall next-symbol symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
630 (cons symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
631 (and aliases
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
632 (concat "an alias for `"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
633 (mapconcat 'symbol-name
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
634 (nreverse aliases)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
635 "',\nwhich is an alias for `")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
636 "'")))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
637
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
638 (defun hyper-apropos-get-doc (&optional symbol force type this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
639 ;; #### - update this docstring
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
640 "Toggle display of documentation for the symbol on the current line."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
641 ;; SYMBOL is the symbol to document. FORCE, if non-nil, means to
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
642 ;; regenerate the documentation even if it already seems to be there. And
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
643 ;; TYPE, if present, forces the generation of only variable documentation
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
644 ;; or only function documentation. Normally, if both are present, then
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
645 ;; both will be generated.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
646 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
647 ;; TYPES TO IMPLEMENT: obsolete face
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
648 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
649 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
650 (or symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
651 (setq symbol (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
652 (or type
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
653 (setq type '(function variable face)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
654 (if (and (eq hyper-apropos-currently-showing symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
655 (get-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
656 (get-buffer-window hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
657 (not force))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
658 ;; we're already displaying this help, so toggle its display.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
659 (delete-windows-on hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
660 ;; OK, we've got to refresh and display it...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
661 (or (eq symbol (car hyper-apropos-help-history))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
662 (setq hyper-apropos-help-history
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
663 (if (eq major-mode 'hyper-apropos-help-mode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
664 ;; if we're following a link in the help buffer, then
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
665 ;; record that in the help history.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
666 (cons symbol hyper-apropos-help-history)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
667 ;; otherwise clear the history because it's a new search.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
668 (list symbol))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
669 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
670 (if (hyper-apropos-follow-ref-buffer this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
671 (set-buffer hyper-apropos-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
672 (setq hyper-apropos-ref-buffer (current-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
673 (let (standard-output
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
674 ok beg
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
675 newsym symtype doc obsolete
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
676 (local mode-name)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
677 global local-str global-str
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
678 font fore back undl
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
679 aliases alias-desc desc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
680 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
681 (set-buffer (get-buffer-create hyper-apropos-help-buf))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
682 ;;(setq standard-output (current-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
683 (setq buffer-read-only nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
684 (erase-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
685 (insert-face (format "`%s'" symbol) 'hyper-apropos-major-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
686 (insert (format " (buffer: %s, mode: %s)\n"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
687 (buffer-name hyper-apropos-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
688 local)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
689 ;; function ----------------------------------------------------------
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
690 (and (memq 'function type)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
691 (fboundp symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
692 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
693 (setq ok t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
694 (setq aliases (hyper-apropos-get-alias (symbol-function symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
695 'symbolp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
696 'symbol-function)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
697 newsym (car aliases)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
698 alias-desc (cdr aliases))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
699 (if (eq 'macro (car-safe newsym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
700 (setq desc "macro"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
701 newsym (cdr newsym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
702 (setq desc "function"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
703 (setq symtype (cond ((subrp newsym) 'subr)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
704 ((compiled-function-p newsym) 'bytecode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
705 ((eq (car-safe newsym) 'autoload) 'autoload)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
706 ((eq (car-safe newsym) 'lambda) 'lambda))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
707 desc (concat (if (commandp symbol) "interactive ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
708 (cdr (assq symtype
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
709 '((subr . "built-in ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
710 (bytecode . "compiled Lisp ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
711 (autoload . "autoloaded Lisp ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
712 (lambda . "Lisp "))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
713 desc
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
714 (case symtype
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 239
diff changeset
715 ((autoload) (format ",\n(autoloaded from \"%s\")"
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
716 (nth 1 newsym)))
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 239
diff changeset
717 ((bytecode) (format ",\n(loaded from \"%s\")"
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
718 (symbol-file symbol)))))
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
719 local (current-local-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
720 global (current-global-map)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
721 obsolete (get symbol 'byte-obsolete-info)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
722 doc (or (documentation symbol) "function not documented"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
723 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
724 (set-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
725 (goto-char (point-max))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
726 (setq standard-output (current-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
727 (hyper-apropos-insert-section-heading alias-desc desc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
728 (insert ":\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
729 (if local
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
730 (hyper-apropos-insert-keybinding
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
731 (where-is-internal symbol (list local) nil nil nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
732 "locally"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
733 (hyper-apropos-insert-keybinding
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
734 (where-is-internal symbol (list global) nil nil nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
735 "globally")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
736 (insert "\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
737 (if obsolete
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
738 (hyper-apropos-insert-face
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
739 (format "%s is an obsolete function; %s\n\n" symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
740 (if (stringp (car obsolete))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
741 (car obsolete)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
742 (format "use `%s' instead." (car obsolete))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
743 'hyper-apropos-warning))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
744 (setq beg (point))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
745 (insert-face "arguments: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
746 (cond ((eq symtype 'lambda)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
747 (princ (or (nth 1 newsym) "()")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
748 ((eq symtype 'bytecode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
749 (princ (or (compiled-function-arglist newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
750 "()")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
751 ((and (eq symtype 'subr)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
752 (string-match
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
753 "[\n\t ]*\narguments: ?\\((.*)\\)\n?\\'"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
754 doc))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
755 (insert (substring doc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
756 (match-beginning 1)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
757 (match-end 1)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
758 (setq doc (substring doc 0 (match-beginning 0))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
759 ((and (eq symtype 'subr)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
760 (string-match
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
761 "\
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
762 \[\n\t ]*([^\n\t )]+[\t ]*\\([^\n)]+\\)?)\\(:[\t ]*\\|\n?\\'\\)"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
763 doc))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
764 (insert "("
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
765 (if (match-end 1)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
766 (substring doc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
767 (match-beginning 1)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
768 (match-end 1)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
769 ")")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
770 (setq doc (substring doc (match-end 0))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
771 (t (princ "[not available]")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
772 (insert "\n\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
773 (hyper-apropos-insert-face doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
774 (insert "\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
775 (indent-rigidly beg (point) 2))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
776 ;; variable ----------------------------------------------------------
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
777 (and (memq 'variable type)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
778 (or (boundp symbol) (default-boundp symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
779 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
780 (setq ok t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
781 (setq aliases (hyper-apropos-get-alias symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
782 'variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
783 'variable-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
784 'variable-alias)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
785 newsym (car aliases)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
786 alias-desc (cdr aliases))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
787 (setq symtype (or (local-variable-p newsym (current-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
788 (and (local-variable-p newsym
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
789 (current-buffer) t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
790 'auto-local))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
791 desc (concat (and (get newsym 'custom-type)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
792 "customizable ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
793 (if (user-variable-p newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
794 "user variable"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
795 "variable")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
796 (cond ((eq symtype t) ", buffer-local")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
797 ((eq symtype 'auto-local)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
798 ", local when set")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
799 local (and (boundp newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
800 (symbol-value newsym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
801 local-str (and (boundp newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
802 (prin1-to-string local))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
803 global (and (eq symtype t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
804 (default-boundp newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
805 (default-value newsym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
806 global-str (and (eq symtype t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
807 (default-boundp newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
808 (prin1-to-string global))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
809 obsolete (get symbol 'byte-obsolete-variable)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
810 doc (or (documentation-property symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
811 'variable-documentation)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
812 "variable not documented"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
813 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
814 (set-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
815 (goto-char (point-max))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
816 (setq standard-output (current-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
817 (hyper-apropos-insert-section-heading alias-desc desc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
818 (when (and (user-variable-p newsym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
819 (get newsym 'custom-type))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
820 (let ((e (make-extent (point-at-bol) (point))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
821 (set-extent-property e 'mouse-face 'highlight)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
822 (set-extent-property e 'help-echo
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
823 (format "Customize %s" newsym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
824 (set-extent-property
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
825 e 'hyper-apropos-custom
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
826 `(lambda () (customize-variable (quote ,newsym))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
827 (insert ":\n\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
828 (setq beg (point))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
829 (if obsolete
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
830 (hyper-apropos-insert-face
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
831 (format "%s is an obsolete function; %s\n\n" symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
832 (if (stringp obsolete)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
833 obsolete
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
834 (format "use `%s' instead." obsolete)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
835 'hyper-apropos-warning))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
836 ;; generally, the value of the variable is short and the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
837 ;; documentation of the variable long, so it's desirable
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
838 ;; to see all of the value and the start of the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
839 ;; documentation. Some variables, though, have huge and
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
840 ;; nearly meaningless values that force you to page
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
841 ;; forward just to find the doc string. That is
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
842 ;; undesirable.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
843 (if (and (or (null local-str) (< (length local-str) 69))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
844 (or (null global-str) (< (length global-str) 69)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
845 ; 80 cols. docstrings assume this.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
846 (progn (insert-face "value: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
847 (insert (or local-str "is void"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
848 (if (eq symtype t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
849 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
850 (insert "\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
851 (insert-face "default value: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
852 (insert (or global-str "is void"))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
853 (insert "\n\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
854 (hyper-apropos-insert-face doc))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
855 (hyper-apropos-insert-value "value: " 'local-str local)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
856 (if (eq symtype t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
857 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
858 (insert ", ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
859 (hyper-apropos-insert-value "default-value: "
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
860 'global-str global)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
861 (insert "\n\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
862 (hyper-apropos-insert-face doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
863 (if local-str
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
864 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
865 (newline 3) (delete-blank-lines) (newline 1)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
866 (insert-face "value: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
867 (if hyper-apropos-prettyprint-long-values
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
868 (condition-case nil
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
869 (cl-prettyprint local)
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
870 (error (insert local-str)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
871 (insert local-str))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
872 (if global-str
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
873 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
874 (newline 3) (delete-blank-lines) (newline 1)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
875 (insert-face "default value: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
876 (if hyper-apropos-prettyprint-long-values
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
877 (condition-case nil
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
878 (cl-prettyprint global)
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
879 (error (insert global-str)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
880 (insert global-str)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
881 (indent-rigidly beg (point) 2))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
882 ;; face --------------------------------------------------------------
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
883 (and (memq 'face type)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
884 (find-face symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
885 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
886 (setq ok t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
887 (copy-face symbol 'hyper-apropos-temp-face 'global)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
888 (mapcar (function
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
889 (lambda (property)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
890 (setq symtype (face-property-instance symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
891 property))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
892 (if symtype
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
893 (set-face-property 'hyper-apropos-temp-face
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
894 property
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
895 symtype))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
896 built-in-face-specifiers)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
897 (setq font (cons (face-property-instance symbol 'font nil 0 t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
898 (face-property-instance symbol 'font))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
899 fore (cons (face-foreground-instance symbol nil 0 t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
900 (face-foreground-instance symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
901 back (cons (face-background-instance symbol nil 0 t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
902 (face-background-instance symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
903 undl (cons (face-underline-p symbol nil 0 t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
904 (face-underline-p symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
905 doc (face-doc-string symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
906 ;; #### - add some code here
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
907 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
908 (set-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
909 (setq standard-output (current-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
910 (hyper-apropos-insert-section-heading
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
911 (concat "Face"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
912 (when (get symbol 'face-defface-spec)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
913 (let* ((str " (customizable)")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
914 (e (make-extent 1 (length str) str)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
915 (set-extent-property e 'mouse-face 'highlight)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
916 (set-extent-property e 'help-echo
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
917 (format "Customize %s" symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
918 (set-extent-property e 'unique t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
919 (set-extent-property e 'duplicable t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
920 (set-extent-property
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
921 e 'hyper-apropos-custom
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
922 `(lambda () (customize-face (quote ,symbol))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
923 str))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
924 ":\n\n "))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
925 (insert-face "\
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
926 ABCDEFHIJKLMNOPQRSTUVWXYZ abcdefhijklmnopqrstuvwxyz 0123456789"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
927 'hyper-apropos-temp-face)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
928 (newline 2)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
929 (insert-face " Font: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
930 (insert (format (if (numberp (car font)) "(%s)\n" "%s\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
931 (and (cdr font)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
932 (font-instance-name (cdr font)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
933 (insert-face " Foreground: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
934 (insert (format (if (numberp (car fore)) "(%s)\n" "%s\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
935 (and (cdr fore)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
936 (color-instance-name (cdr fore)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
937 (insert-face " Background: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
938 (insert (format (if (numberp (car back)) "(%s)\n" "%s\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
939 (and (cdr back)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
940 (color-instance-name (cdr back)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
941 (insert-face " Underline: " 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
942 (insert (format (if (numberp (car undl)) "(%s)\n" "%s\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
943 (cdr undl)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
944 (if doc
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
945 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
946 (newline)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
947 (setq beg (point))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
948 (insert doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
949 (indent-rigidly beg (point) 2))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
950 ;; not bound & property list -----------------------------------------
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
951 (or ok
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
952 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
953 (set-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
954 (hyper-apropos-insert-section-heading
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
955 "symbol is not currently bound\n")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
956 (if (and (setq symtype (symbol-plist symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
957 (or (> (length symtype) 2)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
958 (not (memq 'variable-documentation symtype))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
959 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
960 (set-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
961 (goto-char (point-max))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
962 (setq standard-output (current-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
963 (hyper-apropos-insert-section-heading "property-list:\n\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
964 (while symtype
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
965 (if (memq (car symtype)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
966 '(variable-documentation byte-obsolete-info))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
967 (setq symtype (cdr symtype))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
968 (insert-face (concat " " (symbol-name (car symtype))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
969 ": ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
970 'hyper-apropos-heading)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
971 (setq symtype (cdr symtype))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
972 (indent-to 32)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
973 (insert (prin1-to-string (car symtype)) "\n"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
974 (setq symtype (cdr symtype)))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
975 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
976 (set-buffer hyper-apropos-help-buf)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
977 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
978 ;; pop up window and shrink it if it's wasting space
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
979 (if hyper-apropos-shrink-window
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
980 (shrink-window-if-larger-than-buffer
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
981 (display-buffer (current-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
982 (display-buffer (current-buffer)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
983 (hyper-apropos-help-mode))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
984 (setq hyper-apropos-currently-showing symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
985 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
986 (define-obsolete-function-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
987 'hypropos-get-doc 'hyper-apropos-get-doc)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
988
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
989 ; -----------------------------------------------------------------------------
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
990
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
991 (defun hyper-apropos-help-mode ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
992 "Major mode for hypertext XEmacs help. In this mode, you can quickly
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
993 follow links between back and forth between the documentation strings for
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
994 different variables and functions. Common commands:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
995
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
996 \\{hyper-apropos-help-map}"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
997 (setq buffer-read-only t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
998 major-mode 'hyper-apropos-help-mode
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
999 mode-name "Hyper-Help")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1000 (set-syntax-table emacs-lisp-mode-syntax-table)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1001 (use-local-map hyper-apropos-help-map))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1002
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1003 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1004
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1005 (defun hyper-apropos-scroll-up ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1006 "Scroll up the \"*Hyper Help*\" buffer if it's visible.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1007 Otherwise, scroll the selected window up."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1008 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1009 (let ((win (get-buffer-window hyper-apropos-help-buf))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1010 (owin (selected-window)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1011 (if win
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1012 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1013 (select-window win)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1014 (condition-case nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1015 (scroll-up nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1016 (error (goto-char (point-max))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1017 (select-window owin))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1018 (scroll-up nil))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1019
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1020 (defun hyper-apropos-scroll-down ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1021 "Scroll down the \"*Hyper Help*\" buffer if it's visible.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1022 Otherwise, scroll the selected window down."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1023 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1024 (let ((win (get-buffer-window hyper-apropos-help-buf))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1025 (owin (selected-window)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1026 (if win
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1027 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1028 (select-window win)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1029 (condition-case nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1030 (scroll-down nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1031 (error (goto-char (point-max))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1032 (select-window owin))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1033 (scroll-down nil))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1034
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1035 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1036
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1037 (defun hyper-apropos-mouse-get-doc (event)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1038 "Get the documentation for the symbol the mouse is on."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1039 (interactive "e")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1040 (mouse-set-point event)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1041 (let ((e (extent-at (point) nil 'hyper-apropos-custom)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1042 (if e
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1043 (funcall (extent-property e 'hyper-apropos-custom))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1044 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1045 (let ((symbol (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1046 (if symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1047 (hyper-apropos-get-doc symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1048 (error "Click on a symbol")))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1049
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1050 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1051
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1052 (defun hyper-apropos-add-keyword (pattern)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1053 "Use additional keyword to narrow regexp match.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1054 Deletes lines which don't match PATTERN."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1055 (interactive "sAdditional Keyword: ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1056 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1057 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1058 (let (buffer-read-only)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1059 (keep-lines (concat pattern "\\|" hyper-apropos-junk-regexp))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1060 )))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1061
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1062 (defun hyper-apropos-eliminate-keyword (pattern)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1063 "Use additional keyword to eliminate uninteresting matches.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1064 Deletes lines which match PATTERN."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1065 (interactive "sKeyword to eliminate: ")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1066 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1067 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1068 (let (buffer-read-only)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1069 (flush-lines pattern))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1070 ))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1071
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1072 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1073
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1074 (defun hyper-apropos-this-symbol ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1075 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1076 (cond ((eq major-mode 'hyper-apropos-mode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1077 (beginning-of-line)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1078 (if (looking-at hyper-apropos-junk-regexp)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1079 nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1080 (forward-char 3)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1081 (read (point-marker))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1082 (t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1083 (let* ((st (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1084 (skip-syntax-backward "w_")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1085 ;; !@(*$^%%# stupid backquote implementation!!!
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1086 (skip-chars-forward "`")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1087 (point)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1088 (en (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1089 (skip-syntax-forward "w_")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1090 (skip-chars-backward ".':") ; : for Local Variables
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1091 (point))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1092 (and (not (eq st en))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1093 (intern-soft (buffer-substring st en))))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1094
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1095 (defun hyper-apropos-where-is (symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1096 "Find keybinding for symbol on current line."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1097 (interactive (list (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1098 (where-is symbol))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1099
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1100 (defun hyper-apropos-invoke-fn (fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1101 "Interactively invoke the function on the current line."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1102 (interactive (list (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1103 (cond ((not (fboundp fn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1104 (error "%S is not a function" fn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1105 (t (call-interactively fn))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1106
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1107 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1108 (defun hyper-set-variable (var val &optional this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1109 (interactive
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1110 (let ((var (hyper-apropos-read-variable-symbol
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1111 (if (hyper-apropos-follow-ref-buffer current-prefix-arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1112 "In ref buffer, set user option"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1113 "Set user option")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1114 'user-variable-p)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1115 (list var (hyper-apropos-read-variable-value var) current-prefix-arg)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1116 (hyper-apropos-set-variable var val this-ref-buffer))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1117
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1118 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1119 (defun hyper-apropos-set-variable (var val &optional this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1120 "Interactively set the variable on the current line."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1121 (interactive
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1122 (let ((var (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1123 (or (and var (boundp var))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1124 (and (setq var (and (eq major-mode 'hyper-apropos-help-mode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1125 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1126 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1127 (hyper-apropos-this-symbol))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1128 (boundp var))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1129 (setq var nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1130 (list var (hyper-apropos-read-variable-value var))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1131 (and var
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1132 (boundp var)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1133 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1134 (if (hyper-apropos-follow-ref-buffer this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1135 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1136 (set-buffer hyper-apropos-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1137 (set var val))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1138 (set var val))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1139 (hyper-apropos-get-doc var t '(variable) this-ref-buffer))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1140 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1141 (define-obsolete-function-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1142 'hypropos-set-variable 'hyper-apropos-set-variable)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1143
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1144 (defun hyper-apropos-read-variable-value (var &optional this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1145 (and var
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1146 (boundp var)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1147 (let ((prop (get var 'variable-interactive))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1148 (print-readably t)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1149 val str)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1150 (hyper-apropos-get-doc var t '(variable) current-prefix-arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1151 (if prop
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1152 (call-interactively (list 'lambda '(arg)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1153 (list 'interactive prop)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1154 'arg))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1155 (setq val (if (hyper-apropos-follow-ref-buffer this-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1156 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1157 (set-buffer hyper-apropos-ref-buffer)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1158 (symbol-value var))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1159 (symbol-value var))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1160 str (prin1-to-string val))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1161 (eval-minibuffer
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1162 (format "Set %s `%s' to value (evaluated): "
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1163 (if (user-variable-p var) "user option" "Variable")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1164 var)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1165 (condition-case nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1166 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1167 (read str)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1168 (format (if (or (consp val)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1169 (and (symbolp val)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1170 (not (memq val '(t nil)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1171 "'%s" "%s")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1172 str))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1173 (error nil)))))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1174
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1175 (defun hyper-apropos-customize-variable ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1176 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1177 (let ((var (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1178 (customize-variable var)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1179
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1180 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1181
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1182 (defun hyper-apropos-find-tag (&optional tag-name)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1183 "Find the tag for the symbol on the current line in other window. In
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1184 order for this to work properly, the variable `tag-table-alist' or
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1185 `tags-file-name' must be set so that a TAGS file with tags for the emacs
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1186 source is found for the \"*Hyper Apropos*\" buffer."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1187 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1188 ;; there ought to be a default tags file for this...
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1189 (or tag-name (setq tag-name (symbol-name (hyper-apropos-this-symbol))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1190 (find-tag-other-window (list tag-name)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1191
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1192 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1193
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1194 (defun hyper-apropos-find-function (fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1195 "Find the function for the symbol on the current line in other
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1196 window. (See also `find-function'.)"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1197 (interactive
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1198 (let ((fn (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1199 (or (fboundp fn)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1200 (and (setq fn (and (eq major-mode 'hyper-apropos-help-mode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1201 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1202 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1203 (hyper-apropos-this-symbol))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1204 (fboundp fn))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1205 (setq fn nil))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1206 (list fn)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1207 (if fn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1208 (find-function-other-window fn)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1209
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1210 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1211
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1212 (defun hyper-apropos-disassemble (sym)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1213 "Disassemble FUN if it is byte-coded. If it's a lambda, prettyprint it."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1214 (interactive (list (hyper-apropos-this-symbol)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1215 (let ((fun sym) (trail nil) macrop)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1216 (while (and (symbolp fun) (not (memq fun trail)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1217 (setq trail (cons fun trail)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1218 fun (symbol-function fun)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1219 (and (symbolp fun)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1220 (error "Loop detected in function binding of `%s'" fun))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1221 (setq macrop (and (consp fun)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1222 (eq 'macro (car fun))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1223 (cond ((compiled-function-p (if macrop (cdr fun) fun))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1224 (disassemble fun)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1225 (set-buffer "*Disassemble*")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1226 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1227 (forward-sexp 2)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1228 (insert (format " for function `%S'" sym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1229 )
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1230 ((consp fun)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
1231 (with-current-buffer "*Disassemble*"
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
1232 (cl-prettyprint (if macrop
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
1233 (cons 'defmacro (cons sym (cdr (cdr fun))))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
1234 (cons 'defun (cons sym (cdr fun))))))
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1235 (set-buffer "*Disassemble*")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1236 (emacs-lisp-mode))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1237 ((or (vectorp fun) (stringp fun))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1238 ;; #### - do something fancy here
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1239 (with-output-to-temp-buffer "*Disassemble*"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1240 (princ (format "%s is a keyboard macro:\n\n\t" sym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1241 (prin1 fun)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1242 (t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1243 (error "Sorry, cannot disassemble `%s'" sym)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1244
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1245 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1246
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1247 (defun hyper-apropos-quit ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1248 (interactive)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1249 "Quit Hyper Apropos and restore original window config."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1250 (let ((buf (get-buffer hyper-apropos-apropos-buf)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1251 (and buf (bury-buffer buf)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1252 (set-window-configuration hyper-apropos-prev-wconfig))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1253
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1254 ;; ---------------------------------------------------------------------- ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1255
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1256 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1257 (defun hyper-apropos-popup-menu (event)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1258 (interactive "e")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1259 (mouse-set-point event)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1260 (let* ((sym (or (hyper-apropos-this-symbol)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1261 (and (eq major-mode 'hyper-apropos-help-mode)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1262 (save-excursion
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1263 (goto-char (point-min))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1264 (hyper-apropos-this-symbol)))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1265 (notjunk (not (null sym)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1266 (command-p (if (commandp sym) t))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1267 (variable-p (and sym (boundp sym)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1268 (customizable-p (and variable-p
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1269 (get sym 'custom-type)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1270 t))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1271 (function-p (fboundp sym))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1272 (apropos-p (eq 'hyper-apropos-mode
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1273 (save-excursion (set-buffer (event-buffer event))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1274 major-mode)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1275 (name (if sym (symbol-name sym) ""))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1276 (hyper-apropos-menu
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1277 (delete
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1278 nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1279 (list (concat "Hyper-Help: " name)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1280 (vector "Display documentation" 'hyper-apropos-get-doc notjunk)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1281 (vector "Set variable" 'hyper-apropos-set-variable variable-p)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1282 (vector "Customize variable" 'hyper-apropos-customize-variable
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1283 customizable-p)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1284 (vector "Show keys for" 'hyper-apropos-where-is command-p)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1285 (vector "Invoke command" 'hyper-apropos-invoke-fn command-p)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1286 (vector "Find function" 'hyper-apropos-find-function function-p)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1287 (vector "Find tag" 'hyper-apropos-find-tag notjunk)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1288 (and apropos-p
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1289 ["Add keyword..." hyper-apropos-add-keyword t])
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1290 (and apropos-p
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1291 ["Eliminate keyword..." hyper-apropos-eliminate-keyword t])
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1292 (if apropos-p
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1293 ["Programmers' Apropos" hyper-apropos-toggle-programming-flag
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1294 :style toggle :selected hyper-apropos-programming-apropos]
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1295 ["Programmers' Help" hyper-apropos-toggle-programming-flag
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1296 :style toggle :selected hyper-apropos-programming-apropos])
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1297 (and hyper-apropos-programming-apropos
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1298 (vector "Disassemble function"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1299 'hyper-apropos-disassemble
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1300 function-p))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1301 ["Help" describe-mode t]
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1302 ["Quit" hyper-apropos-quit t]
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1303 ))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1304 (popup-menu hyper-apropos-menu)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1305 ;;;###autoload
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1306 (define-obsolete-function-alias
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1307 'hypropos-popup-menu 'hyper-apropos-popup-menu)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1308
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1309 (provide 'hyper-apropos)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1310
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1311 ;; end of hyper-apropos.el