Thread View: gnu.epoch.misc
1 messages
1 total messages
Started by Bikash Sabata
Fri, 12 Jun 1992 15:28
Re: Help Windows in epoch
Author: Bikash Sabata
Date: Fri, 12 Jun 1992 15:28
Date: Fri, 12 Jun 1992 15:28
90 lines
3410 bytes
3410 bytes
Someone requested for code that would create a new help screen instead
of just a window. Here is something I got out of the net sometime ago.
May be it will help.
bikash
---------------------- CUT HERE ----------------------------
;; Help commands for Epoch.
;;
;; These commands cause help to create a new screen each time it is
;; run, rather than merely a new buffer.
;;
;; by david carlton, carlton@linus.mitre.org or carlton@harvard.harvard.edu
(defvar help-return-screen nil) ; used to return to the old screen
(defvar help-screen-mode-hooks nil)
(defvar help-screen-mode-map nil)
(defvar help-screen-cursor-glyph 92) ; question-arrow
(defvar help-screen-dimensions "80x24")
(defvar help-screen-xpos 10)
(defvar help-screen-ypos 100)
(defun check-help-screen-buffer (buffer)
(if (string-equal (buffer-name buffer) "*Help*")
(create-help-screen buffer)
(display-buffer buffer)))
(defun create-help-screen (buffer)
(set-buffer buffer)
; (help-screen-mode)
(let
((help-screen
(create-screen buffer (get-help-screen-alist))))
(setq help-return-screen (current-screen))
(map-screen help-screen)
(select-screen help-screen)
(cursor-to-screen (current-screen))
(help-screen-mode)))
(defun get-help-screen-alist ()
(cons (cons 'geometry (get-help-screen-geometry))
(list (cons 'cursor-glyph help-screen-cursor-glyph))))
(defun get-help-screen-geometry ()
(let ((screen-dims (screen-information)))
(concat help-screen-dimensions
(if (< (car screen-dims) (- (caddr screen-dims) help-screen-xpos))
"-"
"+")
help-screen-xpos
"+"
help-screen-ypos)))
(defun help-screen-mode ()
"Mode for help screen created by Epoch"
(interactive)
(kill-all-local-variables)
(use-local-map help-screen-mode-map)
(setq major-mode 'help-screen-mode)
(setq mode-name "help-screen")
(run-hooks 'help-screen-mode-hooks))
(defun create-help-screen-mode-map (keymap)
(suppress-keymap keymap)
(define-key keymap "q" 'exit-help-screen-mode)
(define-key keymap " " 'scroll-up)
(define-key keymap "\177" 'scroll-down)
keymap)
(defun exit-help-screen-mode ()
"Deletes help screen, leaves help-screen-mode"
(interactive)
(delete-screen)
(select-screen help-return-screen)
(cursor-to-screen help-return-screen))
(defun print-help-return-message (&optional function)
"Prints help-return-message for help-screen"
(and (not (get-buffer-window standard-output))
(funcall (or function 'message)
"Type q to remove help screen."))) ; should be using
; substitute-command-keys
(if (not help-screen-mode-map)
(setq help-screen-mode-map
(create-help-screen-mode-map (make-keymap))))
(setq temp-buffer-show-hook 'check-help-screen-buffer)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads