From 9de385fe35816cdc1d7761c7f29bc6034bee1c14 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 10 Jan 2000 03:25:19 +0000 Subject: [PATCH] Generate set of ANSI character image strings, and make that the default set to be used under Windows. This is necessary so that Edwin will work more-or-less right with other languages. --- v7/src/edwin/buffrm.scm | 6 +-- v7/src/edwin/dos.scm | 7 ++- v7/src/edwin/editor.scm | 10 +++-- v7/src/edwin/image.scm | 94 +++++++++++++---------------------------- v7/src/edwin/iserch.scm | 11 ++--- v7/src/edwin/modlin.scm | 7 +-- v7/src/edwin/os2.scm | 7 ++- v7/src/edwin/snr.scm | 7 +-- v7/src/edwin/unix.scm | 9 ++-- 9 files changed, 68 insertions(+), 90 deletions(-) diff --git a/v7/src/edwin/buffrm.scm b/v7/src/edwin/buffrm.scm index 415a11623..955b5afcf 100644 --- a/v7/src/edwin/buffrm.scm +++ b/v7/src/edwin/buffrm.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: buffrm.scm,v 1.54 1999/03/18 02:27:56 cph Exp $ +;;; $Id: buffrm.scm,v 1.55 2000/01/10 03:23:41 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -313,7 +313,7 @@ Index 0 might contain \"^@\" so ascii NUL appears as ^@. The indices for normal printing characters usually contain a string containing just that character, e.g. index 65 usually contains \"A\". Automatically becomes local when set in any fashion." - default-char-image-strings + (os/default-char-image-strings) (lambda (object) (and (vector? object) (= (vector-length object) 256) diff --git a/v7/src/edwin/dos.scm b/v7/src/edwin/dos.scm index caa20c5fe..0de0a8ad3 100644 --- a/v7/src/edwin/dos.scm +++ b/v7/src/edwin/dos.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: dos.scm,v 1.49 1999/02/01 03:33:56 cph Exp $ +;;; $Id: dos.scm,v 1.50 2000/01/10 03:23:27 cph Exp $ ;;; -;;; Copyright (c) 1992-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1992-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -66,6 +66,9 @@ (lambda (entry) (fix:= (fix:and (file-attributes/modes (cdr entry)) mask) 0)))))))) + +(define (os/default-char-image-strings) + default-char-image-strings/ansi) ;;;; Win32 Clipboard Interface diff --git a/v7/src/edwin/editor.scm b/v7/src/edwin/editor.scm index 29ea82ed7..dbb20c55f 100644 --- a/v7/src/edwin/editor.scm +++ b/v7/src/edwin/editor.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: editor.scm,v 1.245 1999/05/11 20:31:01 cph Exp $ +;;; $Id: editor.scm,v 1.246 2000/01/10 03:24:54 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -349,8 +349,10 @@ This does not affect editor errors or evaluation errors." (lambda () (if (and (not in-prompt?) (not (string-find-next-char report-string #\newline)) - (< (string-columns report-string 0 8 - default-char-image-strings) + (< (string-columns + report-string 0 8 + (variable-default-value + (ref-variable-object char-image-strings))) (window-x-size (typein-window)))) (typein-report) (error-buffer-report))))) diff --git a/v7/src/edwin/image.scm b/v7/src/edwin/image.scm index 9206746c3..dc04d8c61 100644 --- a/v7/src/edwin/image.scm +++ b/v7/src/edwin/image.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: image.scm,v 1.134 1999/01/02 06:11:34 cph Exp $ +;;; $Id: image.scm,v 1.135 2000/01/10 03:24:46 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -72,72 +72,36 @@ (vector-8b-ref string index)))))) ((fix:= index end) column)))) -;;(define-integrable char-image-lengths -;; '#(2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 -;; 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -;; 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -;; 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 -;; 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 -;; 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 -;; 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 -;; 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4)) - (define default-char-image-strings - '#("^@" "^A" "^B" "^C" "^D" "^E" "^F" "^G" - "^H" "^I" "^J" "^K" "^L" "^M" "^N" "^O" - "^P" "^Q" "^R" "^S" "^T" "^U" "^V" "^W" - "^X" "^Y" "^Z" "^[" "^\\" "^]" "^^" "^_" - " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" - "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "=" ">" "?" - "@" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" - "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" "[" "\\" "]" "^" "_" - "`" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" - "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~" "^?" - "\\200" "\\201" "\\202" "\\203" "\\204" "\\205" "\\206" "\\207" - "\\210" "\\211" "\\212" "\\213" "\\214" "\\215" "\\216" "\\217" - "\\220" "\\221" "\\222" "\\223" "\\224" "\\225" "\\226" "\\227" - "\\230" "\\231" "\\232" "\\233" "\\234" "\\235" "\\236" "\\237" - "\\240" "\\241" "\\242" "\\243" "\\244" "\\245" "\\246" "\\247" - "\\250" "\\251" "\\252" "\\253" "\\254" "\\255" "\\256" "\\257" - "\\260" "\\261" "\\262" "\\263" "\\264" "\\265" "\\266" "\\267" - "\\270" "\\271" "\\272" "\\273" "\\274" "\\275" "\\276" "\\277" - "\\300" "\\301" "\\302" "\\303" "\\304" "\\305" "\\306" "\\307" - "\\310" "\\311" "\\312" "\\313" "\\314" "\\315" "\\316" "\\317" - "\\320" "\\321" "\\322" "\\323" "\\324" "\\325" "\\326" "\\327" - "\\330" "\\331" "\\332" "\\333" "\\334" "\\335" "\\336" "\\337" - "\\340" "\\341" "\\342" "\\343" "\\344" "\\345" "\\346" "\\347" - "\\350" "\\351" "\\352" "\\353" "\\354" "\\355" "\\356" "\\357" - "\\360" "\\361" "\\362" "\\363" "\\364" "\\365" "\\366" "\\367" - "\\370" "\\371" "\\372" "\\373" "\\374" "\\375" "\\376" "\\377")) + (let ((strings (make-vector 256))) + (do ((i #x00 (+ i 1))) + ((= #x20 i)) + (vector-set! strings i (string #\^ (integer->char (+ #x40 i))))) + (do ((i #x20 (+ i 1))) + ((= #x7f i)) + (vector-set! strings i (string (integer->char i)))) + (vector-set! strings #x7f "^?") + (do ((i #x80 (+ i 1))) + ((= #x100 i)) + (vector-set! strings i (string-append "\\" (number->string i 8)))) + strings)) -(define default-char-image-strings/ascii - '#("[NUL]" "[SOH]" "[STX]" "[ETX]" "[EOT]" "[ENQ]" "[ACK]" "[BEL]" - "[BS]" "[HT]" "[NL]" "[VT]" "[Page]" "[CR]" "[SO]" "[SI]" - "[DLE]" "[DC1]" "[DC2]" "[DC3]" "[DC4]" "[NAK]" "[SYN]" "[ETB]" - "[CAN]" "[EM]" "[SUB]" "[ESC]" "[FS]" "[GS]" "[RS]" "[US]" - " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" - "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "=" ">" "?" - "@" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" - "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" "[" "\\" "]" "^" "_" - "`" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" - "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~" "^?" - "\\200" "\\201" "\\202" "\\203" "\\204" "\\205" "\\206" "\\207" - "\\210" "\\211" "\\212" "\\213" "\\214" "\\215" "\\216" "\\217" - "\\220" "\\221" "\\222" "\\223" "\\224" "\\225" "\\226" "\\227" - "\\230" "\\231" "\\232" "\\233" "\\234" "\\235" "\\236" "\\237" - "\\240" "\\241" "\\242" "\\243" "\\244" "\\245" "\\246" "\\247" - "\\250" "\\251" "\\252" "\\253" "\\254" "\\255" "\\256" "\\257" - "\\260" "\\261" "\\262" "\\263" "\\264" "\\265" "\\266" "\\267" - "\\270" "\\271" "\\272" "\\273" "\\274" "\\275" "\\276" "\\277" - "\\300" "\\301" "\\302" "\\303" "\\304" "\\305" "\\306" "\\307" - "\\310" "\\311" "\\312" "\\313" "\\314" "\\315" "\\316" "\\317" - "\\320" "\\321" "\\322" "\\323" "\\324" "\\325" "\\326" "\\327" - "\\330" "\\331" "\\332" "\\333" "\\334" "\\335" "\\336" "\\337" - "\\340" "\\341" "\\342" "\\343" "\\344" "\\345" "\\346" "\\347" - "\\350" "\\351" "\\352" "\\353" "\\354" "\\355" "\\356" "\\357" - "\\360" "\\361" "\\362" "\\363" "\\364" "\\365" "\\366" "\\367" - "\\370" "\\371" "\\372" "\\373" "\\374" "\\375" "\\376" "\\377")) +(define default-char-image-strings/ansi + (let ((strings (vector-copy default-char-image-strings))) + (do ((i #x80 (+ i 1))) + ((= #x100 i)) + (vector-set! strings i (string (integer->char i)))) + strings)) +(define default-char-image-strings/ascii + (let ((strings (vector-copy default-char-image-strings))) + (subvector-move-left! + '#("[NUL]" "[SOH]" "[STX]" "[ETX]" "[EOT]" "[ENQ]" "[ACK]" "[BEL]" + "[BS]" "[HT]" "[NL]" "[VT]" "[FF]" "[CR]" "[SO]" "[SI]" + "[DLE]" "[DC1]" "[DC2]" "[DC3]" "[DC4]" "[NAK]" "[SYN]" "[ETB]" + "[CAN]" "[EM]" "[SUB]" "[ESC]" "[FS]" "[GS]" "[RS]" "[US]") + 0 #x20 strings 0) + strings)) (define (group-line-columns group start end column tab-width char-image-strings) diff --git a/v7/src/edwin/iserch.scm b/v7/src/edwin/iserch.scm index 2bfc6ad85..fee6615e3 100644 --- a/v7/src/edwin/iserch.scm +++ b/v7/src/edwin/iserch.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: iserch.scm,v 1.21 1999/01/02 06:11:34 cph Exp $ +;;; $Id: iserch.scm,v 1.22 2000/01/10 03:25:19 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -181,8 +181,9 @@ "I-search" (if (search-state-forward? state) "" " backward") ": " - (string-image (search-state-text state) 0 false - default-char-image-strings) + (string-image (search-state-text state) 0 #f + (ref-variable char-image-strings + (search-state-start-point state))) (if invalid-regexp (string-append " [" invalid-regexp "]") "")))) (string-set! m 0 (char-upcase (string-ref m 0))) m))) @@ -211,7 +212,7 @@ (unsuccessful-search-state state text (search-state-forward? state))))) - + (define regexp-retry-chars ;; If one of these characters is entered, retry the regexp search ;; from the initial point since it may now match something that it diff --git a/v7/src/edwin/modlin.scm b/v7/src/edwin/modlin.scm index 742aac196..f3617fea4 100644 --- a/v7/src/edwin/modlin.scm +++ b/v7/src/edwin/modlin.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: modlin.scm,v 1.20 1999/01/02 06:11:34 cph Exp $ +;;; $Id: modlin.scm,v 1.21 2000/01/10 03:24:58 cph Exp $ ;;; -;;; Copyright (c) 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -319,7 +319,8 @@ If #F, the normal method is used." (substring-image! string start end line column max-end #f 0 results - default-char-image-strings) + (variable-default-value + (ref-variable-object char-image-strings))) (if (fix:< (vector-ref results 1) min-end) (begin (do ((x (vector-ref results 1) (fix:+ x 1))) diff --git a/v7/src/edwin/os2.scm b/v7/src/edwin/os2.scm index 4578a3ab4..d77f42491 100644 --- a/v7/src/edwin/os2.scm +++ b/v7/src/edwin/os2.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: os2.scm,v 1.46 1999/02/01 16:09:29 cph Exp $ +;;; $Id: os2.scm,v 1.47 2000/01/10 03:23:33 cph Exp $ ;;; -;;; Copyright (c) 1994-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1994-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -55,6 +55,9 @@ (if attr (cons (cons (file-namestring (car pathnames)) attr) result) result)))))) + +(define (os/default-char-image-strings) + default-char-image-strings) ;;;; OS/2 Clipboard Interface diff --git a/v7/src/edwin/snr.scm b/v7/src/edwin/snr.scm index 3f18ef237..243a331b6 100644 --- a/v7/src/edwin/snr.scm +++ b/v7/src/edwin/snr.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: snr.scm,v 1.54 1999/11/08 18:28:47 cph Exp $ +;;; $Id: snr.scm,v 1.55 2000/01/10 03:25:14 cph Exp $ ;;; -;;; Copyright (c) 1995-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1995-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -2250,7 +2250,8 @@ This is useful when the subject has been truncated by the one-line display." (let ((subject (canonicalize-subject (news-header:subject (current-news-header))))) (if (and (not argument) - (< (string-columns subject 0 8 default-char-image-strings) + (< (string-columns subject 0 8 + (ref-variable char-image-strings)) (window-x-size (typein-window)))) (message subject) (pop-up-temporary-buffer " news-header subject" diff --git a/v7/src/edwin/unix.scm b/v7/src/edwin/unix.scm index 5a252297f..ea2fee55f 100644 --- a/v7/src/edwin/unix.scm +++ b/v7/src/edwin/unix.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: unix.scm,v 1.103 1999/12/22 02:41:18 cph Exp $ +;;; $Id: unix.scm,v 1.104 2000/01/10 03:23:37 cph Exp $ ;;; -;;; Copyright (c) 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -667,4 +667,7 @@ option, instead taking -P ." (list "/usr/local/lib/info" "/usr/local/info" "/usr/share/info" - "/usr/info")) \ No newline at end of file + "/usr/info")) + +(define (os/default-char-image-strings) + default-char-image-strings) \ No newline at end of file -- 2.25.1