Skip to content

Commit

Permalink
Fix spelling not working in speech output
Browse files Browse the repository at this point in the history
The problem with spelling is that SSIP doesn't allow setting it inside blocks.
speechd-out-text always wraps the text and a contingent attached icon by an
outer block, which effectively prohibits spelling (and other parameters not
allowed in SSIP blocks) from being set.

Let's use the outer block only if there is an icon.  This is not a complete fix,
texts with attached icons still aren't spelled, but it's the easiest fix for
now.  A complete fix would be much more complicated.
  • Loading branch information
mz-pdm committed May 7, 2024
1 parent 64218c5 commit c808657
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions speechd-out.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; speechd-out.el --- Alternative output interface -*- lexical-binding: t -*-

;; Copyright (C) 2018-2021 Milan Zamazal <pdm@zamazal.org>
;; Copyright (C) 2018-2024 Milan Zamazal <pdm@zamazal.org>
;; Copyright (C) 2004, 2005, 2006, 2008 Brailcom, o.p.s.

;; Author: Milan Zamazal <pdm@brailcom.org>
Expand Down Expand Up @@ -207,10 +207,13 @@
(text% text)
(cursor% cursor)
(markers% markers))
(speechd.block driver (lambda ()
(when icon-name%
(speechd.icon driver% icon-name%))
(speechd.text driver% text% cursor% markers%)))))))
;; Some parameters, e.g. spelling, cannot be set inside blocks;
;; use a block only if necessary.
(if icon-name%
(speechd.block driver (lambda ()
(speechd.icon driver% icon-name%)
(speechd.text driver% text% cursor% markers%)))
(speechd.text driver% text% cursor% markers%))))))

(defun speechd-out-set (parameter value)
(speechd-out--loop-drivers (driver)
Expand Down

0 comments on commit c808657

Please sign in to comment.