* Implemented new editor-based debugger, which uses the standard
authorChris Hanson <org/chris-hanson/cph>
Mon, 7 Aug 1989 08:45:16 +0000 (08:45 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 7 Aug 1989 08:45:16 +0000 (08:45 +0000)
debugger to generate its presentations (by means of new hooks in the
runtime system).  The debugger can be invoked manually by the command
`browse-continuation', or automatically by setting one of the
following variables true:

debug-on-evaluation-error error during evaluation
debug-on-editor-error editor error (user error)
debug-on-internal-error editor bug

Normally `debug-on-evaluation-error' is true and the others are false.

* Controlification redone so that controlification of all ASCII
control characters is uniform.  Previously characters such as newline
and page were handled specially.  The net result of this is that
controlification of an ASCII control character has no effect.

* C-x C-c is now bound to a command which exits Scheme and returns to
the unix shell.

* All messages are cleared immediately after reading the first
character of a command key sequence.  This is similar to the action of
GNU Emacs, and prevents non-temporary messages from sticking around
for a long time.

* Dired now handles symbolic links specially, showing the file linked
to in the usual way.

* Bug fix in `clear-message': this procedure now preserves the
command-prompt; previously it was clearing both the message and the
command-prompt.

* Bug fix in "cterm": the `move-cursor!' operation must move the
cursor immediately if an update is not in effect.

* Bug fix in `revert-buffer': can't assume that the buffer being
reverted is current.

* Bug fix: `with-output-to-string' had incorrect indentation method.

* Bug fix: typo in dired sorting routine.

15 files changed:
v7/src/edwin/basic.scm
v7/src/edwin/calias.scm
v7/src/edwin/comred.scm
v7/src/edwin/decls.scm
v7/src/edwin/dired.scm
v7/src/edwin/editor.scm
v7/src/edwin/edwin.ldr
v7/src/edwin/edwin.pkg
v7/src/edwin/evlcom.scm
v7/src/edwin/filcom.scm
v7/src/edwin/input.scm
v7/src/edwin/make.scm
v7/src/edwin/modefs.scm
v7/src/edwin/schmod.scm
v7/src/edwin/unix.scm

index d34e23a0945cad72e09f2ebdedc2be6969051a62..fa0461fec09dac8f3956a8284894467432000178 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/basic.scm,v 1.100 1989/08/04 03:30:48 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/basic.scm,v 1.101 1989/08/07 08:44:14 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -109,16 +109,32 @@ procedure when it fails to find a command."
   (editor-error "Trying to modify read only text."))
 
 (define-variable debug-on-editor-error
-  "If not false, signal Scheme error when an editor error occurs."
+  "True means signal Scheme error when an editor error occurs."
   false)
 
