From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "T.V. Raman" Newsgroups: gmane.emacs.devel Subject: Request: Use message instead of message_with_string for user visible output? Date: Sun, 27 Oct 2013 15:07:05 -0700 Message-ID: References: <83wql0f1ej.fsf@gnu.org> <87ob6byfug.fsf@dpaduchikh.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1382911626 6642 80.91.229.3 (27 Oct 2013 22:07:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Oct 2013 22:07:06 +0000 (UTC) To: Dmitri Paduchikh , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 27 23:07:11 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VaYUJ-0006oP-56 for ged-emacs-devel@m.gmane.org; Sun, 27 Oct 2013 23:07:11 +0100 Original-Received: from localhost ([::1]:39205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaYUI-0007WC-Js for ged-emacs-devel@m.gmane.org; Sun, 27 Oct 2013 18:07:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaYUF-0007W5-KZ for emacs-devel@gnu.org; Sun, 27 Oct 2013 18:07:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaYUE-0006ee-Iq for emacs-devel@gnu.org; Sun, 27 Oct 2013 18:07:07 -0400 Original-Received: from mail-qa0-x22b.google.com ([2607:f8b0:400d:c00::22b]:50241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaYUE-0006eW-Dy for emacs-devel@gnu.org; Sun, 27 Oct 2013 18:07:06 -0400 Original-Received: by mail-qa0-f43.google.com with SMTP id i13so1705945qae.16 for ; Sun, 27 Oct 2013 15:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=W8WVuL8Gwdd8+BNyX9qhM/2eQ6vAzqs1Kv0Wy7Kpvtw=; b=bhXbVkfXmlzAKOf1dK+hPilqimsF6yCdVYxuPgZbUFp8hE203Epfiir3+CKjhYgtXl agKodBiNnstvnHa+BvxuhCkx5/259gwKsiPzk00ZVuZQaiDQ8+ldzAx6SqlZwNIGWD54 bQlevGz3xihmkM4o6Vrq2Di/O0liT1UiRWHsrIM7BRWzzbn1pEOqrIQ8a4JS7m3/ZSwM 2eSYSpKn2p4sOp0/jqjjXzPl7vYM3p/m0+pu07C1QpggbTya5FXGDZBfZiK1AQF9DIU2 b5P2I96VrFL5+CaFRgTyQfLEwThX8vrVO6tLWPqJF3Hk2nI0/McOzRhPpc9tPeeZaKKM QZrQ== X-Received: by 10.49.131.200 with SMTP id oo8mr25834045qeb.0.1382911626052; Sun, 27 Oct 2013 15:07:06 -0700 (PDT) Original-Received: by 10.229.171.135 with HTTP; Sun, 27 Oct 2013 15:07:05 -0700 (PDT) In-Reply-To: <87ob6byfug.fsf@dpaduchikh.invalid> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164586 Archived-At: 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 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 >