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

Re: Tabulation problem, possibly a mac speech server bug



like approach 2 -- will apply it later today
>>>>> "Bart" == Bart Bunting <bart@xxxxxxxxxxx> writes:
    Bart> Hi, Ok, tracked it down.
    Bart> 
    Bart> Would still like some feedback as to if this effects
    Bart> only the mac server or others as well.
    Bart> 
    Bart> Firstly, the issue was caused by two extra spaces at
    Bart> the end of the line that is sent to the speech process
    Bart> as well as an additional space after the
    Bart> newline. (haven't tracked down exactly what's happening
    Bart> in the speech server).
    Bart> 
    Bart> I found two ways to fix this and would like advice on
    Bart> what is preferred.
    Bart> 
    Bart> First way is to simply remove the additional
    Bart> spaces. See the first defmacro below.
    Bart> 
    Bart> Second is to not interact with the speech process
    Bart> directly from tts-with-punctuations and instead call
    Bart> dtk-interp-set-punctuations which does the same thing
    Bart> but sends the correct string. I've pasted a copy of the
    Bart> defmacro using this aproach second.
    Bart> 
    Bart> I feel that calling dtk-interp-set-punctuations is the
    Bart> better option as it minimizes places that talk to the
    Bart> speech server process as well as makes
    Bart> tts-with-punctuations more readable (for me anyway).
    Bart> 
    Bart> Here are the two approaches.
    Bart> 
    Bart> Firstly just the removed spaces:
    Bart> 
    Bart> (defmacro tts-with-punctuations (setting &rest body)
    Bart> "Safely set punctuation mode for duration of body
    Bart> form." `(progn (declare (special dtk-punctuation-mode))
    Bart> (let ((save-punctuation-mode dtk-punctuation-mode))
    Bart> (unwind-protect (progn (unless (eq ,setting
    Bart> save-punctuation-mode) (process-send-string
    Bart> dtk-speaker-process (format "tts_set_punctuations %s\n"
    Bart> ,setting)) (setq dtk-punctuation-mode ,setting)) ,@body
    Bart> (dtk-force)) (unless (eq ,setting
    Bart> save-punctuation-mode) (setq dtk-punctuation-mode
    Bart> save-punctuation-mode) (process-send-string
    Bart> dtk-speaker-process (format "tts_set_punctuations %s\n"
    Bart> dtk-punctuation-mode )) (dtk-force))))))
    Bart> 
    Bart> 
    Bart> And the one using dtk-interp-set-punctuations:
    Bart> 
    Bart> (defmacro tts-with-punctuations (setting &rest body)
    Bart> "Safely set punctuation mode for duration of body
    Bart> form." `(progn (declare (special dtk-punctuation-mode))
    Bart> (let ((save-punctuation-mode dtk-punctuation-mode))
    Bart> (unwind-protect (progn (unless (eq ,setting
    Bart> save-punctuation-mode) (dtk-interp-set-punctuations
    Bart> ,setting) (setq dtk-punctuation-mode ,setting)) ,@body
    Bart> (dtk-force)) (unless (eq ,setting
    Bart> save-punctuation-mode) (setq dtk-punctuation-mode
    Bart> save-punctuation-mode) (dtk-interp-set-punctuations
    Bart> ,setting)) (dtk-force)))))
    Bart> 
    Bart> 
    Bart> Regards Bart
    Bart> 
    Bart> -----------------------------------------------------------------------------
    Bart> To unsubscribe from the emacspeak list or change your
    Bart> address on the emacspeak list send mail to
    Bart> "emacspeak-request@xxxxxxxxxxx" with a subject of
    Bart> "unsubscribe" or "help".

-- 
Best Regards,
--raman

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help".



If you have questions about this archive or had problems using it, please send mail to:

priestdo@xxxxxxxxxxx No Soliciting!

Emacspeak List Archive | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog