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

Patch for emacspeak-eterm.el



Hi Raman,

attached is a patch for emacspeak-eterm.el that fixes the problem with
backspace saying "newline" rather than the character being deleted. 

The problem is as previously reported, last-command-char returns
symbols as well as ascii values and under X instead of returning 127,
it returns the symbol 'backspace. 

Actually, I found out that even under the console or xterm,
last-command-char returns symbols as well as ascii values. For
example, if you use the delete char, it returns the symbol 'deletechar
just like under X. The arrow keys also return symbols for 'left,
'right, 'up and 'down in a console and xterm.

I also changed last-command-char to last-command-event. I did this for
two reasons. The last-command-char is an alias for last-command-event
added for compatibility with emacs 19, which emacspeak doesn't support
anyway and because I think last-command-char can be a bit misleading
because the value can be symbols as well as ascii chars. Therefore, I
felt last-command-event was more accurate. 

The patch is against the latest SVN snapshot checked out today and has
the ID

$Id: emacspeak-eterm.el 4167 2006-09-04 17:26:32Z tv.raman.tv $

regards,

Tim

*** emacspeak-eterm.el.orig	2006-09-07 15:32:25.000000000 +1000
--- emacspeak-eterm.el	2006-09-07 16:28:14.000000000 +1000
***************
*** 1147,1153 ****
            (error nil )))
         (emacspeak-eterm-focus-window
          (emacspeak-eterm-speak-window emacspeak-eterm-focus-window))
!        ((and (eq last-command-char 127)
               (= new-row emacspeak-eterm-row )
               (= -1 (- new-column emacspeak-eterm-column ))
               current-char)              ;you backspaced?
--- 1147,1154 ----
            (error nil )))
         (emacspeak-eterm-focus-window
          (emacspeak-eterm-speak-window emacspeak-eterm-focus-window))
!        ((and (or (eq last-command-event 127)         ; xterm/console sends 127
!                  (eq last-command-event 'backspace)) ; X sends 'backspace
               (= new-row emacspeak-eterm-row )
               (= -1 (- new-column emacspeak-eterm-column ))
               current-char)              ;you backspaced?
***************
*** 1156,1162 ****
          (dtk-tone 500 50))
         ((and (= new-row emacspeak-eterm-row )
               (= 1 (- new-column emacspeak-eterm-column ))) ;you inserted a character:
!         (if (eq 32 last-command-char )
              (save-excursion
                (backward-char 2)
                (emacspeak-speak-word nil))
--- 1157,1163 ----
          (dtk-tone 500 50))
         ((and (= new-row emacspeak-eterm-row )
               (= 1 (- new-column emacspeak-eterm-column ))) ;you inserted a character:
!         (if (eq 32 last-command-event )
              (save-excursion
                (backward-char 2)
                (emacspeak-speak-word nil))

-- 
Tim Cross
tcross@xxxxxxxxxxx

There are two types of people in IT - those who do not manage what they 
understand and those who do not understand what they manage.

Emacspeak Files | Subscribe | Unsubscribe | Search