+(define condition-type:editor-error
+  (make-error-type '()
+    (lambda (condition port)
+      (write-string "Editor error: " port)
+      (write-string (message-args->string (condition/irritants condition))
+                   port))))
+
 (define (editor-error . strings)
   (if (ref-variable debug-on-editor-error)
-      (error "editor error" (message-args->string strings))
+      (call-with-current-continuation
+       (lambda (continuation)
+        (debug-scheme-error
+         (make-condition condition-type:editor-error
+                         strings
+                         continuation))
+        (%editor-error)))
       (begin
        (if (not (null? strings)) (apply temporary-message strings))
-       (editor-beep)
-       (abort-current-command))))
+       (%editor-error))))
+
+(define (%editor-error)
+  (editor-beep)
+  (abort-current-command))
 
 (define (editor-failure . strings)
   (cond ((not (null? strings)) (apply temporary-message strings))
@@ -223,6 +239,18 @@ With argument, saves visited file first."
   ()
   (lambda ()
     (editor-abort *the-non-printing-object*)))
+
+(define-command save-buffers-kill-scheme
+  "Offer to save each buffer, then kill Scheme.
+With prefix arg, silently save all file-visiting buffers, then kill."
+  "P"
+  (lambda (no-confirmation?)
+    (save-some-buffers no-confirmation?)
+    (set! edwin-finalization
+         (lambda ()
+           (set! edwin-finalization false)
+           (%exit)))    ((ref-command suspend-edwin))))
+
 (define-command exit-recursive-edit
   "Exit normally from a subsystem of a level of editing."
   ()
index 1447615cbb93d716559f8bc7fc3a26c1f0b8395c..b9ccf66684dfb7d99d554af646f008a7f49ada53 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/calias.scm,v 1.5 1989/04/28 22:48:15 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/calias.scm,v 1.6 1989/08/07 08:44:17 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -74,7 +74,7 @@
          (else char))))
 
 (define (unmap-alias-char char)
-  (if (ascii-controlified? char)
+  (if (and (ascii-controlified? char)     (even? (quotient (char-bits char) 2)))
       (unmap-alias-char
        (make-char (let ((code (char-code char)))
                    (+ code (if (<= #x01 code #x1A) #x60 #x40)))
            (unmap-alias-char (car entry))
            char))))
 
-(define (ascii-controlified? char)
-  (and (even? (quotient (char-bits char) 2))
-       (let ((code (char-code char)))
-        (or (< code #x09)
-            (= code #x0B)
-            (if (< code #x1B)
-                (< #x0D code)
-                (and (< code #x20)
-                     (< #x1B code)))))))
+(define-integrable (ascii-controlified? char)
+  (< (char-code char) #x20))
+
 (define-integrable (char-name char)
   (char->name (unmap-alias-char char)))
\ No newline at end of file
index f6a863e7eb40c7c840dd4fe2f2c38ea14b90b855..788dabb658416350ba2c6cbe01f602c7c4df8837 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comred.scm,v 1.75 1989/08/03 01:31:16 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comred.scm,v 1.76 1989/08/07 08:44:21 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -98,6 +98,7 @@
     (reset-command-state!)
     (let ((char (with-editor-interrupts-disabled keyboard-read-char)))
       (set! *command-char* char)
+      (clear-message)
       (set-command-prompt! (char-name char))
       (let ((window (current-window)))
        (%dispatch-on-command window
   (reset-command-state!)
   (%dispatch-on-command (current-window) command false))
 
-(define-integrable (read-and-dispatch-on-char)  (dispatch-on-char (current-comtabs)
+(define (read-and-dispatch-on-char)
+  (dispatch-on-char (current-comtabs)
                    (with-editor-interrupts-disabled keyboard-read-char)))
 
 (define (dispatch-on-char comtab char)
index 268f7b85a4e6125b3a6d184f57f7840b271ad6cf..3989cd6ea7d49778b91aef94d6411a8e9d30c763 100644 (file)
@@ -48,7 +48,8 @@
      "comman"
      "comred"
      "curren"
-     ;; "debug"     "debuge"
+     "debug"
+     "debuge"
      "dired"     "editor"
      "edtstr"
      "evlcom"
index 4582d0ed045a5e7174924fa54b6bec5dd9e43cbf..0543c1fef5fe54d18c2ce8af6906b73e5e9f7479 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/dired.scm,v 1.103 1989/08/04 03:17:42 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/dired.scm,v 1.104 1989/08/07 08:44:35 cph Rel $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -331,4 +331,4 @@ C-] -- abort Dired; this is like \\[kill-buffer] on this buffer."
                  (map pathname-name-string pathnames)))))))))
 
 (define (read&sort-directory pathname)
-  (or/dired-sort-pathnames (directory-read pathname false)))
\ No newline at end of file
+  (os/dired-sort-pathnames (directory-read pathname false)))
\ No newline at end of file
index 19dc593b9a34eec5ae3df7241cd4b6bcd7ea5bf5..0fae32e5126c5c9be01559a8b8191dc8fef3c3dc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.187 1989/04/28 22:49:21 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.188 1989/08/07 08:44:38 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
 
 (declare (usual-integrations))
 \f
-(define edwin-reset-args
-  '())
-
 (define (edwin)
   (if (not edwin-editor)
       (apply edwin-reset edwin-reset-args))
   (call-with-current-continuation
    (lambda (continuation)
-     (bind-condition-handler
-        '()
-        (lambda (condition)
-          (and (not (condition/internal? condition))
-               (error? condition)
-               (if (ref-variable debug-on-error)
-                   (begin
-                    (with-output-to-temporary-buffer "*Error*"
-                      (lambda ()
-                        (format-error-message (condition/message condition)
-                                              (condition/irritants condition)
-                                              (current-output-port))))
-                    (editor-error "Scheme error"))
-                   (within-continuation continuation
-                     (lambda ()
-                       (signal-error condition))))))
-       (lambda ()
-        (using-screen edwin-screen
-         (lambda ()
-           (with-editor-input-port edwin-input-port
+     (fluid-let ((editor-abort continuation)
+                (*auto-save-keystroke-count* 0))
+       (within-editor edwin-editor
+        (lambda ()
+          (using-screen edwin-screen
             (lambda ()
-              (with-editor-interrupts
-               (lambda ()
-                 (within-editor edwin-editor
-                  (lambda ()
-                    (perform-buffer-initializations! (current-buffer))
-                    (dynamic-wind
-                     (lambda ()
-                       (update-screens! true))
-                     (lambda ()
-                       ;; Should this be in a dynamic wind? -- Jinx
-                       (if edwin-initialization (edwin-initialization))
-                       (let ((message (cmdl-message/null)))
-                         (push-cmdl (lambda (cmdl)
-                                      cmdl     ;ignore
-                                      (top-level-command-reader)
-                                      message)
-                                    false
-                                    message)))
-                     (lambda ()
-                       unspecific))))))))))
-        ;; Should this be here or in a dynamic wind? -- Jinx
-        (if edwin-finalization (edwin-finalization))))))
+              (with-editor-input-port edwin-input-port
+                (lambda ()
+                  (with-editor-interrupts
+                    (lambda ()
+                      (bind-condition-handler '() internal-error-handler
+                        (lambda ()
+                          (perform-buffer-initializations! (current-buffer))
+                          (dynamic-wind
+                           (lambda () (update-screens! true))
+                           (lambda ()
+                             ;; Should this be in a dynamic wind? -- Jinx
+                             (if edwin-initialization (edwin-initialization))
+                             (let ((message (cmdl-message/null)))
+                               (push-cmdl (lambda (cmdl)
+                                            cmdl ;ignore
+                                            (top-level-command-reader)
+                                            message)
+                                          false
+                                          message)))
+                           (lambda () unspecific)))))))))))))))  ;; Should this be here or in a dynamic wind? -- Jinx
+  (if edwin-finalization (edwin-finalization))
   unspecific)
 
-(define-variable debug-on-error
-  "*True means enter debugger if an error is signalled.
-Does not apply to editor errors."
-  false)
+(define edwin-reset-args '())
+(define editor-abort)
 
 ;; Set this before entering the editor to get something done after the
 ;; editor's dynamic environment is initialized, but before the command
@@ -113,21 +92,13 @@ Does not apply to editor errors."
 ;; reset and then reenter the editor.
 (define edwin-finalization false)
 \f
-(define (within-editor editor thunk)
-  (call-with-current-continuation
-   (lambda (continuation)
-     (fluid-let ((editor-continuation continuation)
-                (recursive-edit-continuation false)
-                (recursive-edit-level 0)
-                (current-editor editor)
-                (*auto-save-keystroke-count* 0))
-       (thunk)))))
-
-(define editor-continuation)
-(define recursive-edit-continuation)
-(define recursive-edit-level)
-(define current-editor)
+;;;; Recursive Edit Levels
 
+(define (within-editor editor thunk)
+  (fluid-let ((current-editor editor)
+             (recursive-edit-continuation false)
+             (recursive-edit-level 0))
+    (thunk)))
 (define (enter-recursive-edit)
   (let ((value
         (call-with-current-continuation
@@ -154,11 +125,33 @@ Does not apply to editor errors."
       (recursive-edit-continuation value)
       (editor-error "No recursive edit is in progress")))
 
-(define (editor-abort value)
-  (editor-continuation value))
+(define recursive-edit-continuation)
+(define recursive-edit-level)
+(define current-editor)
+\f
+;;;; Internal Errors
 
-(define *^G-interrupt-continuations*
-  '())
+(define (internal-error-handler condition)
+  (and (not (condition/internal? condition))
+       (error? condition)
+       (if (ref-variable debug-on-internal-error)
+          (begin
+            (debug-scheme-error condition)
+            (message "Scheme error")
+            (%editor-error))
+          (exit-editor-and-signal-error condition))))
+
+(define-variable debug-on-internal-error
+  "True means enter debugger if error is signalled while the editor is running.
+This does not affect editor errors or evaluation errors."
+  false)
+
+(define (exit-editor-and-signal-error condition)
+  (within-continuation editor-abort
+    (lambda ()
+      (signal-error condition))))
+
+;;;; C-g Interrupts
 
 (define (^G-signal)
   (let ((continuations *^G-interrupt-continuations*))
@@ -177,4 +170,7 @@ Does not apply to editor errors."
                 (thunk))))))
       (if (eq? value signal-tag)
          (interceptor)
-         value))))
\ No newline at end of file
+         value))))
+
+(define *^G-interrupt-continuations*
+  '())
\ No newline at end of file
index d316ea36753b26a18aec74066104dda1dee3f0df..26769942e7ff8d4f547d5abbaf19ba3f0ef8b90b 100644 (file)
@@ -1,5 +1,7 @@
 ;;; -*-Scheme-*-
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.ldr,v 1.5 1989/08/07 08:44:42 cph Exp $
 ;;; program to load package contents
+;;; **** This program (unlike most .ldr files) is not generated by a program.
 
 (declare (usual-integrations))
 
@@ -79,6 +81,7 @@
     (load "basic" environment)
     (load "bufcom" environment)
     (load "bufmnu" (->environment '(EDWIN BUFFER-MENU)))
+    (load "debug" (->environment '(EDWIN DEBUGGER)))
     (load "evlcom" environment)
     (load "filcom" environment)
     (load "fill" environment)
index 92d62542af5966ba233327ffe1c8f0bcbb177442..bddd74bdc5de8b2532d715e7f2b3fa194384e45f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.pkg,v 1.6 1989/08/03 01:34:32 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.pkg,v 1.7 1989/08/07 08:44:45 cph Exp $
 
 Copyright (c) 1989 Massachusetts Institute of Technology
 
@@ -534,11 +534,41 @@ MIT in each case. |#
 (define-package (edwin command-summary)
   (files "keymap")
   (parent (edwin)))
-#|
+
 (define-package (edwin debugger)
   (files "debug")
-  (parent (edwin)))
-|#(define-package (edwin dired)
+  (parent (edwin))
+  (export (edwin)
+         debug-scheme-error)
+  (import (runtime debugger)
+         command/earlier-reduction
+         command/earlier-subproblem
+         command/frame
+         command/goto
+         command/later-reduction
+         command/later-subproblem
+         command/move-to-child-environment
+         command/move-to-parent-environment
+         command/print-environment-procedure
+         command/print-expression
+         command/print-reduction
+         command/print-reductions
+         command/return
+         command/show-all-frames
+         command/show-current-frame
+         command/summarize-history
+         dstate/environment-list
+         make-initial-dstate
+         show-error-info)
+  (import (runtime debugger-utilities)
+         hook/debugger-failure
+         hook/debugger-message
+         hook/presentation)
+  (import (runtime rep)
+         hook/prompt-for-confirmation
+         hook/prompt-for-expression))
+
+(define-package (edwin dired)
   (files "dired")
   (parent (edwin))
   (export (edwin)
index 1ab019a125713ef32d31eb0e9788ec1540cd8f50..ec3795378b6c899561a5e6def4f384a3425ddf59 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/evlcom.scm,v 1.14 1989/04/28 22:49:39 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/evlcom.scm,v 1.15 1989/08/07 08:44:48 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -60,6 +60,11 @@ If false, use the default (REP loop) syntax-table."
   "The last expression evaluated in the typein window."
   false)
 
+(define-variable debug-on-evaluation-error
+  "True means enter debugger if error is signalled while evaluating.
+This does not affect editor errors."
+  true)
+
 (define-command eval-definition
   "Evaluate the definition at point.
 Prints the result in the typein window.
@@ -184,15 +189,25 @@ With an argument, prompts for the evaluation environment."
        (lambda (condition)
          (and (not (condition/internal? condition))
               (error? condition)
-              (begin
-               (with-output-to-temporary-buffer "*Error*"
-                 (lambda ()
-                   (format-error-message (condition/message condition)
-                                         (condition/irritants condition)
-                                         (current-output-port))))
-               (editor-error "Error while evaluating expression"))))
+              (if (ref-variable debug-on-evaluation-error)
+                  (debug-scheme-error condition)
+                  (let ((string
+                         (with-output-to-string
+                           (lambda ()
+                             ((condition/reporter condition)
+                              condition
+                              (current-output-port))))))
+                    (if (and (not (string-find-next-char string #\newline))
+                             (< (string-column-length string 18) 80))
+                        (message "Evaluation error: " string)
+                        (begin
+                          (with-output-to-temporary-buffer "*error*" string)
+                          (message "Evaluation error")))))
+              (%editor-error)))
       (lambda ()
-       (with-new-history (lambda () (scode-eval scode environment)))))))
+       (with-new-history
+        (lambda () (extended-scode-eval scode environment)))))))
+
 (define (prompt-for-expression-value prompt default)
   (eval-with-history (prompt-for-expression prompt default)
                     (evaluation-environment false)))
index dfe43511b3aa3411baa58920d84df2d7376aecb8..15709e6c5f068beabc95199a98a7d2545d66fed4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.136 1989/04/28 22:49:44 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.137 1989/08/07 08:44:52 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -333,9 +333,11 @@ Argument means don't offer to use auto-save file."
                                     (pathname->string pathname))))
                 (let ((where (mark-index (buffer-point buffer))))
                   (read-buffer buffer pathname)
-                  (set-current-point!
-                   (mark+ (buffer-start buffer) where 'LIMIT))
-                  (after-find-file buffer false))))))))\f
+                  (set-buffer-point!
+                   buffer
+                   (mark+ (buffer-start buffer) where 'LIMIT)))
+                (after-find-file buffer false)))))))
+\f
 (define-command copy-file
   "Copy a file; the old and new names are read in the typein window.
 If a file with the new name already exists, confirmation is requested first."
index 8349541a1f35497e14c17e9705759ee1fea4f985..9589de43b38796bba13f4d9e1e7335037321e354 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/input.scm,v 1.79 1989/04/28 22:50:22 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/input.scm,v 1.80 1989/08/07 08:44:56 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -56,7 +56,7 @@ State variables:
 a : there is a command prompt
 b : the command prompt is displayed
 c : there is a message
-d : the message should be erased
+d : the message should be erased (also implies it is displayed)
 
 Constraints:
 
@@ -91,8 +91,8 @@ given starting state and transition operation.
 
   012345
 0 082300
-8 08230C
-C *C230C       * is special -- see the code.
+8 08238C
+C *C23CC       * is special -- see the code.
 2 2A2302
 3 3B2300
 A 2AAB8C
@@ -165,11 +165,12 @@ B 3BAB8C
     (set-message! string)))
 
 (define (clear-message)
-  (set! command-prompt-string false)
-  (set! command-prompt-displayed? false)
-  (set! message-string false)
-  (set! message-should-be-erased? false)
-  (clear-message!))
+  (if message-string
+      (begin
+       (set! message-string false)
+       (set! message-should-be-erased? false)
+       (if (not command-prompt-displayed?)
+           (clear-message!)))))
 \f
 (define editor-input-port)
 
