Define new major modes READ-ONLY and READ-ONLY-NOARG to support
authorChris Hanson <org/chris-hanson/cph>
Mon, 6 May 1991 00:56:07 +0000 (00:56 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 6 May 1991 00:56:07 +0000 (00:56 +0000)
various modes like Dired and Buffer-Menu.

v7/src/edwin/artdebug.scm
v7/src/edwin/bufmnu.scm
v7/src/edwin/info.scm
v7/src/edwin/modefs.scm

index 440c0b15b65987e00a08f29f3dd456c84dbf3312..811eb8907312e07f7d3cfdd38def6913654b028d 100644 (file)
@@ -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.
index e719548c2c611c911be90ba7df40f05543c5e5bf..39b6d8e8ab3bb57cfff2438b0ee315706a54763a 100644 (file)
@@ -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))
 \f
-(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.
index 7ab9804705f0a21d60fac2ddb77450d4a52b3f1d..f11d613e0c914b67331097fc8762f108edf8fb18 100644 (file)
@@ -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.")
 \f
-(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
index 2fce9290dd296fd9768c39e47767804c2cb5203c..81e7d29a8fae67d4d9beb603d9280b0b92105d12 100644 (file)
@@ -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)
 \f
 (define-key 'fundamental #\c-% 'replace-string)
 (define-key 'fundamental #\c-- 'negative-argument)