diff --git a/rmacs/TODO b/rmacs/TODO index 9b77920..6fc754a 100644 --- a/rmacs/TODO +++ b/rmacs/TODO @@ -9,8 +9,5 @@ command handler have everything it needs even in the face of change Need line wrap of some kind. -unknown-escape-sequence contents are byte strings, and keyseq parsing -and printing should reflect that. - Catch and handle SIGWINCH. See http://man7.org/tlpi/code/online/dist/tty/demo_SIGWINCH.c.html diff --git a/rmacs/keys.rkt b/rmacs/keys.rkt index 3ffd691..a9ef78d 100644 --- a/rmacs/keys.rkt +++ b/rmacs/keys.rkt @@ -48,7 +48,7 @@ (cons '#:default (parse-key-sequence rest))] [(pregexp "^ *(([cCsSmM]-)*)\"([^\"]*)\"(.*)" (list lexeme modifiers _ stringspec rest)) (define mods (parse-modifiers modifiers lexeme)) - (define seq (unknown-escape-sequence (or (read-string-to-end (format "\"~a\"" stringspec)) + (define seq (unknown-escape-sequence (or (read-string-to-end (format "#\"~a\"" stringspec)) (bad-key lexeme "Bad raw input sequence")))) (cons (key seq mods) (parse-key-sequence rest))] [(pregexp "^ *(([cCsSmM]-)*)<([^>]+)>(( +.*)|$)" (list lexeme modifiers _ symname rest _)) @@ -99,8 +99,9 @@ [(key value modifiers) (define-values (str updated-modifiers) (match value - [(unknown-escape-sequence s) - (values (format "~v" s) modifiers)] + [(unknown-escape-sequence bs) + (define s (format "~v" bs)) + (values (substring s 1 (string-length s)) modifiers)] [(? symbol? s) (values (format "<~a>" s) modifiers)] [#\[ #:when (set-member? modifiers 'control)