summaryrefslogtreecommitdiff
path: root/t2a.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2023-09-15 12:56:23 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2023-09-15 12:57:50 -0400
commit6fe3129a11f32078f5622e1321e9e5021eb0f5cc (patch)
treebe4ef5660a9a78110b656301f289b744e48f5b37 /t2a.el
parentdff6b60acb7456422f5e32e2c9a36fda8f077267 (diff)
Miscellanous simplifications and "tightening"scratch/greader
Many of the simplifications result from hoisting `setq` out of ifs or avoiding `setq` altogether. Among the tightening, don't treat hooks as mere "variables holding a list of functions", since they're a bit more complex than that (e.g. can contain a function rather than a list, can have both global and buffer-local functions at the same time, ...). * greader.el (greader--call-functions-after-get-of-sentence): Use `run-hook-wrapped` and simplify. (greader--call-before-finish-functions): Use `run-hook-with-args-until-success`. (greader-change-backend): Consolidate the `seq-local`s outside of the ifs. Use (cadr (memq ...)) to find the "next" item instead of going through index numbers. (greader-read-asynchronous): Simplify the computation of `txt` and `backend` by avoiding `setq`. (greader-action): Assume `greader-backend-action` is non-nil. Use `ignore` rather than `nil` if you want a backend that does nothing :-) (greader-set-language): Simplify by avoiding `setq`. (greader-timer-flag-p, greader-sentence-needs-dehyphenation): η-reduce. (greader-compile-mode): Don't trust the `member` test since hooks aren't just "normal var holding a list". * greader-speechd.el (greader-speechd-set-punctuation): Simplify. Signal an error when `punct` is nil instead of returning `greader-speechd-punctuation` without a preceding "-m". * greader-mac.el: Add missing `Code:` header. (greader-mac-set-voice): Simplify. (greader-mac-forward-sentence): Use `move` arg of `re-search-forward`. (greader-mac-get-sentence): Use `greader-mac-forward-sentence` and eliminate dummy initialization of `sentence-start` that's immediately overwritten by something else. (greader--mac-get-voices): `beginning-of-buffer` is "interactive-only".
Diffstat (limited to 't2a.el')
0 files changed, 0 insertions, 0 deletions