emacs-devel
[Top][All Lists]
Advanced

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

Re: eldoc errors in elisp


From: João Távora
Subject: Re: eldoc errors in elisp
Date: Sun, 23 Apr 2023 13:14:05 +0100

On Sun, Apr 23, 2023 at 11:28 AM João Távora <joaotavora@gmail.com> wrote:
>
> On Sun, Apr 23, 2023, 03:43 T.V Raman <raman@google.com> wrote:
>>
>> Awesome, will rewrite once I hear back.

OK Raman, try this 100% guaranteed untested version:

(defvar emacspeak--last-docs nil
  "Last docs considered in `emacspeak-speak-eldoc'.")

(defun emacspeak-speak-eldoc (docs interactive)
  "Speak eldoc.  Intended for `eldoc-display-functions'."
  (with-current-buffer (get-buffer-create " *emacspeak-eldoc*")
    (erase-buffer)
    (insert (mapconcat #'car docs "\n"))
    (unless (equal docs emacspeak--last-docs)
      (emacspeak-auditory-icon 'doc))
    (when interactive (dtk-speak (buffer-string))))
  (setq emacspeak--last-docs docs))


The main difference to your version is that it doesn't rely on
eldoc-display-in-doc-buffer being also a member of
`eldoc-display-functions'.  Not only is this more future-proof
it also means that that other eminently visual display could,
if you so wanted, be completely discarded in favor or the auditory
one (if you or the user so wishes).

João



reply via email to

[Prev in Thread] Current Thread [Next in Thread]