From 9077094148ed1ecc2086032bed80bfa92ca24759 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Fri, 19 Jun 2009 13:27:30 +0000 Subject: [PATCH] Change all references to char-code-limit to 256 when compiling on a Unicode build. This allows Hemlock to load and run but does not work correctly with a Unicode build. The display is wrong, among other things. --- hemlock/charmacs.lisp | 4 ++-- hemlock/key-event.lisp | 6 +++--- hemlock/linimage.lisp | 14 ++++++++++---- hemlock/scribe.lisp | 4 ++-- hemlock/spellcoms.lisp | 4 ++-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hemlock/charmacs.lisp b/hemlock/charmacs.lisp index be49d7897..4e4ad22c5 100644 --- a/hemlock/charmacs.lisp +++ b/hemlock/charmacs.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/charmacs.lisp,v 1.4 1994/10/31 04:50:12 ram Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/charmacs.lisp,v 1.5 2009/06/19 13:27:30 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -30,7 +30,7 @@ ;;;; Stuff for the Syntax table functions (syntax) -(defconstant syntax-char-code-limit char-code-limit +(defconstant syntax-char-code-limit #-unicode char-code-limit #+unicode 256 "The highest char-code which a character argument to the syntax table functions may have.") diff --git a/hemlock/key-event.lisp b/hemlock/key-event.lisp index f9a3bb15c..91812db5f 100644 --- a/hemlock/key-event.lisp +++ b/hemlock/key-event.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/key-event.lisp,v 1.5 2001/03/13 15:49:53 pw Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/key-event.lisp,v 1.6 2009/06/19 13:27:30 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -296,7 +296,7 @@ ;;; This maps Common Lisp CHAR-CODE's to character classes for parsing #k ;;; syntax. ;;; -(defvar *key-character-classes* (make-array char-code-limit +(defvar *key-character-classes* (make-array #-unicode char-code-limit #+unicode 256 :initial-element :other)) ;;; These characters are special: @@ -740,7 +740,7 @@ (setf *keysym-high-bytes* (make-array 256 :initial-element nil)) (setf *key-event-characters* (make-hash-table)) (setf *character-key-events* - (make-array char-code-limit :initial-element nil)) + (make-array #-unicode char-code-limit #+unicode 256 :initial-element nil)) (define-key-event-modifier "Hyper" "H") (define-key-event-modifier "Super" "S") diff --git a/hemlock/linimage.lisp b/hemlock/linimage.lisp index 1847a66a3..6cb3fd93d 100644 --- a/hemlock/linimage.lisp +++ b/hemlock/linimage.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/linimage.lisp,v 1.4 2001/03/13 15:49:54 pw Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/linimage.lisp,v 1.5 2009/06/19 13:27:30 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -61,7 +61,8 @@ (defconstant winning-char #b01 "Bit for a char that prints normally") (defconstant losing-char #b10 "Bit for char with funny representation.") (defvar *losing-character-mask* - (make-array char-code-limit :element-type '(mod 256) + (make-array #-unicode char-code-limit #+unicode 256 + :element-type '(mod 256) :initial-element winning-char) "This is a character set used by redisplay to find funny chars.") (defvar *print-representation-vector* nil @@ -93,14 +94,19 @@ on the screen. If the value is a string this string is literally displayed. If it is a function, then that function is called with the current X position to get the string to display.") + + ;; @@FIXME: Hack to let hemlock work on a unicode build. We don't + ;; try to make a print-presentation-vector handle the entire unicode + ;; space, just the basic 256 characters. I (rtoy) suspect hemlock + ;; wouldn't work very well with unicode strings anyway (setq *print-representation-vector* - (make-array char-code-limit :initial-element nil)) + (make-array #-unicode char-code-limit #+unicode 256 :initial-element nil)) (setf (attribute-descriptor-vector (gethash :print-representation *character-attributes*)) *print-representation-vector*) (do ((code 128 (1+ code)) (str (make-string 4) (make-string 4))) - ((= code char-code-limit)) + ((= code #-unicode char-code-limit #+unicode 256)) (setf (aref *losing-character-mask* code) losing-char) (setf (aref *print-representation-vector* code) str) (setf (schar str 0) #\<) diff --git a/hemlock/scribe.lisp b/hemlock/scribe.lisp index 4171c00f1..4dee4aaeb 100644 --- a/hemlock/scribe.lisp +++ b/hemlock/scribe.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/scribe.lisp,v 1.4 1994/10/31 04:50:12 ram Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/scribe.lisp,v 1.5 2009/06/19 13:27:30 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -40,7 +40,7 @@ (defhvar "Scribe Bracket Table" "This table maps a Scribe brackets, open and close, to their opposing brackets." - :value (make-array char-code-limit)) + :value (make-array #-unicode char-code-limit #+unicode 256)) ;;; (mapc #'(lambda (x y) (setf (svref (value scribe-bracket-table) (char-code x)) y) diff --git a/hemlock/spellcoms.lisp b/hemlock/spellcoms.lisp index 4d6e9eecd..04cf21530 100644 --- a/hemlock/spellcoms.lisp +++ b/hemlock/spellcoms.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/spellcoms.lisp,v 1.4 1994/10/31 04:50:12 ram Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/spellcoms.lisp,v 1.5 2009/06/19 13:27:30 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -364,7 +364,7 @@ ;;;; Buffer Correction (defvar *spell-word-characters* - (make-array char-code-limit :element-type 'bit :initial-element 0) + (make-array #-unicode char-code-limit #+unicode 256 :element-type 'bit :initial-element 0) "Characters that are legal in a word for spelling checking purposes.") (do-alpha-chars (c :both) -- GitLab