From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Re: temp_echo_area_glyphs and Emacspeak Date: Fri, 06 Sep 2002 15:24:15 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <87r8g7jlog.fsf@lexx.delysid.org> References: <87vg5klftd.fsf@lexx.delysid.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1031318718 25503 127.0.0.1 (6 Sep 2002 13:25:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2002 13:25:18 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17nJ6q-0006d5-00 for ; Fri, 06 Sep 2002 15:25:16 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17nJh1-0000Ke-00 for ; Fri, 06 Sep 2002 16:02:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17nJ8T-00004r-00; Fri, 06 Sep 2002 09:26:57 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17nJ5z-0008OA-00 for emacs-devel@gnu.org; Fri, 06 Sep 2002 09:24:23 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17nJ5w-0008Ny-00 for emacs-devel@gnu.org; Fri, 06 Sep 2002 09:24:22 -0400 Original-Received: from tk212017102236.teleweb.at ([212.17.102.236] helo=lexx.delysid.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17nJ5w-0008Nu-00 for emacs-devel@gnu.org; Fri, 06 Sep 2002 09:24:20 -0400 Original-Received: from mlang by lexx.delysid.org with local (Exim 3.35 #1 (Debian)) id 17nJ5s-0004tk-00 for ; Fri, 06 Sep 2002 15:24:16 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: (Richard Stallman's message of "Fri, 06 Sep 2002 00:01:39 -0400") Original-Lines: 102 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:7623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:7623 Richard Stallman writes: > Would it be a problem to introduce a new hook > which gets called with the STRING everytime temp_echo_area_glyphs is > called from C? > > Ok. Could you write it? I did that now. It's my first C-level modification of Emacs, so I'd like to receive comments. I tested it using a simple lambda on the hook, and it appears to work fine. (question: What does the Q prefix mean? V means var, but Q?) (the patch is below) If it is OK that way, could someone please apply it? > How should such a hook be named? echo-area-hook? > > That name implies something more general--it gives people the wrong > idea. How about temp-echo-area-message-hook? OK, I named it that way. > How does Emacspeak find out about ordinary calls to `message'? It uses defadvice. (defadvice message (around emacspeak pre act) ...) Indeed, it would be nice if we also had a message-hook. ChangeLog: 2002-09-06 Mario Lang * minibuf.c: New hook temp-echo-area-message-hook. (Qtemp_echo_area_message_hook, Vtemp_echo_area_message_hook) (temp_echo_area_glyphs): Call it. Index: minibuf.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/minibuf.c,v retrieving revision 1.249 diff -u -r1.249 minibuf.c --- minibuf.c 13 Aug 2002 22:52:05 -0000 1.249 +++ minibuf.c 6 Sep 2002 12:37:06 -0000 @@ -102,6 +102,8 @@ Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; Lisp_Object Qminibuffer_exit_hook, Vminibuffer_exit_hook; +Lisp_Object Qtemp_echo_area_message_hook, Vtemp_echo_area_message_hook; + /* Function to call to read a buffer name. */ Lisp_Object Vread_buffer_function; @@ -2389,11 +2391,17 @@ int opoint = PT; int opoint_byte = PT_BYTE; Lisp_Object oinhibit; + Lisp_Object args[2]; + + args[0] = Qtemp_echo_area_message_hook; + args[1] = build_string(m); + oinhibit = Vinhibit_quit; /* Clear out any old echo-area message to make way for our new thing. */ message (0); + Frun_hook_with_args (2, args); SET_PT_BOTH (osize, osize_byte); insert_string (m); SET_PT_BOTH (opoint, opoint_byte); @@ -2476,6 +2484,9 @@ Qminibuffer_exit_hook = intern ("minibuffer-exit-hook"); staticpro (&Qminibuffer_exit_hook); + Qtemp_echo_area_message_hook = intern ("temp-echo-area-message-hook"); + staticpro (&Qtemp_echo_area_message_hook); + Qhistory_length = intern ("history-length"); staticpro (&Qhistory_length); @@ -2496,6 +2507,11 @@ DEFVAR_LISP ("minibuffer-exit-hook", &Vminibuffer_exit_hook, doc: /* Normal hook run just after exit from minibuffer. */); Vminibuffer_exit_hook = Qnil; + + DEFVAR_LISP ("temp-echo-area-message-hook", &Vtemp_echo_area_message_hook, + doc: /* Normal hook run with temp-echo-area-message +as argument. */); + Vtemp_echo_area_message_hook = Qnil; DEFVAR_LISP ("history-length", &Vhistory_length, doc: /* *Maximum length for history lists before truncation takes place. -- CYa, Mario