From 7358cdcc862cd238d209f37f3e182bf7dd104cfd Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 6 May 1991 00:56:07 +0000 Subject: [PATCH] Define new major modes READ-ONLY and READ-ONLY-NOARG to support various modes like Dired and Buffer-Menu. --- v7/src/edwin/artdebug.scm | 4 ++-- v7/src/edwin/bufmnu.scm | 4 ++-- v7/src/edwin/info.scm | 4 ++-- v7/src/edwin/modefs.scm | 28 ++++++++++++++++++---------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/v7/src/edwin/artdebug.scm b/v7/src/edwin/artdebug.scm index 440c0b15b..811eb8907 100644 --- a/v7/src/edwin/artdebug.scm +++ b/v7/src/edwin/artdebug.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/artdebug.scm,v 1.4 1991/02/15 18:13:01 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/artdebug.scm,v 1.5 1991/05/06 00:54:58 cph Exp $ ;;; ;;; Copyright (c) 1989-91 Massachusetts Institute of Technology ;;; @@ -236,7 +236,7 @@ Prompts for a value to give the continuation as an argument." () (debugger-command-invocation command/condition-restart)) -(define-major-mode continuation-browser fundamental "Debug" +(define-major-mode continuation-browser read-only "Debug" "You are in the Scheme debugger, where you can do the following: \\[continuation-browser-show-all-frames] shows All bindings of the current environment and its ancestors. diff --git a/v7/src/edwin/bufmnu.scm b/v7/src/edwin/bufmnu.scm index e719548c2..39b6d8e8a 100644 --- a/v7/src/edwin/bufmnu.scm +++ b/v7/src/edwin/bufmnu.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufmnu.scm,v 1.114 1991/05/02 01:12:36 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufmnu.scm,v 1.115 1991/05/06 00:56:07 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology ;;; @@ -112,7 +112,7 @@ Type q immediately to make the buffer menu go away." (set-buffer-point! buffer (line-start (buffer-start buffer) 2)) (set-buffer-read-only! buffer)) -(define-major-mode buffer-menu fundamental "Buffer Menu" +(define-major-mode buffer-menu read-only-noarg "Buffer Menu" "Major mode for editing a list of buffers. Each line describes a buffer in the editor. m -- mark buffer to be displayed. diff --git a/v7/src/edwin/info.scm b/v7/src/edwin/info.scm index 7ab980470..f11d613e0 100644 --- a/v7/src/edwin/info.scm +++ b/v7/src/edwin/info.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/info.scm,v 1.101 1991/04/24 00:37:39 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/info.scm,v 1.102 1991/05/06 00:55:53 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology ;;; @@ -102,7 +102,7 @@ or #F if file has no tag table.") "Mark pointing at end of current Info file's tag table, or #F if file has no tag table.") -(define-major-mode info fundamental "Info" +(define-major-mode info read-only-noarg "Info" "Info mode provides commands for browsing through the Info documentation tree. Documentation in Info is divided into \"nodes\", each of which discusses one topic and contains references to other nodes diff --git a/v7/src/edwin/modefs.scm b/v7/src/edwin/modefs.scm index 2fce9290d..81e7d29a8 100644 --- a/v7/src/edwin/modefs.scm +++ b/v7/src/edwin/modefs.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/modefs.scm,v 1.125 1991/05/02 01:13:52 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/modefs.scm,v 1.126 1991/05/06 00:55:21 cph Exp $ ;;; ;;; Copyright (c) 1985, 1989-91 Massachusetts Institute of Technology ;;; @@ -55,12 +55,7 @@ All normal editing modes are defined relative to this mode." (define-major-mode fundamental #f "Fundamental" "Major mode not specialized for anything in particular. -Most other major modes are defined by comparison to this one." - (event-distributor/invoke! (ref-variable fundamental-mode-hook))) - -(define-variable fundamental-mode-hook - "An event distributor that is invoked when entering Fundamental mode." - (make-event-distributor)) +Most other major modes are defined by comparison to this one.") (define-variable editor-default-mode "The default major mode for new buffers." @@ -78,13 +73,26 @@ This is an alist, the cars of which are pathname types, and the cdrs of which are major modes." (os/file-type-to-major-mode)) -(define-default-key 'fundamental '^r-bad-command) - +(define-default-key 'fundamental 'undefined) (define-key 'fundamental char-set:graphic 'self-insert-command) (define-key 'fundamental char-set:numeric 'auto-digit-argument) (define-key 'fundamental #\- 'auto-negative-argument) - (define-key 'fundamental #\rubout 'delete-backward-char) + +(define-major-mode read-only fundamental "Read-only" + "Major mode for read-only buffers. +Like Fundamental mode, but no self-inserting characters. +Digits and - are bound to prefix argument commands.") + +(define-key 'read-only char-set:graphic 'undefined) +(define-key 'read-only char-set:numeric 'digit-argument) +(define-key 'read-only #\- 'negative-argument) + +(define-major-mode read-only-noarg fundamental "Read-only-noarg" + "Major mode for read-only buffers. +Like Fundamental mode, but no self-inserting characters.") + +(define-key 'read-only char-set:graphic 'undefined) (define-key 'fundamental #\c-% 'replace-string) (define-key 'fundamental #\c-- 'negative-argument) -- 2.25.1