all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: "T.V Raman" <raman@google.com>
Cc: emacs-devel <emacs-devel@gnu.org>, emacspeak@emacspeak.org
Subject: Re: eldoc errors in elisp
Date: Sun, 23 Apr 2023 13:14:05 +0100	[thread overview]
Message-ID: <CALDnm50mz18WHt-p1vkCp5HmRxrNt6pz=MEo_eY8itAiq3o-Dw@mail.gmail.com> (raw)
In-Reply-To: <CALDnm52PeM-nZ=Qiy+mK8b_H1HPRO4YAnesaR+6ppu2y2OgZ6A@mail.gmail.com>

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	other threads:[~2023-04-23 12:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22 15:33 eldoc errors in elisp T.V Raman
2023-04-22 16:20 ` João Távora
2023-04-22 16:37   ` T.V Raman
2023-04-22 17:45     ` João Távora
2023-04-22 18:13       ` T.V Raman via Emacspeak
2023-04-22 21:25         ` João Távora
2023-04-23  2:43           ` T.V Raman via Emacspeak
2023-04-23 10:28             ` João Távora
2023-04-23 12:14               ` João Távora [this message]
2023-04-23 14:26               ` T.V Raman via Emacspeak
2023-04-23 14:35                 ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALDnm50mz18WHt-p1vkCp5HmRxrNt6pz=MEo_eY8itAiq3o-Dw@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacspeak@emacspeak.org \
    --cc=raman@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.