gnu-emacs-sources
[Top][All Lists]
Advanced

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

Re: Typewriter input simulation for EMACS


From: Pascal J. Bourguignon
Subject: Re: Typewriter input simulation for EMACS
Date: Sun, 28 Jul 2013 00:36:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

chipschap <address@hidden> writes:

> OK, I *did* add sound to it, but you'll have to download your own
> sound effects from places like you mention, soundjay.com or
> sounddogs.com or others. I don't have redistribution rights for those.
>
> writer-typewriter now has three modes: pure typewriter simulation (no
> backspacing, arrow keys, nothing but input typing); typewriter
> simulation with keyclicks; and keyclicks only (normal input mode but
> with sounds).
>
> It got kind of long. It's here:
>
> http://www.bobnewell.net/writer-typewriter.el
>
> There are still a few sound lag problems. It isn't so bad but you'll
> notice. I've done what I can to minimize it, short of setting up a
> sound daemon.

Ok, nice.

Now, defvar is a toplevel form. Inside a defun it doesn't do what you
believe it does.  Use let instead.

    (defun writer-typewriter ()
    "Act like a silent typewriter for input"
     (interactive)
     (let (writer-input-charno)
        (while t
           …)))


write-typewriter is rather untypical a command, with this while t.  You
could instead write a typewriter major mode, that would let the user
switch to other buffers, while neutralizing all the other bindings, like
M-x term RET.

As a major mode, there wouldn't be an explicit loop, but instead you'd
bind keys to the commands you want. 

You could add a single binding of the <print> key to ps-print-buffer, to
eventually get a hard copy, or it could occur automatically when you
reach the last line of the page, with the buffer being reset to a white
page ;-)


Check:
http://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Modes.html


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.  
You know you've been lisping too long when you see a recent picture of George 
Lucas and think "Wait, I thought John McCarthy was dead!" -- Dalek_Baldwin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]