[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keyboard macros



At 23:39 2/21/93 -0500, Michael Travers wrote:
>I have a keyboard macro hack that (I think) appears on the MCL CDROM.
>Rather than posting the whole thing here, I'll just send the patch
>that makes it possible for i-search to work:
> 
>;;; Patched from lib;fred-additions.lisp -- original looked at event record rather than *current-keystroke*
>(defun i-search-do-keystroke (w)
>  (declare (special *default-command-p*))
>  (let* ((key-code *current-keystroke*)
>         (key-name (keystroke-name key-code)))
>    (if (and (or (%i> key-code 32)
>                 (eq key-code (char-code #\return))
>                 (eq key-code (char-code #\tab))
>                 (eq key-code (char-code #\space)))
>             (neq key-name #\rubout)
>             (characterp key-name))
>           (i-search-add-char w key-name)
>           (progn
>             (ed-push-mark w (car *i-search-original-pos*))
>             (remove-shadowing-comtab w)
>             ;(collapse-selection w t) ; I like this but Mac weenies probably wont
>             (run-fred-command w (keystroke-function w key-code))
>             (setq *default-command-p* t)
>             (i-search-all-done w)))))

I had intended that patch to be part of patch 1 for MCL 2.0. Aparently,
it didn't make it. I'll lobby for its inclusion in patch 3. One note:
you'll probably want to evaluate the redefinition (in-package :ccl).
I'm pretty sure that some of the symbols it references are not exported.