Mercurial > emacs
changeset 200:74504bd76aaa
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Thu, 28 Feb 1991 21:40:18 +0000 |
parents | b3710ab30435 |
children | dc13943c8be0 |
files | lisp/ehelp.el |
diffstat | 1 files changed, 12 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ehelp.el Thu Feb 28 19:32:54 1991 +0000 +++ b/lisp/ehelp.el Thu Feb 28 21:40:18 1991 +0000 @@ -20,8 +20,7 @@ (provide 'ehelp) (defvar electric-help-map () - "Keymap defining commands available whilst scrolling -through a buffer in electric-help-mode") + "Keymap defining commands available in `electric-help-mode'.") (put 'electric-help-undefined 'suppress-keymap t) (if electric-help-map @@ -45,8 +44,8 @@ (setq electric-help-map map))) (defun electric-help-mode () - "with-electric-help temporarily places its buffer in this mode -\(On exit from with-electric-help, the buffer is put in default-major-mode)" + "`with-electric-help' temporarily places its buffer in this mode. +\(On exit from `with-electric-help', the buffer is put in `default-major-mode'.)" (setq buffer-read-only t) (setq mode-name "Help") (setq major-mode 'help) @@ -57,19 +56,18 @@ ) (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 + "Arguments are THUNK &optional BUFFER NOERASE. BUFFER defaults to \"*Help*\" +THUNK is a function of no arguments which is called to initialize +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" +When the user exits (with `electric-help-exit', or otherwise) the help +buffer's window disappears (i.e., we use `save-window-excursion') +BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit" (setq buffer (get-buffer-create (or buffer "*Help*"))) (let ((one (one-window-p t)) (config (current-window-configuration)) @@ -166,29 +164,13 @@ (throw 'exit t)) (defun electric-help-retain () - "Exit electric-help, retaining the current window/buffer conifiguration. + "Exit `electric-help', retaining the current window/buffer configuration. \(The *Help* buffer will not be selected, but \\[switch-to-buffer-other-window] RET will select it.)" (interactive) (throw 'exit '(retain))) -;(defun electric-help-undefined () -; (interactive) -; (let* ((keys (this-command-keys)) -; (n (length keys))) -; (if (or (= n 1) -; (and (= n 2) -; meta-flag -; (eq (aref keys 0) meta-prefix-char))) -; (setq unread-command-char last-input-char -; current-prefix-arg prefix-arg) -; ;;>>> I don't care. -; ;;>>> The emacs command-loop is too much pure pain to -; ;;>>> duplicate -; )) -; (throw 'exit t)) - (defun electric-help-undefined () (interactive) (error "%s is undefined -- Press %s to exit" @@ -304,7 +286,6 @@ ;(define-key help-map "a" 'electric-command-apropos) - ;;;; ehelp-map @@ -324,4 +305,3 @@ (fset 'ehelp-command map))) ;; Do (define-key global-map "\C-h" 'ehelp-command) if you want to win -