Article View: net.lang.lisp
Article #586Re: Changing syntax of characters in Franz
From: Max Hailperin
Date: Thu, 05 Jun 1986 19:38
Date: Thu, 05 Jun 1986 19:38
26 lines
1802 bytes
1802 bytes
The reason why you have no luck setting the syntax for ^R is that ^R is by
default interpreted by the terminal driver as reprint line. This can be
changed with stty if you really want ^R.
The fact that (return) must be lexically within the prog isn't the whole
truth. Were it, then typing (return) at a break-loop wouldn't work either.
The real truth is that the break-loop specifically checks for forms whose
car is return and handles them specially. (The code is in
/usr/lib/lisp/toplevel.l) Thus one obvious approach is to extend this
special case code.
A better way is to have the character-macro return a (return) form, not
execute it. For example:
(defun return-character-macro (x)
(if (null x)
(tconc nil '(return))
(tconc x '||))) ; that's a ctrl-P if you can't see it
(add-syntax-class 'vfirst-infix-macro '(cinfix-macro escape-when-first))
(setsyntax '|| 'vfirst-infix-macro 'return-character-macro) ;likewise
together with telling the shell
stty brk ^P
results in ctrl-P (without needing a return following it) returning from
a break loop.
This assumes you are using the new terminal driver, but nearly anyone does.
Technical Details
Message-ID:
<238@ecrcvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!husc6!harvard!seismo!mcvax!unido!ecrcvax!maxReferences:
<555@bcsaic.UUCP> <pucc-h.2871>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!husc6!harvard!seismo!mcvax!unido!ecrcvax!max From: max@ecrcvax.UUCP (Max Hailperin) Newsgroups: net.lang.lisp Subject: Re: Changing syntax of characters in Franz Message-ID: <238@ecrcvax.UUCP> Date: Thu, 5-Jun-86 15:38:12 EDT Article-I.D.: ecrcvax.238 Posted: Thu Jun 5 15:38:12 1986 Date-Received: Sat, 7-Jun-86 13:55:02 EDT References: <555@bcsaic.UUCP> <pucc-h.2871> Reply-To: max@ecrcvax.UUCP (Max Hailperin) Organization: ECRC, D-8000 Muenchen 81, W. Germany Lines: 26