comparison lisp/packages/hyper-apropos.el @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 9ad43877534d
children e45d5e7c476e
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
165 (define-key map [return] 'hyper-apropos-get-doc) 165 (define-key map [return] 'hyper-apropos-get-doc)
166 (define-key map "s" 'hyper-apropos-set-variable) 166 (define-key map "s" 'hyper-apropos-set-variable)
167 (define-key map "t" 'hyper-apropos-find-tag) 167 (define-key map "t" 'hyper-apropos-find-tag)
168 (define-key map "l" 'hyper-apropos-last-help) 168 (define-key map "l" 'hyper-apropos-last-help)
169 (define-key map "c" 'hyper-apropos-customize-variable) 169 (define-key map "c" 'hyper-apropos-customize-variable)
170 (define-key map "f" 'hyper-apropos-find-function)
170 (define-key map [button2] 'hyper-apropos-mouse-get-doc) 171 (define-key map [button2] 'hyper-apropos-mouse-get-doc)
171 (define-key map [button3] 'hyper-apropos-popup-menu) 172 (define-key map [button3] 'hyper-apropos-popup-menu)
172 ;; for the totally hardcore... 173 ;; for the totally hardcore...
173 (define-key map "D" 'hyper-apropos-disassemble) 174 (define-key map "D" 'hyper-apropos-disassemble)
174 ;; administrativa 175 ;; administrativa
190 (define-key map [delete] 'hyper-apropos-scroll-down) 191 (define-key map [delete] 'hyper-apropos-scroll-down)
191 (define-key map [backspace] 'hyper-apropos-scroll-down) 192 (define-key map [backspace] 'hyper-apropos-scroll-down)
192 ;; act on the current line... 193 ;; act on the current line...
193 (define-key map "w" 'hyper-apropos-where-is) 194 (define-key map "w" 'hyper-apropos-where-is)
194 (define-key map "i" 'hyper-apropos-invoke-fn) 195 (define-key map "i" 'hyper-apropos-invoke-fn)
195 (define-key map "s" 'hyper-apropos-set-variable) 196 ;; this is already defined in the parent-keymap above, isn't it?
197 ;; (define-key map "s" 'hyper-apropos-set-variable)
196 ;; more administrativa... 198 ;; more administrativa...
197 (define-key map "P" 'hyper-apropos-toggle-programming-flag) 199 (define-key map "P" 'hyper-apropos-toggle-programming-flag)
198 (define-key map "k" 'hyper-apropos-add-keyword) 200 (define-key map "k" 'hyper-apropos-add-keyword)
199 (define-key map "e" 'hyper-apropos-eliminate-keyword) 201 (define-key map "e" 'hyper-apropos-eliminate-keyword)
200 map) 202 map)
1201 (or tag-name (setq tag-name (symbol-name (hyper-apropos-this-symbol)))) 1203 (or tag-name (setq tag-name (symbol-name (hyper-apropos-this-symbol))))
1202 (find-tag-other-window (list tag-name))) 1204 (find-tag-other-window (list tag-name)))
1203 1205
1204 ;; ---------------------------------------------------------------------- ;; 1206 ;; ---------------------------------------------------------------------- ;;
1205 1207
1208 (defun hyper-apropos-find-function (fn)
1209 "Find the function for the symbol on the current line in other
1210 window. (See also `find-function'.)"
1211 (interactive
1212 (let ((fn (hyper-apropos-this-symbol)))
1213 (or (fboundp fn)
1214 (and (setq fn (and (eq major-mode 'hyper-apropos-help-mode)
1215 (save-excursion
1216 (goto-char (point-min))
1217 (hyper-apropos-this-symbol))))
1218 (fboundp fn))
1219 (setq fn nil))
1220 (list fn)))
1221 (if fn
1222 (find-function-other-window fn)))
1223
1224 ;; ---------------------------------------------------------------------- ;;
1225
1206 (defun hyper-apropos-disassemble (sym) 1226 (defun hyper-apropos-disassemble (sym)
1207 "Disassemble FUN if it is byte-coded. If it's a lambda, prettyprint it." 1227 "Disassemble FUN if it is byte-coded. If it's a lambda, prettyprint it."
1208 (interactive (list (hyper-apropos-this-symbol))) 1228 (interactive (list (hyper-apropos-this-symbol)))
1209 (let ((fun sym) (trail nil) macrop) 1229 (let ((fun sym) (trail nil) macrop)
1210 (while (and (symbolp fun) (not (memq fun trail))) 1230 (while (and (symbolp fun) (not (memq fun trail)))
1249 1269
1250 ;;;###autoload 1270 ;;;###autoload
1251 (defun hyper-apropos-popup-menu (event) 1271 (defun hyper-apropos-popup-menu (event)
1252 (interactive "e") 1272 (interactive "e")
1253 (mouse-set-point event) 1273 (mouse-set-point event)
1254 (let* ((sym (hyper-apropos-this-symbol)) 1274 (let* ((sym (or (hyper-apropos-this-symbol)
1275 (and (eq major-mode 'hyper-apropos-help-mode)
1276 (save-excursion
1277 (goto-char (point-min))
1278 (hyper-apropos-this-symbol)))))
1255 (notjunk (not (null sym))) 1279 (notjunk (not (null sym)))
1256 (command-p (if (commandp sym) t)) 1280 (command-p (if (commandp sym) t))
1257 (variable-p (and sym (boundp sym))) 1281 (variable-p (and sym (boundp sym)))
1258 (customizable-p (and variable-p 1282 (customizable-p (and variable-p
1259 (get sym 'custom-type) 1283 (get sym 'custom-type)
1266 (hyper-apropos-menu 1290 (hyper-apropos-menu
1267 (delete 1291 (delete
1268 nil 1292 nil
1269 (list (concat "Hyper-Help: " name) 1293 (list (concat "Hyper-Help: " name)
1270 (vector "Display documentation" 'hyper-apropos-get-doc notjunk) 1294 (vector "Display documentation" 'hyper-apropos-get-doc notjunk)
1271 (vector "Set variable" 'hyper-apropos-set-variable variable-p) 1295 (vector "Set variable" 'hyper-apropos-set-variable variable-p)
1272 (vector "Customize variable" 'hyper-apropos-customize-variable 1296 (vector "Customize variable" 'hyper-apropos-customize-variable
1273 customizable-p) 1297 customizable-p)
1274 (vector "Show keys for" 'hyper-apropos-where-is command-p) 1298 (vector "Show keys for" 'hyper-apropos-where-is command-p)
1275 (vector "Invoke command" 'hyper-apropos-invoke-fn command-p) 1299 (vector "Invoke command" 'hyper-apropos-invoke-fn command-p)
1300 (vector "Find function" 'hyper-apropos-find-function function-p)
1276 (vector "Find tag" 'hyper-apropos-find-tag notjunk) 1301 (vector "Find tag" 'hyper-apropos-find-tag notjunk)
1277 (and apropos-p 1302 (and apropos-p
1278 ["Add keyword..." hyper-apropos-add-keyword t]) 1303 ["Add keyword..." hyper-apropos-add-keyword t])
1279 (and apropos-p 1304 (and apropos-p
1280 ["Eliminate keyword..." hyper-apropos-eliminate-keyword t]) 1305 ["Eliminate keyword..." hyper-apropos-eliminate-keyword t])