Commit d5b9d1d8 authored by Jim Blandy's avatar Jim Blandy
Browse files

*** empty log message ***

parent 052bdd09
......@@ -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 @@ through a buffer in electric-help-mode")
(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 @@ through a buffer in electric-help-mode")
)
(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 @@ BUFFER is put into default-major-mode (or fundamental-mode) when we exit"
(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 @@ will select it.)"
;(define-key help-map "a" 'electric-command-apropos)
;;;; ehelp-map
......@@ -324,4 +305,3 @@ will select it.)"
(fset 'ehelp-command map)))
;; Do (define-key global-map "\C-h" 'ehelp-command) if you want to win
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment