From: Mario Lang <mlang@delysid.org>
Subject: Re: temp_echo_area_glyphs and Emacspeak
Date: Fri, 06 Sep 2002 15:24:15 +0200 [thread overview]
Message-ID: <87r8g7jlog.fsf@lexx.delysid.org> (raw)
In-Reply-To: <E17nAJP-0003jn-00@fencepost.gnu.org> (Richard Stallman's message of "Fri, 06 Sep 2002 00:01:39 -0400")
Richard Stallman <rms@gnu.org> 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 <mlang@debian.org>
* 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
next prev parent reply other threads:[~2002-09-06 13:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-05 13:35 temp_echo_area_glyphs and Emacspeak Mario Lang
2002-09-06 4:01 ` Richard Stallman
2002-09-06 13:24 ` Mario Lang [this message]
2002-09-07 3:17 ` Richard Stallman
2002-09-07 13:11 ` Mario Lang
2002-09-09 0:22 ` Richard Stallman
2002-09-06 17:15 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r8g7jlog.fsf@lexx.delysid.org \
--to=mlang@delysid.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).