Subject: Emacspeak discussion list
List archive
- From: Parham Doustdar <parham90 AT gmail.com>
- To: Emacspeaks <emacspeak AT emacspeak.net>
- Subject: [Emacspeak] (Patch) Fixing helm mode with Emacspeak
- Date: Sat, 27 Dec 2025 01:09:52 +0100
Hi all,
I have been facing a couple of issues with helm help that I finally got
around to identifying and fixing, patch is at the end of the email.
Basically, there are two issues:
The first is that as you try to navigate around in helm help, Emacspeak keeps
reading the helm help default prompt. So, you hear the main text at the same
time as the notification stream is reading the prompt.
Second issue is that, because Helm has its own command dispatcher in the helm
help mode, the Emacspeak prefix key doesn’t work.
The fix:
1. Emacspeak is advising helm help mode, but the helm help mode-before-hook
is actually being called on a different buffer than the *helm help* buffer.
As a result, when Emacspeak tries to turn off emacspeak-speak-messages,
nothing happens. The right way to do this seems to be to advise the
helm-help-event-loop directly.
2. The read-key advice doesn’t actually take the emacspeak-speak-messages
variable into account when speaking the prompt. As a result, after fixing the
issue above, the prompt still keeps getting spoken when you navigate. To fix
that, I added a simple check to the read-key advice to check for
emacspeak-speak-messages before it speaks.
3. Finally, since this help loop is a custom thing, the Emacspeak prefix key
doesn’t work. So I added our own dispatcher to the helm help keymap.
---
lisp/emacspeak-advice.el | 24 +++++++++++++-----------
lisp/emacspeak-helm.el | 27 +++++++++++++++++++++------
2 files changed, 34 insertions(+), 17 deletions(-)
diff --git a/lisp/emacspeak-advice.el b/lisp/emacspeak-advice.el
index 0a72e7859..a052c6bc5 100644
--- a/lisp/emacspeak-advice.el
+++ b/lisp/emacspeak-advice.el
@@ -936,23 +936,25 @@
(eval
`(defadvice ,f (before emacspeak pre act comp)
"Speak prompt"
+ (when emacspeak-speak-messages
(let ((prompt (ad-get-arg 0)))
(emacspeak-icon 'char)
(setq emacspeak-last-message prompt)
(setq emacspeak-read-char-prompt-cache prompt)
- (tts-with-punctuations 'all (dtk-notify (or prompt "key")))))))
+ (tts-with-punctuations 'all (dtk-notify (or prompt "key"))))))))
(defadvice read-char-choice (before emacspeak pre act comp)
"Speak the prompt. "
- (let* ((prompt (ad-get-arg 0))
- (chars (ad-get-arg 1))
- (m
- (format
- "%s: %s"
- prompt
- (mapconcat #'(lambda (c) (format "%c" c)) chars ", "))))
- (ems--log-message m)
- (tts-with-punctuations 'all (dtk-speak m))))
+ (when emacspeak-speak-messages
+ (let* ((prompt (ad-get-arg 0))
+ (chars (ad-get-arg 1))
+ (m
+ (format
+ "%s: %s"
+ prompt
+ (mapconcat #'(lambda (c) (format "%c" c)) chars ", "))))
+ (ems--log-message m)
+ (tts-with-punctuations 'all (dtk-speak m)))))
;;; advice completion functions to speak:
diff --git a/lisp/emacspeak-helm.el b/lisp/emacspeak-helm.el
index bd9f3274f..f721fe849 100644
--- a/lisp/emacspeak-helm.el
+++ b/lisp/emacspeak-helm.el
@@ -122,19 +122,26 @@
(emacspeak-speak-line)))
;;; Support helm-help
-(add-hook
- 'helm-help-mode-before-hook
- #'(lambda()
- "Turn off speaking read-key prompts"
- (setq emacspeak-speak-messages nil)
- (emacspeak-icon 'open-object)))
-
-(add-hook
- 'helm-help-mode-after-hook
- #'(lambda()
- "restore speaking messages."
- (setq emacspeak-speak-messages t)
- (emacspeak-icon 'close-object)))
+
+(defadvice helm-help-event-loop (around emacspeak pre act comp)
+ "Silence messages during helm help loop."
+ (setq emacspeak-speak-messages nil)
+ (emacspeak-icon 'open-object)
+ (unwind-protect
+ ad-do-it
+ (setq emacspeak-speak-messages t)
+ (emacspeak-icon 'close-object)))
+
+(defun emacspeak-helm-help-dispatch-prefix ()
+ "Dispatch C-e prefix commands in helm help."
+ (interactive)
+ (let* ((key (read-key-sequence-vector (format "%s " (key-description
emacspeak-prefix))))
+ (cmd (lookup-key emacspeak-keymap key)))
+ (when (commandp cmd)
+ (call-interactively cmd))))
+
+(with-eval-after-load 'helm-lib
+ (helm-help-define-key (key-description emacspeak-prefix)
#'emacspeak-helm-help-dispatch-prefix))
(provide 'emacspeak-helm)
;;; end of file
- [Emacspeak] (Patch) Fixing helm mode with Emacspeak, Parham Doustdar, 12/27/2025
- Re: [Emacspeak] (Patch) Fixing helm mode with Emacspeak, Victor Tsaran, 12/27/2025
- Re: [Emacspeak] (Patch) Fixing helm mode with Emacspeak, Tim Cross, 12/27/2025
Archive powered by MHonArc 2.6.19+.