@@ -185,26 +186,23 @@ B 3BAB8C
 (define (keyboard-peek-char)
   (if *executing-keyboard-macro?*
       (keyboard-macro-peek-char)
-      (begin
-       (read-char-preface)
-       (remap-alias-char (peek-char editor-input-port)))))
+      (keyboard-read-char-1 peek-char)))
 
 (define (keyboard-read-char)
   (set! keyboard-chars-read (1+ keyboard-chars-read))
   (if *executing-keyboard-macro?*
       (keyboard-macro-read-char)
-      (begin
-       (read-char-preface)
-       (let ((char (remap-alias-char (read-char editor-input-port))))
-         (set! *auto-save-keystroke-count* (1+ *auto-save-keystroke-count*))
-         (ring-push! (current-char-history) char)
-         (if *defining-keyboard-macro?* (keyboard-macro-write-char char))
-         char))))
+      (let ((char (keyboard-read-char-1 read-char)))
+       (set! *auto-save-keystroke-count* (1+ *auto-save-keystroke-count*))
+       (ring-push! (current-char-history) char)
+       (if *defining-keyboard-macro?* (keyboard-macro-write-char char))
+       char)))
 
 (define read-char-timeout/fast 500)
 (define read-char-timeout/slow 2000)
 
-(define-integrable (read-char-preface)
+(define (keyboard-read-char-1 read-char)
+  ;; Perform redisplay if needed.
   (if (not (keyboard-active? 0))
       (begin
        (update-screens! false)
@@ -216,6 +214,7 @@ B 3BAB8C
            (begin
              (do-auto-save)
              (set! *auto-save-keystroke-count* 0)))))
+  ;; Perform the appropriate juggling of the minibuffer message.
   (cond ((within-typein-edit?)
         (if message-string
             (begin
@@ -233,4 +232,5 @@ B 3BAB8C
             (begin
               (set! command-prompt-displayed? true)
               (set-message! command-prompt-string))
-            (clear-message!)))))
\ No newline at end of file
+            (clear-message!))))
+  (remap-alias-char (read-char editor-input-port)))
\ No newline at end of file
index 0fa7a9e1473a713e23b8b0d4e90b6aba68b34edb..6ab88b1527459b41538cbd51a9cb642af84a3efc 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.11 1989/08/03 01:34:55 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.12 1989/08/07 08:44:59 cph Exp $
 
 Copyright (c) 1989 Massachusetts Institute of Technology
 
