]> code.delx.au - gnu-emacs/blobdiff - lisp/ehelp.el
Fix typo in previous change.
[gnu-emacs] / lisp / ehelp.el
index 69f2fd4e8af65ba989d61f0ae220bc86f1a3de03..1dc181e198e859c068ff325ed0e635580753ebe6 100644 (file)
@@ -1,10 +1,15 @@
+;;; ehelp.el --- bindings for electric-help mode
+
 ;; Copyright (C) 1986 Free Software Foundation, Inc.
 
+;; Maintainer: FSF
+;; Keywords: help, extensions
+
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
+;;; Commentary:
+
+;; This package provides a pre-packaged `Electric Help Mode' for
+;; browsing on-line help screens.  There is one entry point,
+;; `with-electric-help'; All you have to give it is a no-argument
+;; function that generates the actual text of the help into the current
+;; buffer.
+
+;;; Code:
+
 (require 'electric)
 (defvar electric-help-map ()
   "Keymap defining commands available in `electric-help-mode'.")
@@ -24,7 +39,7 @@
 (if electric-help-map
     ()
   (let ((map (make-keymap)))
-    (fillarray map 'electric-help-undefined)
+    (fillarray (car (cdr map)) 'electric-help-undefined)
     (define-key map (char-to-string meta-prefix-char) (copy-keymap map))
     (define-key map (char-to-string help-char) 'electric-help-help)
     (define-key map "?" 'electric-help-help)
@@ -112,8 +127,9 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit"
   (catch 'exit
     (if (pos-visible-in-window-p (point-max))
        (progn (message "<<< Press Space to bury the help buffer >>>")
-              (if (= (setq unread-command-char (read-char)) ?\  )
-                  (progn (setq unread-command-char -1)
+              (if (equal (setq unread-command-events (list (read-event)))
+                         '(?\ ))
+                  (progn (setq unread-command-events nil)
                          (throw 'exit t)))))
     (let (up down both neither
          (standard (and (eq (key-binding " ")
@@ -306,3 +322,4 @@ will select it.)"
 
 (provide 'ehelp) 
 
+;;; ehelp.el ends here