annotate lisp/packages/hyper-apropos.el @ 167:85ec50267440 r20-3b10

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