(require (quote electric)) (provide (quote ehelp)) (defvar electric-help-map nil "\ Keymap defining commands available whilst scrolling through a buffer in electric-help-mode") (put (quote electric-help-undefined) (quote suppress-keymap) t) (if electric-help-map nil (let ((map (make-keymap))) (fillarray map (quote electric-help-undefined)) (define-key map (char-to-string meta-prefix-char) (copy-keymap map)) (define-key map (char-to-string help-char) (quote electric-help-help)) (define-key map "?" (quote electric-help-help)) (define-key map " " (quote scroll-up)) (define-key map "" (quote scroll-down)) (define-key map "." (quote beginning-of-buffer)) (define-key map "<" (quote beginning-of-buffer)) (define-key map ">" (quote end-of-buffer)) (define-key map "q" (quote electric-help-exit)) (define-key map "Q" (quote electric-help-exit)) (define-key map "r" (quote electric-help-retain)) (setq electric-help-map map))) (defun electric-help-mode nil "\ with-electric-help temporarily places its buffer in this mode (On exit from with-electric-help, the buffer is put in default-major-mode)" (byte-code "?^?^?^?^E (defun with-electric-help (thunk &optional buffer noerase) "\ Arguments are THUNK &optional BUFFER NOERASE. BUFFER defaults to \"*Help*\" THUNK is a function of no arguments which is called to initialise the contents of BUFFER. BUFFER will be erased before THUNK is called unless NOERASE is non-nil. THUNK will be called with standard-output bound to the buffer specified by BUFFER After THUNK has been called, this function \"electrically\" pops up a window in which BUFFER is displayed and allows the user to scroll through that buffer in electric-help-mode. When the user exits (with electric-help-exit, or otherwise) the help buffer's window disappears (ie we use save-window-excursion) BUFFER is put into default-major-mode (or fundamental-mode) when we exit" (byte-code "E+ I!^DN !O O\"Z% ^ OV.8 !^ON O O\"A#^*N O O\"\"^O U\"b*,\\ (defun electric-help-command-loop nil (byte-code "A?+" [exit (byte-code "Cd!. f f0 fH f^ (defun electric-help-exit nil "\ >>>Doc" (interactive) (byte-code "?AAA\"+" [t nil throw exit] 3)) (defun electric-help-retain nil "\ Exit electric-help, retaining the current window/buffer conifiguration. (The *Help* buffer will not be selected, but \\[switch-to-buffer-other-window] RET will select it.)" (interactive) (byte-code "?AAA\"+" [nil throw exit (retain)] 3)) (defun electric-help-undefined nil (interactive) (byte-code "?AAAAA A#CE!E=f (defun electric-help-help nil (interactive) (byte-code "?AA!A=. (defun electric-helpify (fun) (byte-code "C?. !E ! . !.Z !!.Z !=?+Z !)+" [p b m print-help-return-message buffer-name set-buffer-modified-p] 3)) message "%s..." capitalize symbol-name set-buffer-modified-p ignore call-interactively] 14)) with-electric-help ignore] 4)) (defun electric-describe-key nil (interactive) (byte-code "?AA!+" [nil electric-helpify describe-key] 2)) (defun electric-describe-mode nil (interactive) (byte-code "?AA!+" [nil electric-helpify describe-mode] 2)) (defun electric-view-lossage nil (interactive) (byte-code "?AA!+" [nil electric-helpify view-lossage] 2)) (defun electric-describe-function nil (interactive) (byte-code "?AA!+" [nil electric-helpify describe-function] 2)) (defun electric-describe-variable nil (interactive) (byte-code "?AA!+" [nil electric-helpify describe-variable] 2)) (defun electric-describe-bindings nil (interactive) (byte-code "?AA!+" [nil electric-helpify describe-bindings] 2)) (defun electric-describe-syntax nil (interactive) (byte-code "?AA!+" [nil electric-helpify describe-syntax] 2)) (defun electric-command-apropos nil (interactive) (byte-code "?AA!+" [nil electric-helpify command-apropos] 2)) (defvar ehelp-map nil) (if ehelp-map nil (let ((map (copy-keymap help-map))) (substitute-key-definition (quote describe-key) (quote electric-describe-key) map) (substitute-key-definition (quote describe-mode) (quote electric-describe-mode) map) (substitute-key-definition (quote view-lossage) (quote electric-view-lossage) map) (substitute-key-definition (quote describe-function) (quote electric-describe-function) map) (substitute-key-definition (quote describe-variable) (quote electric-describe-variable) map) (substitute-key-definition (quote describe-bindings) (quote electric-describe-bindings) map) (substitute-key-definition (quote describe-syntax) (quote electric-describe-syntax) map) (setq ehelp-map map) (fset (quote ehelp-command) map))) .