annotate lisp/hyper-apropos.el @ 5882:bbe4146603db

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