emacs-devel
[Top][All Lists]
Advanced

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

Request: Use message instead of message_with_string for user visible out


From: T.V. Raman
Subject: Request: Use message instead of message_with_string for user visible output?
Date: Sun, 27 Oct 2013 15:07:05 -0700

I've advised self-insert-command to produce auditory output for
read-only cases.

Note that once upon a time (see emacspeak code base)  emacspeak
actually replaced self-insert-command with its own
implementation.  In newer versions, I dont do that  any more
because I can use  the relevant post hook; however, that also
lost us the auditory feedback when the buffer is read-only or
when the text has read-only property set.  My personal preference
would be to not  to muck with command-error-function -- I played
with it a bit last week -- it feels like too heavy a hammer, and
at the end of the day might also produce too much output.

Note that emacs packages are in general not well-disciplined with
when they call error vs signal -- and often use error or signal
to provide user-feedback e.g. emacs itself when you hit
end-of-buffer -- or the VM  mail reader when you hit end-of-folder.

-- 
Best Regards,
--raman


On 10/26/13, Dmitri Paduchikh <address@hidden> wrote:
> T.V. Raman wrote:
>
>> Some useful hooks to add:
>
> [...]
>
>> 2. A pre-insert hook on self-insert-command -- right now I cant tell
>> from the emacspeak end when self-insert-command bales out because
>> the current context is read-only.
>
> Just for the record, I have proposed on the Emacspeak list to use
> command-error-function for speaking read-only errors. It seems to work
> well with self-insert-command and other such cases.
>
> For speaking undefined keys there is a solution using a little trickery
> from ring-bell-function:
>
> (defun my-speak-echo-area ()
>   (let ((msg (current-message)))
>     (if (> (length msg) 0)
>       (dtk-speak msg))))
>
> (setq ring-bell-function
>       (lambda ()
>       (dtk-stop)
>       (emacspeak-auditory-icon 'warn-user)
>       (if (eq this-command nil)
>           (run-with-idle-timer 0 nil 'my-speak-echo-area))))
>
> Of course, it would be nice if some uniform solution existed.
>
> --
> With best regards
> Dmitri Paduchikh
>



reply via email to

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