Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
dd4e4f02
Commit
dd4e4f02
authored
34 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Ripped bit/font noise out of #\ processing.
parent
a45fcf94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/sharpm.lisp
+11
-43
11 additions, 43 deletions
code/sharpm.lisp
with
11 additions
and
43 deletions
code/sharpm.lisp
+
11
−
43
View file @
dd4e4f02
...
@@ -20,53 +20,21 @@
...
@@ -20,53 +20,21 @@
(
proclaim
'
(
special
*read-suppress*
std-lisp-readtable
*bq-vector-flag*
))
(
proclaim
'
(
special
*read-suppress*
std-lisp-readtable
*bq-vector-flag*
))
(
defun
sharp-backslash
(
stream
backslash
font
)
(
defun
sharp-backslash
(
stream
backslash
ignore
)
(
declare
(
ignore
ignore
))
(
unread-char
backslash
stream
)
(
unread-char
backslash
stream
)
(
let*
((
*readtable*
std-lisp-readtable
)
(
let*
((
*readtable*
std-lisp-readtable
)
(
bitnames
())
(
charstring
(
read-extended-token
stream
)))
(
charstring
(
read-extended-token
stream
)))
(
declare
(
simple-string
charstring
))
(
declare
(
simple-string
charstring
))
(
when
*read-suppress*
(
return-from
sharp-backslash
nil
))
(
cond
(
*read-suppress*
nil
)
;;find bit name prefixes
((
=
(
the
fixnum
(
length
charstring
))
1
)
(
do
((
i
(
position
#\-
charstring
)
(
position
#\-
charstring
)))
(
char
charstring
0
))
((
or
(
null
i
)
(
zerop
(
the
fixnum
i
))))
((
name-char
charstring
))
(
let
((
bitname
(
string-upcase
(
subseq
charstring
0
i
))))
(
t
(
setq
charstring
(
subseq
charstring
(
1+
(
the
fixnum
i
))))
(
error
"Meaningless character name: ~S"
charstring
)))))
;;* symbols in alist are a kludge to circumvent xc bogosity.
(
let
((
expansion
(
cdr
(
assoc
bitname
'
((
"C"
.
CONTROL
)
(
"M"
.
META
)
(
"H"
.
HYPER
)
(
"S"
.
SUPER
))
:test
#'
equal
))))
(
if
expansion
(
setq
bitname
(
symbol-name
expansion
)))
(
cond
((
member
bitname
'
(
"CONTROL"
"META"
"HYPER"
"SUPER"
)
:test
#'
EQUAL
)
(
if
(
not
(
member
bitname
bitnames
:test
#'
EQUAL
))
(
push
bitname
bitnames
)
(
error
"Redundant bit name in character name: ~A"
bitname
)))
(
t
(
error
"Meaningless bit name in character name: ~A"
bitname
))))))
;;build un-hyphenated char, add specified bits:
(
let
((
char
(
if
(
=
(
the
fixnum
(
length
charstring
))
1
)
(
char
charstring
0
)
(
name-char
charstring
))))
(
cond
(
char
(
if
font
(
setq
char
(
make-char
char
0
font
)))
(
if
(
member
"CONTROL"
bitnames
:test
#'
EQUAL
)
(
setq
char
(
set-char-bit
char
:control
t
)))
(
if
(
member
"META"
bitnames
:test
#'
EQUAL
)
(
setq
char
(
set-char-bit
char
:meta
t
)))
(
if
(
member
"HYPER"
bitnames
:test
#'
EQUAL
)
(
setq
char
(
set-char-bit
char
:hyper
t
)))
(
if
(
member
"SUPER"
bitnames
:test
#'
EQUAL
)
(
setq
char
(
set-char-bit
char
:super
t
)))
char
)
(
t
(
error
"Meaningless character name ~A"
charstring
))))))
(
defun
sharp-quote
(
stream
ignore1
ignore2
)
(
defun
sharp-quote
(
stream
ignore1
ignore2
)
(
declare
(
ignore
ignore1
ignore2
))
(
declare
(
ignore
ignore1
ignore2
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment