X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a2535589a9b419920395f37ef658a3c88bf13ecb..b1b2ae81628a5edce8492e5e1004de8f2a15830d:/lisp/emacs-lisp/helper.el diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el index aa7253eab6..9d22735e1d 100644 --- a/lisp/emacs-lisp/helper.el +++ b/lisp/emacs-lisp/helper.el @@ -1,14 +1,16 @@ -;; helper - utility help package for modes which want to provide help -;; without relinquishing control, e.g. `electric' modes. +;;; helper.el --- utility help package supporting help in electric modes ;; Copyright (C) 1985 Free Software Foundation, Inc. -;; Principal author K. Shane Hartman + +;; Author: K. Shane Hartman +;; Maintainer: FSF +;; Keywords: help ;; 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, @@ -17,11 +19,15 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;;; Code: -(provide 'helper) ; hey, here's a helping hand. +;; hey, here's a helping hand. ;; Bind this to a string for in "... Other keys ". ;; Helper-help uses this to construct help string when scrolling. @@ -71,7 +77,7 @@ "Type anything to %s")) blurb) (setq continue (read-char)) - (cond ((and (memq continue '(?\ ?\C-v)) (< state 2)) + (cond ((and (memq continue '(?\s ?\C-v)) (< state 2)) (scroll-up)) ((= continue ?\C-l) (recenter)) @@ -87,13 +93,13 @@ (sit-for 4)) (defun Helper-describe-key-briefly (key) - "Briefly describe binding of KEYS." + "Briefly describe binding of KEY." (interactive "kDescribe key briefly: ") (describe-key-briefly key) (sit-for 4)) (defun Helper-describe-key (key) - "Describe binding of KEYS." + "Describe binding of KEY." (interactive "kDescribe key: ") (save-window-excursion (describe-key key)) (Helper-help-scroller)) @@ -117,10 +123,13 @@ (documentation (documentation major-mode))) (save-excursion (set-buffer (get-buffer-create "*Help*")) + (setq buffer-read-only nil) (erase-buffer) - (insert name " Mode\n" documentation))) + (insert name " Mode\n" documentation) + (help-mode))) (Helper-help-scroller)) +;;;###autoload (defun Helper-describe-bindings () "Describe local key bindings of current mode." (interactive) @@ -128,13 +137,14 @@ (save-window-excursion (describe-bindings)) (Helper-help-scroller)) +;;;###autoload (defun Helper-help () "Provide help for current mode." (interactive) (let ((continue t) c) (while continue (message "Help (Type ? for further options)") - (setq c (char-to-string (downcase (read-char)))) + (setq c (read-key-sequence nil)) (setq c (lookup-key Helper-help-map c)) (cond ((eq c 'Helper-help-options) (Helper-help-options)) @@ -145,3 +155,7 @@ (ding) (setq continue nil)))))) +(provide 'helper) + +;;; arch-tag: a0984577-d3e9-4124-ae0d-c46fe740f6a9 +;;; helper.el ends here