@@ -37,4 +37,4 @@ MIT in each case. |#
 (declare (usual-integrations))
 
 (package/system-loader "edwin" '() 'QUERY)
-(add-system! (make-system "Edwin" 3 11 '()))
\ No newline at end of file
+(add-system! (make-system "Edwin" 3 12 '()))
\ No newline at end of file
index be1a04d90fd005890faa6477c4eb0967ada38b23..f156284068c806f64db908a85d20875598d178bb 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/modefs.scm,v 1.117 1989/04/28 22:51:27 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/modefs.scm,v 1.118 1989/08/07 08:45:08 cph Exp $
 ;;;
 ;;;    Copyright (c) 1985, 1989 Massachusetts Institute of Technology
 ;;;
@@ -91,31 +91,11 @@ and the cdrs of which are major modes."
 (define-key 'fundamental char-set:numeric 'auto-digit-argument)
 (define-key 'fundamental #\- 'auto-negative-argument)
 
-(define-key 'fundamental #\tab 'indent-for-tab-command)
-(define-key 'fundamental #\linefeed 'newline-and-indent)
-(define-key 'fundamental #\page 'recenter)
-(define-key 'fundamental #\return 'newline)
-(define-key 'fundamental #\altmode 'meta-prefix)
 (define-key 'fundamental #\rubout 'backward-delete-char)
-
-(define-prefix-key 'fundamental #\backspace 'help-prefix)
-(define-key 'fundamental '(#\backspace #\a) 'command-apropos)
-(define-key 'fundamental '(#\backspace #\c) 'describe-key-briefly)
-(define-key 'fundamental '(#\backspace #\d) 'describe-command)
-(define-key 'fundamental '(#\backspace #\i) 'info)
-(define-key 'fundamental '(#\backspace #\k) 'describe-key)
-(define-key 'fundamental '(#\backspace #\l) 'view-lossage)
-(define-key 'fundamental '(#\backspace #\m) 'describe-mode)
-(define-key 'fundamental '(#\backspace #\t) 'help-with-tutorial)
-(define-key 'fundamental '(#\backspace #\v) 'describe-variable)
-(define-key 'fundamental '(#\backspace #\w) 'where-is)
 \f
 (define-key 'fundamental #\c-space 'set-mark-command)
-;!"#$
 (define-key 'fundamental #\c-% 'replace-string)
-;'()*+,
 (define-key 'fundamental #\c-- 'negative-argument)
-;./
 (define-key 'fundamental #\c-0 'digit-argument)
 (define-key 'fundamental #\c-1 'digit-argument)
 (define-key 'fundamental #\c-2 'digit-argument)
@@ -126,12 +106,10 @@ and the cdrs of which are major modes."
 (define-key 'fundamental #\c-7 'digit-argument)
 (define-key 'fundamental #\c-8 'digit-argument)
 (define-key 'fundamental #\c-9 'digit-argument)
-;:
 (define-key 'fundamental #\c-\; 'indent-for-comment)
 (define-key 'fundamental #\c-< 'mark-beginning-of-buffer)
 (define-key 'fundamental #\c-= 'what-cursor-position)
 (define-key 'fundamental #\c-> 'mark-end-of-buffer)
-;?
 (define-key 'fundamental #\c-@ 'set-mark-command)
 (define-key 'fundamental #\c-a 'beginning-of-line)
 (define-key 'fundamental #\c-b 'backward-char)
@@ -140,12 +118,12 @@ and the cdrs of which are major modes."
 (define-key 'fundamental #\c-e 'end-of-line)
 (define-key 'fundamental #\c-f 'forward-char)
 (define-key 'fundamental #\c-g 'keyboard-quit)
-;(define-prefix-key 'fundamental #\c-h 'help-prefix)
-;(define-key 'fundamental #\c-i 'indent-for-tab-command)
-;(define-key 'fundamental #\c-j 'newline-and-indent)
+(define-prefix-key 'fundamental #\c-h 'help-prefix)
+(define-key 'fundamental #\c-i 'indent-for-tab-command)
+(define-key 'fundamental #\c-j 'newline-and-indent)
 (define-key 'fundamental #\c-k 'kill-line)
-;(define-key 'fundamental #\c-l 'recenter)
-;(define-key 'fundamental #\c-m 'newline)
+(define-key 'fundamental #\c-l 'recenter)
+(define-key 'fundamental #\c-m 'newline)
 (define-key 'fundamental #\c-n 'next-line)
 (define-key 'fundamental #\c-o 'open-line)
 (define-key 'fundamental #\c-p 'previous-line)
@@ -159,28 +137,17 @@ and the cdrs of which are major modes."
 (define-prefix-key 'fundamental #\c-x 'prefix-char)
 (define-key 'fundamental #\c-y 'yank)
 (define-key 'fundamental #\c-z 'control-meta-prefix)
-;(define-key 'fundamental #\c-\[ 'meta-prefix)
-;\
+(define-key 'fundamental #\c-\[ 'meta-prefix)
 (define-key 'fundamental #\c-\] 'abort-recursive-edit)
 (define-key 'fundamental #\c-^ 'control-prefix)
 (define-key 'fundamental #\c-_ 'undo)
-;`{|}~
 (define-key 'fundamental #\c-rubout 'backward-delete-char-untabify)
 \f
-(define-key 'fundamental #\m-backspace 'mark-definition)
-;(define-key 'fundamental #\m-tab 'insert-tab)
-(define-key 'fundamental #\m-linefeed 'indent-new-comment-line)
-(define-key 'fundamental #\m-page 'twiddle-buffers)
-;(define-key 'fundamental #\m-return 'back-to-indentation)
-(define-key 'fundamental #\m-altmode 'eval-expression)
 (define-key 'fundamental #\m-space 'just-one-space)
-;!"#$
 (define-key 'fundamental #\m-% 'query-replace)
-;'()*+
 (define-key 'fundamental #\m-, 'tags-loop-continue)
 (define-key 'fundamental #\m-- 'auto-argument)
 (define-key 'fundamental #\m-. 'find-tag)
-;(define-key 'fundamental #\m-/ 'describe-command)
 (define-key 'fundamental #\m-0 'auto-argument)
 (define-key 'fundamental #\m-1 'auto-argument)
 (define-key 'fundamental #\m-2 'auto-argument)
@@ -191,18 +158,15 @@ and the cdrs of which are major modes."
 (define-key 'fundamental #\m-7 'auto-argument)
 (define-key 'fundamental #\m-8 'auto-argument)
 (define-key 'fundamental #\m-9 'auto-argument)
-;:
 (define-key 'fundamental #\m-\; 'indent-for-comment)
 (define-key 'fundamental #\m-< 'beginning-of-buffer)
 (define-key 'fundamental #\m-= 'count-lines-region)
 (define-key 'fundamental #\m-> 'end-of-buffer)
-;?
 (define-key 'fundamental #\m-@ 'mark-word)
 (define-key 'fundamental #\m-\[ 'backward-paragraph)
 (define-key 'fundamental #\m-\\ 'delete-horizontal-space)
 (define-key 'fundamental #\m-\] 'forward-paragraph)
 (define-key 'fundamental #\m-^ 'delete-indentation)
-;_`
 (define-key 'fundamental #\m-a 'backward-sentence)
 (define-key 'fundamental #\m-b 'backward-word)
 (define-key 'fundamental #\m-c 'capitalize-word)
@@ -216,10 +180,8 @@ and the cdrs of which are major modes."
 (define-key 'fundamental #\m-k 'kill-sentence)
 (define-key 'fundamental #\m-l 'downcase-word)
 (define-key 'fundamental #\m-m 'back-to-indentation)
-;nop
 (define-key 'fundamental #\m-q 'fill-paragraph)
 (define-key 'fundamental #\m-r 'move-to-window-line)
-;s
 (define-key 'fundamental #\m-t 'transpose-words)
 (define-key 'fundamental #\m-u 'upcase-word)
 (define-key 'fundamental #\m-v 'scroll-down)
@@ -227,7 +189,6 @@ and the cdrs of which are major modes."
 (define-key 'fundamental #\m-x 'execute-extended-command)
 (define-key 'fundamental #\m-y 'yank-pop)
 (define-key 'fundamental #\m-z 'zap-to-char)
-;{|}
 (define-key 'fundamental #\m-~ 'not-modified)
 (define-key 'fundamental #\m-rubout 'backward-kill-word)
 \f
@@ -243,61 +204,54 @@ and the cdrs of which are major modes."
 (define-key 'fundamental #\c-m-8 'digit-argument)
 (define-key 'fundamental #\c-m-9 'digit-argument)
 (define-key 'fundamental #\c-m-- 'negative-argument)
-
 (define-key 'fundamental #\c-m-\\ 'indent-region)
 (define-key 'fundamental #\c-m-^ 'delete-indentation)
 (define-key 'fundamental #\c-m-\( 'backward-up-list)
 (define-key 'fundamental #\c-m-\) 'up-list)
 (define-key 'fundamental #\c-m-@ 'mark-sexp)
 (define-key 'fundamental #\c-m-\; 'kill-comment)
-
+(define-key 'fundamental #\c-m-\[ 'eval-expression)
 (define-key 'fundamental #\c-m-a 'beginning-of-definition)
 (define-key 'fundamental #\c-m-b 'backward-sexp)
 (define-key 'fundamental #\c-m-c 'exit-recursive-edit)
 (define-key 'fundamental #\c-m-d 'down-list)
 (define-key 'fundamental #\c-m-e 'end-of-definition)
 (define-key 'fundamental #\c-m-f 'forward-sexp)
-;G
 (define-key 'fundamental #\c-m-h 'mark-definition)
-;I
-;(define-key 'fundamental #\c-m-j 'indent-new-comment-line)
+(define-key 'fundamental #\c-m-j 'indent-new-comment-line)
 (define-key 'fundamental #\c-m-k 'kill-sexp)
-;(define-key 'fundamental #\c-m-l 'twiddle-buffers)
-;M
+(define-key 'fundamental #\c-m-l 'twiddle-buffers)
 (define-key 'fundamental #\c-m-n 'forward-list)
 (define-key 'fundamental #\c-m-o 'split-line)
 (define-key 'fundamental #\c-m-p 'backward-list)
-;Q
 (define-key 'fundamental #\c-m-r 'align-definition)
 (define-key 'fundamental #\c-m-s 'isearch-forward-regexp)
 (define-key 'fundamental #\c-m-t 'transpose-sexps)
 (define-key 'fundamental #\c-m-u 'backward-up-list)
 (define-key 'fundamental #\c-m-v 'scroll-other-window)
 (define-key 'fundamental #\c-m-w 'append-next-kill)
-;XYZ
 (define-key 'fundamental #\c-m-rubout 'backward-kill-sexp)
-\f;backspace
-(define-key 'fundamental '(#\c-x #\tab) 'indent-rigidly)
-;linefeed
-(define-key 'fundamental '(#\c-x #\page) 'downcase-region)
-;return
-(define-key 'fundamental '(#\c-x #\altmode) 'repeat-complex-command)
-;A
+\f(define-key 'fundamental '(#\c-h #\a) 'command-apropos)(define-key 'fundamental '(#\c-h #\c) 'describe-key-briefly)
+(define-key 'fundamental '(#\c-h #\d) 'describe-command)(define-key 'fundamental '(#\c-h #\i) 'info)
+(define-key 'fundamental '(#\c-h #\k) 'describe-key)
+(define-key 'fundamental '(#\c-h #\l) 'view-lossage)
+(define-key 'fundamental '(#\c-h #\m) 'describe-mode)
+(define-key 'fundamental '(#\c-h #\t) 'help-with-tutorial)
+(define-key 'fundamental '(#\c-h #\v) 'describe-variable)
+(define-key 'fundamental '(#\c-h #\w) 'where-is)
+
+(define-key 'fundamental '(#\c-x #\c-\[) 'repeat-complex-command)
 (define-key 'fundamental '(#\c-x #\c-b) 'list-buffers)
-;C
+(define-key 'fundamental '(#\c-x #\c-c) 'save-buffers-kill-scheme)
 (define-key 'fundamental '(#\c-x #\c-d) 'list-directory)
 (define-key 'fundamental '(#\c-x #\c-e) 'eval-previous-sexp)
 (define-key 'fundamental '(#\c-x #\c-f) 'find-file)
-;GH
-;(define-key 'fundamental '(#\c-x #\c-i) 'indent-rigidly)
-;JK
-;(define-key 'fundamental '(#\c-x #\c-l) 'downcase-region)
-;M
+(define-key 'fundamental '(#\c-x #\c-i) 'indent-rigidly)
+(define-key 'fundamental '(#\c-x #\c-l) 'downcase-region)
 (define-key 'fundamental '(#\c-x #\c-n) 'set-goal-column)
 (define-key 'fundamental '(#\c-x #\c-o) 'delete-blank-lines)
 (define-key 'fundamental '(#\c-x #\c-p) 'mark-page)
 (define-key 'fundamental '(#\c-x #\c-q) 'toggle-read-only)
-;R
 (define-key 'fundamental '(#\c-x #\c-s) 'save-buffer)
 (define-key 'fundamental '(#\c-x #\c-t) 'transpose-lines)
 (define-key 'fundamental '(#\c-x #\c-u) 'upcase-region)
@@ -305,16 +259,13 @@ and the cdrs of which are major modes."
 (define-key 'fundamental '(#\c-x #\c-w) 'write-file)
 (define-key 'fundamental '(#\c-x #\c-x) 'exchange-point-and-mark)
 (define-key 'fundamental '(#\c-x #\c-z) 'suspend-scheme)
-;!"#$%&'
 (define-key 'fundamental '(#\c-x #\() 'start-kbd-macro)
 (define-key 'fundamental '(#\c-x #\)) 'end-kbd-macro)
-;*+,-
 (define-key 'fundamental '(#\c-x #\.) 'set-fill-prefix)
 (define-key 'fundamental '(#\c-x #\/) 'point-to-register)
 (define-key 'fundamental '(#\c-x #\0) 'delete-window)
 (define-key 'fundamental '(#\c-x #\1) 'delete-other-windows)
 (define-key 'fundamental '(#\c-x #\2) 'split-window-vertically)
-;(define-key 'fundamental '(#\c-x #\3) 'kill-pop-up-buffer)
 (define-prefix-key 'fundamental '(#\c-x #\4) 'prefix-char)
 (define-key 'fundamental '(#\c-x #\4 #\c-f) 'find-file-other-window)
 (define-key 'fundamental '(#\c-x #\4 #\.) 'find-tag-other-window)
@@ -322,19 +273,12 @@ and the cdrs of which are major modes."
 (define-key 'fundamental '(#\c-x #\4 #\d) 'dired-other-window)
 (define-key 'fundamental '(#\c-x #\4 #\f) 'find-file-other-window)
 (define-key 'fundamental '(#\c-x #\5) 'split-window-horizontally)
-;:
 (define-key 'fundamental '(#\c-x #\;) 'set-comment-column)
-;<
 (define-key 'fundamental '(#\c-x #\=) 'what-cursor-position)
-;>?
 (define-key 'fundamental '(#\c-x #\[) 'backward-page)
-;\
 (define-key 'fundamental '(#\c-x #\]) 'forward-page)
 (define-key 'fundamental '(#\c-x #\^) 'enlarge-window)
-;_`
-;a
-(define-key 'fundamental '(#\c-x #\b) 'switch-to-buffer);c
-(define-key 'fundamental '(#\c-x #\d) 'dired)
+(define-key 'fundamental '(#\c-x #\b) 'switch-to-buffer)(define-key 'fundamental '(#\c-x #\d) 'dired)
 (define-key 'fundamental '(#\c-x #\e) 'call-last-kbd-macro)
 (define-key 'fundamental '(#\c-x #\f) 'set-fill-column)
 (define-key 'fundamental '(#\c-x #\g) 'insert-register)
@@ -343,7 +287,6 @@ and the cdrs of which are major modes."
 (define-key 'fundamental '(#\c-x #\j) 'register-to-point)
 (define-key 'fundamental '(#\c-x #\k) 'kill-buffer)
 (define-key 'fundamental '(#\c-x #\l) 'count-lines-page)
-;m
 (define-key 'fundamental '(#\c-x #\n) 'narrow-to-region)
 (define-key 'fundamental '(#\c-x #\o) 'other-window)
 (define-key 'fundamental '(#\c-x #\p) 'narrow-to-page)
@@ -352,12 +295,9 @@ and the cdrs of which are major modes."
 (define-key 'fundamental '(#\c-x #\s) 'save-some-buffers)
 ;(define-key 'fundamental '(#\c-x #\t) 'transpose-regions)
 (define-key 'fundamental '(#\c-x #\u) 'undo)
-;v
 (define-key 'fundamental '(#\c-x #\w) 'widen)
 (define-key 'fundamental '(#\c-x #\x) 'copy-to-register)
-;y
 (define-key 'fundamental '(#\c-x #\z) 'suspend-edwin)
 (define-key 'fundamental '(#\c-x #\{) 'shrink-window-horizontally)
-;|
 (define-key 'fundamental '(#\c-x #\}) 'enlarge-window-horizontally)
-;~(define-key 'fundamental '(#\c-x #\rubout) 'backward-kill-sentence)
\ No newline at end of file
+(define-key 'fundamental '(#\c-x #\rubout) 'backward-kill-sentence)
\ No newline at end of file
index 4ce3df03120749d3366d4ebffa297d95a3bebfff..8528d77dd0e019a2f26c8ffbf93464a2415aec58 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/schmod.scm,v 1.11 1989/05/16 18:52:49 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/schmod.scm,v 1.12 1989/08/07 08:45:12 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
 ;;;
@@ -178,7 +178,8 @@ the buffer *Transcript*:
            (WITH-INPUT-FROM-PORT . 1)
            (WITH-INPUT-FROM-STRING . 1)
            (WITH-OUTPUT-TO-PORT . 1)
-           (WITH-OUTPUT-TO-STRING . 1)     (WITH-VALUES . 1)
+           (WITH-OUTPUT-TO-STRING . 0)
+           (WITH-VALUES . 1)
 
            (BIND-CONDITION-HANDLER . 2)
            (LIST-TRANSFORM-POSITIVE . 1)
index 1babfd304ba218fe5a39fe4fc7abca43122ad92e..e0ad858fd09dd13583996eef126c020565ec9775 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/unix.scm,v 1.7 1989/08/04 03:17:28 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/unix.scm,v 1.8 1989/08/07 08:45:16 cph Exp $
 ;;;
 ;;;    Copyright (c) 1989 Massachusetts Institute of Technology
 ;;;
@@ -209,11 +209,20 @@ Includes the new backup.  Must be > 0"
                     4
                     16)
          " "
-         (pathname-name-string pathname)))))
+         (pathname-name-string pathname)
+         (let ((type (file-attributes/type attributes)))
+           (if (string? type)
+               (string-append " -> " type)
+               ""))))))
 
 (define (os/dired-filename-region lstart)
   (let ((lend (line-end lstart 0)))
-    (char-search-backward #\Space lend lstart 'LIMIT)    (make-region (re-match-end 0) lend)))
+    (if (not (re-search-forward
+             "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\) +[0-9]+ +[0-9:]+ "
+             lstart
+             lend))
+       (editor-error "No filename on this line"))
+    (make-region (re-match-end 0) lend)))
 
 (define (os/dired-sort-pathnames pathnames)
   (sort pathnames