annotate lisp/prim/help.el @ 208:f427b8ec4379

Added tag r20-4b2 for changeset e45d5e7c476e
author cvs
date Mon, 13 Aug 2007 10:03:54 +0200
parents e45d5e7c476e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; help.el --- help commands for XEmacs.
159
3bb7ccffb0c0 Import from CVS: tag r20-3b6
cvs
parents: 155
diff changeset
2
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Maintainer: FSF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: help, internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
22 ;; Free Software Foundation, 59 Temple Place - Suite 330,
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
23 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Synched up with: FSF 19.30.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; This code implements XEmacs's on-line help system, the one invoked by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;`M-x help-for-help'.
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
31
159
3bb7ccffb0c0 Import from CVS: tag r20-3b6
cvs
parents: 155
diff changeset
32 ;; 06/11/1997 -- Converted to use char-after instead of broken
3bb7ccffb0c0 Import from CVS: tag r20-3b6
cvs
parents: 155
diff changeset
33 ;; following-char. -slb
3bb7ccffb0c0 Import from CVS: tag r20-3b6
cvs
parents: 155
diff changeset
34
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;#### FSFmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; Get the macro make-help-screen when this is compiled,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; or run interpreted, but not when the compiled code is loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;(eval-when-compile (require 'help-macro))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
42 (defgroup help-appearance nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
43 "Appearance of help buffers"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
44 :group 'help)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
45
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (defvar help-map (let ((map (make-sparse-keymap)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (set-keymap-name map 'help-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (set-keymap-prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 map (purecopy (gettext "(Type ? for further options)")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 "Keymap for characters following the Help key.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; global-map definitions moved to keydefs.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (fset 'help-command help-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
56 (define-key help-map (vector help-char) 'help-for-help)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (define-key help-map "?" 'help-for-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (define-key help-map 'help 'help-for-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (define-key help-map "\C-l" 'describe-copying) ; on \C-c in FSFmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (define-key help-map "\C-d" 'describe-distribution)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (define-key help-map "\C-w" 'describe-no-warranty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (define-key help-map "a" 'hyper-apropos) ; 'command-apropos in FSFmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (define-key help-map "A" 'command-apropos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (define-key help-map "b" 'describe-bindings)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
67 (define-key help-map "B" 'describe-beta)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (define-key help-map "\C-p" 'describe-pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
70 (define-key help-map "C" 'customize)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (define-key help-map "c" 'describe-key-briefly)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (define-key help-map "k" 'describe-key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (define-key help-map "d" 'describe-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (define-key help-map "e" 'describe-last-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (define-key help-map "f" 'describe-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (define-key help-map "F" 'xemacs-local-faq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;;; Setup so Hyperbole can be autoloaded from a key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;;; Choose a key on which to place the Hyperbole menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;;; For most people this key binding will work and will be equivalent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ;;; to {C-h h}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (or (where-is-internal 'hyperbole)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (where-is-internal 'hui:menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (define-key help-map "h" 'hyperbole))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (autoload 'hyperbole "hsite" "Hyperbole info manager menus." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (define-key help-map "i" 'info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (define-key help-map '(control i) 'Info-query)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; FSFmacs has Info-goto-emacs-command-node on C-f, no binding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;; for Info-elisp-ref
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (define-key help-map '(control c) 'Info-goto-emacs-command-node)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (define-key help-map '(control k) 'Info-goto-emacs-key-command-node)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (define-key help-map '(control f) 'Info-elisp-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (define-key help-map "l" 'view-lossage)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (define-key help-map "m" 'describe-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (define-key help-map "\C-n" 'view-emacs-news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (define-key help-map "n" 'view-emacs-news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (define-key help-map "p" 'finder-by-keyword)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (autoload 'finder-by-keyword "finder"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 "Find packages matching a given keyword." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (define-key help-map "s" 'describe-syntax)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (define-key help-map "t" 'help-with-tutorial)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (define-key help-map "w" 'where-is)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (define-key help-map "v" 'describe-variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (if (fboundp 'view-last-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (define-key help-map "e" 'view-last-error))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (define-key help-map "q" 'help-quit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;#### This stuff was an attempt to have font locking and hyperlinks in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;help buffer, but it doesn't really work. Some of this stuff comes from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;FSF Emacs; but the FSF Emacs implementation is rather broken, as usual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;What needs to happen is this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ; -- we probably need a "hyperlink mode" from which help-mode is derived.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ; -- this means we probably need multiple inheritance of modes!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ; Thankfully this is not hard to implement; we already have the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ; ability for a keymap to have multiple parents. However, we'd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ; have to define any multiply-inherited-from modes using a standard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ; `define-mode' construction instead of manually doing it, because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ; we don't want each guy calling `kill-all-local-variables' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ; messing up the previous one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ; -- we need to scan the buffer ourselves (not from font-lock, because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ; the user might not have font-lock enabled) and highlight only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ; those words that are *documented* functions and variables (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ; probably excluding words without dashes in them unless enclosed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ; in quotes, so that common words like "list" and "point" don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ; become hyperlinks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ; -- we should *not* use font-lock keywords like below. Instead we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ; should add the font-lock stuff ourselves during the scanning phase,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ; if font-lock is enabled in this buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;(defun help-follow-reference (event extent user-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ; (let ((symbol (intern-soft (extent-string extent))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ; (cond ((and symbol (fboundp symbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ; (describe-function symbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ; ((and symbol (boundp symbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ; (describe-variable symbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ; (t nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;(defvar help-font-lock-keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ; (let ((name-char "[-+a-zA-Z0-9_*]") (sym-char "[-+a-zA-Z0-9_:*]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ; (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ; ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ; ;; The symbol itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ; (list (concat "\\`\\(" name-char "+\\)\\(:\\)?")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ; '(1 (if (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ; 'font-lock-function-name-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ; 'font-lock-variable-name-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ; nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 ; ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ; ;; Words inside `' which tend to be symbol names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ; (list (concat "`\\(" sym-char sym-char "+\\)'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ; 1 '(prog1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ; 'font-lock-reference-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ; (add-list-mode-item (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ; (match-end 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ; nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ; 'help-follow-reference))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ; t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ; ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ; ;; CLisp `:' keywords as references.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ; (list (concat "\\<:" sym-char "+\\>") 0 'font-lock-reference-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ; "Default expressions to highlight in Help mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ;(put 'help-mode 'font-lock-defaults '(help-font-lock-keywords))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (define-derived-mode help-mode view-major-mode "Help"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 "Major mode for viewing help text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 Entry to this mode runs the normal hook `help-mode-hook'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 Commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 \\{help-mode-map}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (define-key help-mode-map "q" 'help-mode-quit)
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
189 (define-key help-mode-map "f" 'find-function-at-point)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
190
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
191 (defun describe-function-at-point ()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
192 "Describe directly the function at point in the other window."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
193 (interactive)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
194 (let ((symb (function-at-point)))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
195 (when symb
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
196 (describe-function symb))))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
197 (defun describe-variable-at-point ()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
198 "Describe directly the variable at point in the other window."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
199 (interactive)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
200 (let ((symb (variable-at-point)))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
201 (when symb
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
202 (describe-variable symb))))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
203 (defun help-next-symbol ()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
204 "Move point to the next quoted symbol."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
205 (interactive)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
206 (search-forward "`" nil t))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
207 (defun help-prev-symbol ()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
208 "Move point to the previous quoted symbol."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
209 (interactive)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
210 (search-backward "'" nil t))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
211 (define-key help-mode-map "d" 'describe-function-at-point)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
212 (define-key help-mode-map "v" 'describe-variable-at-point)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
213 (define-key help-mode-map [tab] 'help-next-symbol)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
214 (define-key help-mode-map [(shift tab)] 'help-prev-symbol)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
215
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (defun help-mode-quit ()
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
218 "Exits from help mode, possibly restoring the previous window configuration.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
219 Bury the help buffer to the end of the buffer list."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (interactive)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
221 (let ((buf (current-buffer)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
222 (cond ((frame-property (selected-frame) 'help-window-config)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
223 (set-window-configuration
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
224 (frame-property (selected-frame) 'help-window-config))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
225 (set-frame-property (selected-frame) 'help-window-config nil))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
226 ((not (one-window-p))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
227 (delete-window)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 159
diff changeset
228 (bury-buffer buf)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (defun help-quit ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 ;; This is a grody hack of the same genotype as `advertised-undo'; if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 ;; bindings of Backspace and C-h are the same, we want the menubar to claim
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ;; that `info' in invoked with `C-h i', not `BS i'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (defun deprecated-help-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (if (eq 'help-command (key-binding "\C-h"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (setq unread-command-event (character-to-event ?\C-h))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (help-for-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;;(define-key global-map 'backspace 'deprecated-help-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
246 ;; This function has been moved to help-nomule.el and mule-help.el.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ;; TUTORIAL arg is XEmacs addition
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
248 ;(defun help-with-tutorial (&optional tutorial)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
249 ; "Select the XEmacs learn-by-doing tutorial.
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
250 ;Optional arg TUTORIAL specifies the tutorial file; default is \"TUTORIAL\"."
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
251 ; (interactive)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
252 ; (if (null tutorial)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
253 ; (setq tutorial "TUTORIAL"))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
254 ; (let ((file (expand-file-name (concat "~/" tutorial))))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
255 ; (delete-other-windows)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
256 ; (if (get-file-buffer file)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
257 ; (switch-to-buffer (get-file-buffer file))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
258 ; (switch-to-buffer (create-file-buffer file))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
259 ; (setq buffer-file-name file)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
260 ; (setq default-directory (expand-file-name "~/"))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
261 ; (setq buffer-auto-save-file-name nil)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
262 ; (insert-file-contents (expand-file-name tutorial data-directory))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
263 ; (goto-char (point-min))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
264 ; (search-forward "\n<<")
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
265 ; (delete-region (point-at-bol) (point-at-eol))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
266 ; (let ((n (- (window-height (selected-window))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
267 ; (count-lines (point-min) (point))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
268 ; 6)))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
269 ; (if (< n 12)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
270 ; (newline n)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
271 ; ;; Some people get confused by the large gap.
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
272 ; (newline (/ n 2))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
273 ; (insert "[Middle of page left blank for didactic purposes. "
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
274 ; "Text continues below]")
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
275 ; (newline (- n (/ n 2)))))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
276 ; (goto-char (point-min))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
277 ; (set-buffer-modified-p nil))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
279 ;; used by describe-key, describe-key-briefly, insert-key-binding, etc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (defun key-or-menu-binding (key &optional menu-flag)
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
282 "Return the command invoked by KEY.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
283 Like `key-binding', but handles menu events and toolbar presses correctly.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
284 KEY is any value returned by `next-command-event'.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
285 MENU-FLAG is a symbol that should be set to T if KEY is a menu event,
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
286 or NIL otherwise"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (let (defn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (and menu-flag (set menu-flag nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;; If the key typed was really a menu selection, grab the form out
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ;; of the event object and intuit the function that would be called,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ;; and describe that instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (if (and (vectorp key) (= 1 (length key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (or (misc-user-event-p (aref key 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (eq (car-safe (aref key 0)) 'menu-selection)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (let ((event (aref key 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (setq defn (if (eventp event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (list (event-function event) (event-object event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (cdr event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (and menu-flag (set menu-flag t))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
300 (when (eq (car defn) 'eval)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
301 (setq defn (car (cdr defn))))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
302 (when (eq (car-safe defn) 'call-interactively)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
303 (setq defn (car (cdr defn))))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
304 (when (and (consp defn) (null (cdr defn)))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
305 (setq defn (car defn))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 ;; else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (setq defn (key-binding key)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 ;; kludge: if a toolbar button was pressed on, try to find the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 ;; binding of the toolbar button.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (if (and (eq defn 'press-toolbar-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (vectorp key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (button-press-event-p (aref key (1- (length key)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ;; wait for the button release. We're on shaky ground here ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (let ((event (next-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (if (and (button-release-event-p event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (event-over-toolbar-p event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (eq 'release-and-activate-toolbar-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (key-binding (vector event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (setq button (event-toolbar-button event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (toolbar-button-callback button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 ;; if anything went wrong, try returning the binding of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 ;; the button-up event, of the original binding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (or (key-or-menu-binding (vector event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 defn)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 ;; no toolbar kludge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 defn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (defun describe-key-briefly (key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 "Print the name of the function KEY invokes. KEY is a string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (interactive "kDescribe key briefly: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (let (defn menup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (setq defn (key-or-menu-binding key 'menup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (if (or (null defn) (integerp defn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (message "%s is undefined" (key-description key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 ;; If it's a keyboard macro which trivially invokes another command,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 ;; document that instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (if (or (stringp defn) (vectorp defn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (setq defn (or (key-binding defn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 defn)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (let ((last-event (and (vectorp key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (aref key (1- (length key))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (message (if (or (button-press-event-p last-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (button-release-event-p last-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (gettext "%s at that spot runs the command %s")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (gettext "%s runs the command %s"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 ;; This used to say 'This menu item' but it could also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 ;; be a scrollbar event. We can't distinguish at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 ;; moment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (if menup "This item" (key-description key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (if (symbolp defn) defn (prin1-to-string defn)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 ;; #### this is a horrible piece of shit function that should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 ;; not exist. In FSF 19.30 this function has gotten three times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 ;; as long and has tons and tons of dumb shit checking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 ;; special-display-buffer-names and such crap. I absolutely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 ;; refuse to insert that Ebolification here. I wanted to delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 ;; this function entirely but Mly bitched.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 ;; If your user-land code calls this function, rewrite it to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;; call with-displaying-help-buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (defun print-help-return-message (&optional function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 "Display or return message saying how to restore windows after help command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 Computes a message and applies the optional argument FUNCTION to it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 If FUNCTION is nil, applies `message' to it, thus printing it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (and (not (get-buffer-window standard-output))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (funcall
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (or function 'message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (substitute-command-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (if (one-window-p t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (if pop-up-windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (gettext "Type \\[delete-other-windows] to remove help window.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (gettext "Type \\[switch-to-buffer] RET to remove help window."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (gettext "Type \\[switch-to-buffer-other-window] RET to restore the other window.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (substitute-command-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (gettext " \\[scroll-other-window] to scroll the help."))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
381 (defcustom help-selects-help-window t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 "*If nil, use the \"old Emacs\" behavior for Help buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 This just displays the buffer in another window, rather than selecting
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
384 the window."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
385 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
386 :group 'help-appearance)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 ;; Use this function for displaying help when C-h something is pressed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 ;; or in similar situations. Do *not* use it when you are displaying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 ;; a help message and then prompting for input in the minibuffer --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 ;; this macro usually selects the help buffer, which is not what you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 ;; want in those situations.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
393
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
394 ;;; ### Should really be a macro (as suggested above) to eliminate the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
395 ;;; requirement of caller to code a lambda form in THUNK -- mrb
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (defun with-displaying-help-buffer (thunk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (let ((winconfig (current-window-configuration))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
398 (was-one-window (one-window-p))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
399 (help-not-visible
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
400 (not (and (windows-of-buffer "*Help*") ;shortcut
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
401 (member (selected-frame)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
402 (mapcar 'window-frame
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
403 (windows-of-buffer "*Help*")))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (prog1 (with-output-to-temp-buffer "*Help*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (prog1 (funcall thunk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (set-buffer standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (help-mode))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (let ((helpwin (get-buffer-window "*Help*")))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
410 (when helpwin
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
411 (with-current-buffer (window-buffer helpwin)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
412 ;; If the *Help* buffer is already displayed on this
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
413 ;; frame, don't override the previous configuration
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
414 (when help-not-visible
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
415 (set-frame-property (selected-frame)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
416 'help-window-config winconfig)))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
417 (when help-selects-help-window
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
418 (select-window helpwin))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
419 (cond ((eq helpwin (selected-window))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
420 (display-message 'command
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
421 (substitute-command-keys "Type \\[help-mode-quit] to remove help window, \\[scroll-up] to scroll the help.")))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
422 (was-one-window
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
423 (display-message 'command
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
424 (substitute-command-keys "Type \\[delete-other-windows] to remove help window, \\[scroll-other-window] to scroll the help.")))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
425 (t
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
426 (display-message 'command
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
427 (substitute-command-keys "Type \\[switch-to-buffer-other-window] to restore the other window, \\[scroll-other-window] to scroll the help.")))))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (defun describe-key (key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 "Display documentation of the function invoked by KEY.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 KEY is a string, or vector of events.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
432 When called interactively, KEY may also be a menu selection."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (interactive "kDescribe key: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (let ((defn (key-or-menu-binding key)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (if (or (null defn) (integerp defn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (message "%s is undefined" (key-description key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (lambda ()
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
439 (princ (key-description key))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
440 (princ " runs ")
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
441 (if (symbolp defn) (princ (format "`%S'" defn))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
442 (prin1 defn))
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
443 (princ "\n\n")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (cond ((or (stringp defn) (vectorp defn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (let ((cmd (key-binding defn)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (if (not cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (princ "a keyboard macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (progn
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
449 (princ "a keyboard macro which runs the command ")
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
450 (prin1 cmd)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
451 (princ ":\n\n")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (if (documentation cmd) (princ (documentation cmd)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 ((and (consp defn) (not (eq 'lambda (car-safe defn))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (let ((describe-function-show-arglist nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (describe-function-1 (car defn) standard-output)))
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
456 ((symbolp defn)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
457 (describe-function-1 defn standard-output))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 ((documentation defn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (princ (documentation defn)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (princ "not documented"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (defun describe-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 "Display documentation of current major mode and minor modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 For this to work correctly for a minor mode, the mode's indicator variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 \(listed in `minor-mode-alist') must also be a function whose documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 describes the minor mode."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;; XEmacs change: print the major-mode documentation before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 ;; the minor modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (princ mode-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (princ " mode:\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (princ (documentation major-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (princ "\n\n----\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (let ((minor-modes minor-mode-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (while minor-modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (let* ((minor-mode (car (car minor-modes)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (indicator (car (cdr (car minor-modes)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 ;; Document a minor mode if it is listed in minor-mode-alist,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 ;; bound locally in this buffer, non-nil, and has a function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 ;; definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (if (and (boundp minor-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (symbol-value minor-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (fboundp minor-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (let ((pretty-minor-mode minor-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (if (string-match "-mode\\'" (symbol-name minor-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (setq pretty-minor-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (capitalize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (substring (symbol-name minor-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 0 (match-beginning 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (while (and (consp indicator) (extentp (car indicator)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (setq indicator (cdr indicator)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (while (and indicator (symbolp indicator))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (setq indicator (symbol-value indicator)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (princ (format "%s minor mode (indicator%s):\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 pretty-minor-mode indicator))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (princ (documentation minor-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (princ "\n\n----\n\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (setq minor-modes (cdr minor-modes)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 ;; So keyboard macro definitions are documented correctly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (fset 'defining-kbd-macro (symbol-function 'start-kbd-macro))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (defun describe-distribution ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 "Display info on how to obtain the latest version of XEmacs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (find-file-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (expand-file-name "DISTRIB" data-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
512 (defun describe-beta ()
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
513 "Display info on how to deal with Beta versions of XEmacs."
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
514 (interactive)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
515 (find-file-read-only
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
516 (expand-file-name "BETA" data-directory))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
517 (goto-char (point-min)))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
518
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (defun describe-copying ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 "Display info on how you may redistribute copies of XEmacs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (find-file-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (expand-file-name "COPYING" data-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (goto-char (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (defun describe-pointer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 "Show a list of all defined mouse buttons, and their definitions."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (describe-bindings nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (defun describe-project ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 "Display info on the GNU project."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (find-file-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (expand-file-name "GNU" data-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (goto-char (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (defun describe-no-warranty ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 "Display info on all the kinds of warranty XEmacs does NOT have."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (describe-copying)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (let (case-fold-search)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (search-forward "NO WARRANTY")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (recenter 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (defun describe-bindings (&optional prefix mouse-only-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 "Show a list of all defined keys, and their definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 The list is put in a buffer, which is displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 If the optional argument PREFIX is supplied, only commands which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 start with that sequence of keys are described.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 If the second argument (prefix arg, interactively) is non-null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 then only the mouse bindings are displayed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (interactive (list nil current-prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (describe-bindings-1 prefix mouse-only-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (defun describe-bindings-1 (&optional prefix mouse-only-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (let ((heading (if mouse-only-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (gettext "button binding\n------ -------\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (gettext "key binding\n--- -------\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (minor minor-mode-map-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (local (current-local-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (shadow '()))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (set-buffer standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (while minor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (let ((sym (car (car minor)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (map (cdr (car minor))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (if (symbol-value-in-buffer sym buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (insert (format "Minor Mode Bindings for `%s':\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 heading)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (describe-bindings-internal map nil shadow prefix mouse-only-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (setq shadow (cons map shadow))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (setq minor (cdr minor))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (if local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (insert "Local Bindings:\n" heading)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (describe-bindings-internal local nil shadow prefix mouse-only-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (setq shadow (cons local shadow))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (insert "Global Bindings:\n" heading)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (describe-bindings-internal (current-global-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 nil shadow prefix mouse-only-p)
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
588 (when (and prefix function-key-map (not mouse-only-p))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
589 (insert "\nFunction key map translations:\n" heading)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
590 (describe-bindings-internal function-key-map nil nil prefix mouse-only-p))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (set-buffer buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (defun describe-prefix-bindings ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 "Describe the bindings of the prefix used to reach this command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 The prefix described consists of all but the last event
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 of the key sequence that ran this command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (let* ((key (this-command-keys))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (prefix (make-vector (1- (length key)) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 i)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (setq i 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (while (< i (length prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (aset prefix i (aref key i))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (setq i (1+ i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (princ "Key bindings starting with ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (princ (key-description prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (princ ":\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (describe-bindings-1 prefix nil)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 ;; Make C-h after a prefix, when not specifically bound,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ;; run describe-prefix-bindings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 (setq prefix-help-command 'describe-prefix-bindings)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (defun view-emacs-news ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 "Display info on recent changes to XEmacs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (interactive)
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
619 #-infodock (require 'outl-mouse)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (find-file (expand-file-name "NEWS" data-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 (defun xemacs-www-page ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 "Go to the XEmacs World Wide Web page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (funcall browse-url-browser-function "http://www.xemacs.org/"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (defun xemacs-www-faq ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 "View the latest and greatest XEmacs FAQ using the World Wide Web."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (funcall browse-url-browser-function "http://www.xemacs.org/faq/index.html"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (defun xemacs-local-faq ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 "View the local copy of the XEmacs FAQ.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 If you have access to the World Wide Web, you should use `xemacs-www-faq'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 instead, to ensure that you get the most up-to-date information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (Info-find-node "xemacs-faq" "Top"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (switch-to-buffer "*info*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
642 (defcustom view-lossage-key-count 100
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
643 "*Number of keys `view-lossage' shows.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
644 The maximum number of available keys is governed by `recent-keys-ring-size'."
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
645 :type 'integer
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
646 :group 'help)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
647
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
648 (defcustom view-lossage-message-count 100
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
649 "*Number of minibuffer messages `view-lossage' shows."
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
650 :type 'integer
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
651 :group 'help)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
652
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (defun view-lossage ()
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
654 "Display recent input keystrokes and recent minibuffer messages.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
655 The number of keys shown is controlled by `view-lossage-key-count'.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
656 The number of messages shown is controlled by `view-lossage-message-count'."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (lambda ()
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
660 (princ (key-description (recent-keys view-lossage-key-count)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (set-buffer standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (insert "Recent keystrokes:\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (while (progn (move-to-column 50) (not (eobp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (search-forward " " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (insert "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 ;; XEmacs addition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (princ "\n\n\nRecent minibuffer messages (most recent first):\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (let ((buffer (get-buffer " *Message-Log*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 oldpoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (set-buffer standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (while (and (> (point buffer) (point-min buffer))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 120
diff changeset
678 (< count view-lossage-message-count))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (setq oldpoint (point buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (forward-line -1 buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 (insert-buffer-substring buffer (point buffer) oldpoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (setq count (1+ count))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (define-function 'help 'help-for-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 ;; #### FSF calls `make-help-screen' here. We need to port `help-macro.el'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (defun help-for-help ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 "You have typed \\[help-for-help], the help character. Type a Help option:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 \(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
690 \\[hyper-apropos] Type a substring; it shows a hypertext list of
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 functions and variables that contain that substring.
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
692 See also the `apropos' command.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
693 \\[command-apropos] Type a substring; it shows a list of commands
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
694 (interactively callable functions) that contain that substring.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
695 \\[describe-bindings] Table of all key bindings.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 \\[describe-key-briefly] Type a command key sequence;
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
697 it displays the function name that sequence runs.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
698 \\[Info-goto-emacs-command-node] Type a function name; it displays the Info node for that command.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
699 \\[describe-function] Type a function name; it shows its documentation.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
700 \\[Info-elisp-ref] Type a function name; it jumps to the full documentation
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 in the XEmacs Lisp Programmer's Manual.
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
702 \\[xemacs-local-faq] Local copy of the XEmacs FAQ.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
703 \\[info] Info documentation reader.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
704 \\[Info-query] Type an Info file name; it displays it in Info reader.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 \\[describe-key] Type a command key sequence;
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
706 it displays the documentation for the command bound to that key.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 \\[Info-goto-emacs-key-command-node] Type a command key sequence;
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
708 it displays the Info node for the command bound to that key.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
709 \\[view-lossage] Recent input keystrokes and minibuffer messages.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
710 \\[describe-mode] Documentation of current major and minor modes.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
711 \\[view-emacs-news] News of recent XEmacs changes.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
712 \\[finder-by-keyword] Type a topic keyword; it finds matching packages.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
713 \\[describe-pointer] Table of all mouse-button bindings.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
714 \\[describe-syntax] Contents of syntax table with explanations.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
715 \\[help-with-tutorial] XEmacs learn-by-doing tutorial.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
716 \\[describe-variable] Type a variable name; it displays its documentation and value.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
717 \\[where-is] Type a command name; it displays which keystrokes invoke that command.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 \\[describe-distribution] XEmacs ordering information.
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
719 \\[describe-no-warranty] Information on absence of warranty for XEmacs.
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 185
diff changeset
720 \\[describe-copying] XEmacs copying permission (General Public License)."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 (let ((help-key (copy-event last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 event char)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 (message (gettext "A B C F I K L M N P S T V W C-c C-d C-n C-w. Type %s again for more help: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 ;; arrgh, no room for "C-i C-k C-f" !!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (single-key-description help-key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (setq event (next-command-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 char (event-to-character event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (if (or (equal event help-key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (eq char ??)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (eq 'help-command (key-binding event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (switch-to-buffer "*Help*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 ;; #### I18N3 should mark buffer as output-translating
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (delete-other-windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (let ((buffer-read-only nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (insert (documentation 'help-for-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (while (or (equal event help-key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (eq char ??)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (eq 'help-command (key-binding event))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
743 (eq char ?\ )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (eq 'scroll-up (key-binding event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (eq char ?\177)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
746 (and (not (eq char ?b))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
747 (eq 'scroll-down (key-binding event))))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
748 (if (or (eq char ?\ )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (eq 'scroll-up (key-binding event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (scroll-up))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (if (or (eq char ?\177)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
752 (and (not (eq char ?b))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
753 (eq 'scroll-down (key-binding event))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (scroll-down))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 ;; write this way for I18N3 snarfing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (if (pos-visible-in-window-p (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (message "A B C F I K L M N P S T V W C-c C-d C-n C-w C-i C-k C-f: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (message "A B C F I K L M N P S T V W C-c C-d C-n C-w C-i C-k C-f or Space to scroll: "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (let ((cursor-in-echo-area t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (setq event (next-command-event event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 char (or (event-to-character event) event))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (let ((defn (or (lookup-key help-map (vector event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (and (numberp char)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (lookup-key help-map (make-string 1 (downcase char)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (message nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (if defn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (call-interactively defn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (ding)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (defun function-called-at-point ()
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
771 "Return the function which is called by the list containing point.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
772 If that gives no function, return the function whose name is around point.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
773 If that doesn't give a function, return nil."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (or (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (narrow-to-region (max (point-min) (- (point) 1000)) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (backward-up-list 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (forward-char 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (let (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (setq obj (read (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (and (symbolp obj) (fboundp obj) obj))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (let ((stab (syntax-table)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (set-syntax-table emacs-lisp-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (or (not (zerop (skip-syntax-backward "_w")))
159
3bb7ccffb0c0 Import from CVS: tag r20-3b6
cvs
parents: 155
diff changeset
790 (eq (char-syntax (char-after (point))) ?w)
3bb7ccffb0c0 Import from CVS: tag r20-3b6
cvs
parents: 155
diff changeset
791 (eq (char-syntax (char-after (point))) ?_)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (forward-sexp -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (skip-chars-forward "`'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (let ((obj (read (current-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (and (symbolp obj) (fboundp obj) obj)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 (set-syntax-table stab)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (error nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
799 (defun function-at-point ()
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
800 "Return the function whose name is around point.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
801 If that gives no function, return the function which is called by the
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
802 list containing point. If that doesn't give a function, return nil.
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
803
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
804 If `function-at-point-function' is non nil, the function it names is
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
805 called instead."
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
806 (if (and (fboundp function-at-point-function)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
807 (not (eq function-at-point-function 'function-at-point)))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
808 (funcall function-at-point-function)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
809 (or (condition-case ()
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
810 (let ((stab (syntax-table)))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
811 (unwind-protect
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
812 (save-excursion
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
813 (set-syntax-table emacs-lisp-mode-syntax-table)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
814 (or (not (zerop (skip-syntax-backward "_w")))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
815 (eq (char-syntax (char-after (point))) ?w)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
816 (eq (char-syntax (char-after (point))) ?_)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
817 (forward-sexp -1))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
818 (skip-chars-forward "`'")
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
819 (let ((obj (read (current-buffer))))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
820 (and (symbolp obj) (fboundp obj) obj)))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
821 (set-syntax-table stab)))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
822 (error nil))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
823 (condition-case ()
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
824 (save-excursion
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
825 (save-restriction
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
826 (narrow-to-region (max (point-min) (- (point) 1000))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
827 (point-max))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
828 (backward-up-list 1)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
829 (forward-char 1)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
830 (let (obj)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
831 (setq obj (read (current-buffer)))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
832 (and (symbolp obj) (fboundp obj) obj))))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
833 (error nil)))))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
834
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
835 ;; Default to nil for the non-hackers? Not until we find a way to
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
836 ;; distinguish hackers from non-hackers automatically!
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
837 (defcustom describe-function-show-arglist t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
838 "*If non-nil, describe-function will show its arglist,
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
839 unless the function is autoloaded."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
840 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
841 :group 'help-appearance)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
843 (defcustom function-at-point-function nil
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
844 "*Set this to name an alternative function to be used by
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
845 `function-at-point' instead of itself.
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
846
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
847 For example `function-called-at-point'."
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
848 :type 'function
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
849 :group 'help)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
850
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 (defun describe-function-find-file (function)
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
852 (let ((files load-history)
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
853 file)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
854 (while files
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
855 (if (memq function (cdr (car files)))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
856 (setq file (car (car files))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
857 files nil))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
858 (setq files (cdr files)))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
859 file))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (defun describe-function (function)
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
862 "Display the full documentation of FUNCTION (a symbol).
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
863 When run interactively, it defaults to any function found by
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
864 `function-at-point'."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (interactive
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
866 (let* ((fn (function-at-point))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (val (let ((enable-recursive-minibuffers t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (if fn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (format (gettext "Describe function (default %s): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 fn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 (gettext "Describe function: "))
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
873 obarray 'fboundp t nil 'function-history))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (list (if (equal val "") fn (intern val)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (describe-function-1 function standard-output)
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
878 ;; Return the text we displayed.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
879 (buffer-string nil nil standard-output))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 (defun function-obsolete-p (function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 "Return non-nil if FUNCTION is obsolete."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (not (null (get function 'byte-obsolete-info))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (defun function-obsoleteness-doc (function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 "If FUNCTION is obsolete, return a string describing this."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 (let ((obsolete (get function 'byte-obsolete-info)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (if obsolete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (format "Obsolete; %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 (if (stringp (car obsolete))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (car obsolete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (format "use `%s' instead." (car obsolete)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
894 (defun function-compatible-p (function)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
895 "Return non-nil if FUNCTION is present for Emacs compatibility."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
896 (not (null (get function 'byte-compatible-info))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
897
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
898 (defun function-compatibility-doc (function)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
899 "If FUNCTION is Emacs compatible, return a string describing this."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
900 (let ((compatible (get function 'byte-compatible-info)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
901 (if compatible
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
902 (format "Emacs Compatible; %s"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
903 (if (stringp (car compatible))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
904 (car compatible)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
905 (format "use `%s' instead." (car compatible)))))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
906
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 ;Here are all the possibilities below spelled out, for the benefit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 ;of the I18N3 snarfer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 ;(gettext "a built-in function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 ;(gettext "an interactive built-in function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 ;(gettext "a built-in macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 ;(gettext "an interactive built-in macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 ;(gettext "a compiled Lisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 ;(gettext "an interactive compiled Lisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 ;(gettext "a compiled Lisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 ;(gettext "an interactive compiled Lisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 ;(gettext "a Lisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 ;(gettext "an interactive Lisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 ;(gettext "a Lisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 ;(gettext "an interactive Lisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 ;(gettext "a mocklisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 ;(gettext "an interactive mocklisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 ;(gettext "a mocklisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 ;(gettext "an interactive mocklisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 ;(gettext "an autoloaded Lisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 ;(gettext "an interactive autoloaded Lisp function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 ;(gettext "an autoloaded Lisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 ;(gettext "an interactive autoloaded Lisp macro")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (defun describe-function-1 (function stream &optional nodoc)
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
932 (princ (format "`%S' is " function) stream)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 (let* ((def function)
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
934 (doc (condition-case nil
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
935 (or (documentation function)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
936 (gettext "not documented"))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
937 (void-function "")))
197
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents: 195
diff changeset
938 aliases file-name autoload-file kbd-macro-p fndef macrop)
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
939 (while (and (symbolp def) (fboundp def))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
940 (when (not (eq def function))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
941 (setq aliases
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
942 (if aliases
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
943 ;; I18N3 Need gettext due to concat
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
944 (concat aliases
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
945 (format
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
946 "\n which is an alias for `%s', "
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
947 (symbol-name def)))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
948 (format "an alias for `%s', " (symbol-name def)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 (setq def (symbol-function def)))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
950 (if (compiled-function-p def)
197
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents: 195
diff changeset
951 (setq file-name (compiled-function-annotation def)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 (if (eq 'macro (car-safe def))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 (setq fndef (cdr def)
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
954 file-name (and (compiled-function-p (cdr def))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
955 (compiled-function-annotation (cdr def)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 macrop t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (setq fndef def))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (if aliases (princ aliases stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 (let ((int #'(lambda (string an-p macro-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 (princ (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (gettext (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (cond ((commandp def)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 "an interactive ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (an-p "an ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (t "a "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "%s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (if macro-p " macro" " function")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 stream))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (cond ((or (stringp def) (vectorp def))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (princ "a keyboard macro." stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (setq kbd-macro-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 ((subrp fndef)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (funcall int "built-in" nil macrop))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 ((compiled-function-p fndef)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (funcall int "compiled Lisp" nil macrop))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 ; XEmacs -- we handle aliases above.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 ; ((symbolp fndef)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 ; (princ (format "alias for `%s'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 ; (prin1-to-string def)) stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 ((eq (car-safe fndef) 'lambda)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (funcall int "Lisp" nil macrop))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 ((eq (car-safe fndef) 'mocklisp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 (funcall int "mocklisp" nil macrop))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 ((eq (car-safe def) 'autoload)
197
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents: 195
diff changeset
986 (setq autoload-file (elt def 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (funcall int "autoloaded Lisp" t (elt def 4)))
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
988 ((and (symbolp def) (not (fboundp def)))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
989 (princ "a symbol with a void (unbound) function definition." stream))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 nil)))
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
992 (princ "\n")
197
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents: 195
diff changeset
993 (if autoload-file
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents: 195
diff changeset
994 (princ (format " -- autoloads from \"%s\"\n" autoload-file) stream))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (or file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (setq file-name (describe-function-find-file function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (if file-name
197
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents: 195
diff changeset
998 (princ (format " -- loaded from \"%s\"\n" file-name)) stream)
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
999 ;; (terpri stream)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1000 (if describe-function-show-arglist
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1001 (let ((arglist
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1002 (cond ((compiled-function-p fndef)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1003 (compiled-function-arglist fndef))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1004 ((eq (car-safe fndef) 'lambda)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1005 (nth 1 fndef))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1006 ((and (subrp fndef)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1007 (string-match
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1008 "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'"
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1009 doc))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1010 (prog1
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1011 (substring doc (match-beginning 1) (match-end 1))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1012 (setq doc (substring doc 0 (match-beginning 0)))))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1013 (t t))))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1014 (if (listp arglist)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1015 (progn
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1016 ;; (princ " ")
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1017 (princ (cons function
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1018 (mapcar (lambda (arg)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1019 (if (memq arg '(&optional &rest))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1020 arg
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1021 (intern (upcase (symbol-name arg)))))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1022 arglist)) stream)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1023 (terpri stream)))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1024 (if (stringp arglist)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1025 (princ (format "(%s %s)\n" function arglist) stream))))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1026 (terpri stream)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 (cond (kbd-macro-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (princ "These characters are executed:\n\n\t" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 (princ (key-description def) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (cond ((setq def (key-binding def))
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1031 (princ (format "\n\nwhich executes the command %S.\n\n" def) stream)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 (describe-function-1 def stream))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 (nodoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 ;; tell the user about obsoleteness.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 ;; If the function is obsolete and is aliased, don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 ;; even bother to report the documentation, as a further
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 ;; encouragement to use the new function.
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1039 (let ((obsolete (function-obsoleteness-doc function))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1040 (compatible (function-compatibility-doc function)))
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1041 (when obsolete
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1042 (princ obsolete stream)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1043 (terpri stream)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1044 (terpri stream))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1045 (when compatible
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1046 (princ compatible stream)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1047 (terpri stream)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1048 (terpri stream))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1049 (unless (and obsolete aliases)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1050 (princ doc stream)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1051 (unless (or (equal doc "")
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1052 (eq ?\n (aref doc (1- (length doc)))))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1053 (terpri stream))))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1056 ;;; ## this doesn't seem to be used for anything
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1057 ;; (defun describe-function-arglist (function)
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1058 ;; (interactive (list (or (function-at-point)
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1059 ;; (error "no function call at point"))))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1060 ;; (let ((b nil))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1061 ;; (unwind-protect
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1062 ;; (save-excursion
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1063 ;; (set-buffer (setq b (get-buffer-create " *arglist*")))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1064 ;; (buffer-disable-undo b)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1065 ;; (erase-buffer)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1066 ;; (describe-function-1 function b t)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1067 ;; (goto-char (point-min))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1068 ;; (end-of-line)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1069 ;; (or (eobp) (delete-char 1))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1070 ;; (just-one-space)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1071 ;; (end-of-line)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1072 ;; (message (buffer-substring (point-min) (point))))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1073 ;; (and b (kill-buffer b)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (defun variable-at-point ()
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1077 (ignore-errors
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1078 (let ((stab (syntax-table)))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1079 (unwind-protect
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1080 (save-excursion
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1081 (set-syntax-table emacs-lisp-mode-syntax-table)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1082 (or (not (zerop (skip-syntax-backward "_w")))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1083 (eq (char-syntax (char-after (point))) ?w)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1084 (eq (char-syntax (char-after (point))) ?_)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1085 (forward-sexp -1))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1086 (skip-chars-forward "'")
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1087 (let ((obj (read (current-buffer))))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1088 (and (symbolp obj) (boundp obj) obj)))
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 183
diff changeset
1089 (set-syntax-table stab)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 (defun variable-obsolete-p (variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 "Return non-nil if VARIABLE is obsolete."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (not (null (get variable 'byte-obsolete-variable))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (defun variable-obsoleteness-doc (variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 "If VARIABLE is obsolete, return a string describing this."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (let ((obsolete (get variable 'byte-obsolete-variable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (if obsolete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (format "Obsolete; %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 (if (stringp obsolete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 obsolete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 (format "use `%s' instead." obsolete))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1104 (defun variable-compatible-p (variable)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1105 "Return non-nil if VARIABLE is Emacs compatible."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1106 (not (null (get variable 'byte-compatible-variable))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1107
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1108 (defun variable-compatibility-doc (variable)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1109 "If VARIABLE is Emacs compatible, return a string describing this."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1110 (let ((compatible (get variable 'byte-compatible-variable)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1111 (if compatible
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1112 (format "Emacs Compatible; %s"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1113 (if (stringp compatible)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1114 compatible
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1115 (format "use `%s' instead." compatible))))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1116
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (defun built-in-variable-doc (variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 "Return a string describing whether VARIABLE is built-in."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 (let ((type (built-in-variable-type variable)))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1120 (case type
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1121 (integer "a built-in integer variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1122 (const-integer "a built-in constant integer variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1123 (boolean "a built-in boolean variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1124 (const-boolean "a built-in constant boolean variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1125 (object "a simple built-in variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1126 (const-object "a simple built-in constant variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1127 (const-specifier "a built-in constant specifier variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1128 (current-buffer "a built-in buffer-local variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1129 (const-current-buffer "a built-in constant buffer-local variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1130 (default-buffer "a built-in default buffer-local variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1131 (selected-console "a built-in console-local variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1132 (const-selected-console "a built-in constant console-local variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1133 (default-console "a built-in default console-local variable")
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1134 (t
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1135 (if type "an unknown type of built-in variable?"
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1136 "a variable declared in Lisp")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (defun describe-variable (variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 "Display the full documentation of VARIABLE (a symbol)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (let* ((v (variable-at-point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 (val (let ((enable-recursive-minibuffers t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 (if v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 (format "Describe variable (default %s): " v)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 (gettext "Describe variable: "))
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
1147 obarray 'boundp t nil 'variable-history))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (list (if (equal val "") v (intern val)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (let ((origvar variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 aliases)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 (let ((print-escape-newlines t))
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1154 (princ (format "`%s' is " (symbol-name variable)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 (while (variable-alias variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (let ((newvar (variable-alias variable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 (if aliases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 ;; I18N3 Need gettext due to concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (setq aliases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (concat aliases
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1161 (format "\n which is an alias for `%s',"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (symbol-name newvar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 (setq aliases
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1164 (format "an alias for `%s',"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (symbol-name newvar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 (setq variable newvar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 (if aliases
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1168 (princ (format "%s" aliases)))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1169 (princ (built-in-variable-doc variable))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1170 (princ ".\n\n")
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1171 (princ "Value: ")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (if (not (boundp variable))
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1173 (princ "void")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 (prin1 (symbol-value variable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 (terpri)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (cond ((local-variable-p variable (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (let* ((void (cons nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (def (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 (default-value variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (error void))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 (princ "This value is specific to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 (terpri)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 (if (local-variable-p variable nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 (princ "(Its value is local to each buffer.)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (terpri)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 (if (if (eq def void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (boundp variable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (not (eq (symbol-value variable) def)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 ;; #### I18N3 doesn't localize properly!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 (progn (princ "Its default-value is ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (if (eq def void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (princ "void.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (prin1 def))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (terpri)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 ((local-variable-p variable (current-buffer) t)
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 179
diff changeset
1197 (princ "Setting it would make its value buffer-local.\n"))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (terpri)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (princ "Documentation:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (terpri)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 (let ((doc (documentation-property variable 'variable-documentation))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1202 (obsolete (variable-obsoleteness-doc origvar))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1203 (compatible (variable-compatibility-doc origvar)))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1204 (when obsolete
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1205 (princ obsolete)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1206 (terpri)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1207 (terpri))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1208 (when compatible
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1209 (princ compatible)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1210 (terpri)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1211 (terpri))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 ;; don't bother to print anything if variable is obsolete and aliased.
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
1213 (when (or (not obsolete) (not aliases))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
1214 (if doc
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
1215 ;; note: documentation-property calls substitute-command-keys.
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
1216 (princ doc)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
1217 (princ "not documented as a variable."))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
1218 (terpri)))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1219 ;; Return the text we displayed.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1220 (buffer-string nil nil standard-output)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1222 (defun sorted-key-descriptions (keys &optional separator)
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1223 "Sort and separate the key descriptions for KEYS.
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1224 The sorting is done by length (shortest bindings first), and the bindings
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1225 are separated with SEPARATOR (\", \" by default)."
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1226 (mapconcat 'key-description
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1227 (sort keys #'(lambda (x y)
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1228 (< (length x) (length y))))
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1229 (or separator ", ")))
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1230
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 (defun where-is (definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 "Print message listing key sequences that invoke specified command.
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
1233 Argument is a command definition, usually a symbol with a function definition.
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1234 When run interactively, it defaults to any function found by
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1235 `function-at-point'."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 (interactive
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1237 (let ((fn (function-at-point))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (enable-recursive-minibuffers t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 val)
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1240 (setq val (read-command
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1241 (if fn (format "Where is command (default %s): " fn)
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1242 "Where is command: ")))
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1243 (list (if (equal (symbol-name val) "")
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1244 fn val))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (let ((keys (where-is-internal definition)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 (if keys
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1247 (message "%s is on %s" definition (sorted-key-descriptions keys))
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 165
diff changeset
1248 (message "%s is not on any keys" definition)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1251 ;; `locate-library' moved to "packages.el"
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1252
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 ;; Functions ported from C into Lisp in XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 (defun describe-syntax ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 "Describe the syntax specifications in the syntax table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 The descriptions are inserted in a buffer, which is then displayed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (with-displaying-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 ;; defined in syntax.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (describe-syntax-table (syntax-table) standard-output))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 (defun list-processes ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 "Display a list of all processes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 \(Any processes listed as Exited or Signaled are actually eliminated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 after the listing is made.)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 (with-output-to-temp-buffer "*Process List*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 (set-buffer standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 (buffer-disable-undo standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 (make-local-variable 'truncate-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 (setq truncate-lines t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (let ((stream standard-output))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 ;; 00000000001111111111222222222233333333334444444444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 ;; 01234567890123456789012345678901234567890123456789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 ;; rewritten for I18N3. This one should stay rewritten
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 ;; so that the dashes will line up properly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 (princ "Proc Status Buffer Tty Command\n---- ------ ------ --- -------\n" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 (let ((tail (process-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 (while tail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 (let* ((p (car tail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (pid (process-id p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (s (process-status p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (setq tail (cdr tail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 (princ (format "%-13s" (process-name p)) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 ;(if (and (eq system-type 'vax-vms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 ; (eq s 'signal)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 ; (< (process-exit-status p) NSIG))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 ; (princ (aref sys_errlist (process-exit-status p)) stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (princ s stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 (if (and (eq s 'exit) (/= (process-exit-status p) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 (princ (format " %d" (process-exit-status p)) stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (if (memq s '(signal exit closed))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 ;; Do delete-exited-processes' work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 (delete-process p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 (indent-to 22 1) ;####
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 (let ((b (process-buffer p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (cond ((not b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 (princ "(none)" stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 ((not (buffer-name b))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (princ "(killed)" stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 (princ (buffer-name b) stream))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 (indent-to 37 1) ;####
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 (let ((tn (process-tty-name p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (cond ((not tn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (princ "(none)" stream))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 (princ (format "%s" tn) stream))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (indent-to 49 1) ;####
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (if (not (integerp pid))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (princ "network stream connection " stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 (princ (car pid) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 (princ "@" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (princ (cdr pid) stream))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1319 (let ((cmd (process-command p)))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1320 (while cmd
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1321 (princ (car cmd) stream)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1322 (setq cmd (cdr cmd))
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1323 (if cmd (princ " " stream)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 (terpri stream)))))))
179
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 177
diff changeset
1325
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 197
diff changeset
1326 ;; `find-function' et al moved to "find-func.el"
179
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 177
diff changeset
1327
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 177
diff changeset
1328 ;;; help.el ends here