unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* post-self-insert-hook and last-command:
@ 2012-05-26 23:20 T.V. Raman
  2012-05-27 13:03 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: T.V. Raman @ 2012-05-26 23:20 UTC (permalink / raw)
  To: emacs-devel

I'm trying to use post-self-insert-hook to speak characters as
they are typed in emacspeak --- rather than what I have done for
the last 18 years which was to execute emacspeak's own
emacspeak-self-insert-command.  It all works (almost) -- except
that the speech feedback is called in situations other than  when
the user executes self-insert-command. The usual emacspeak
technique of advising has never worked for this case since
self-insert-command is a builtin.

So to limit the calling of speech feedback to cases of
self-insert-command,
I added a test at the top of my speech feedback function  of the
form
(eq last-command self-insert-command)
but this doesn't work -- since last-command gets apparently gets
set after post-self-insert-hook gets run --- at least that is my
guess based on what I observe:

With post-self-insert-hook set to call speech feedback if
(eq last-command self-insert-command) I  dont hear spoken
feedback for the first invocation of self-insert-command.



-- 

--



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: post-self-insert-hook and last-command:
  2012-05-26 23:20 post-self-insert-hook and last-command: T.V. Raman
@ 2012-05-27 13:03 ` Stefan Monnier
  2012-05-27 14:38   ` T.V. Raman
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2012-05-27 13:03 UTC (permalink / raw)
  To: T.V. Raman; +Cc: emacs-devel

> emacspeak-self-insert-command.  It all works (almost) -- except
> that the speech feedback is called in situations other than  when
> the user executes self-insert-command. The usual emacspeak
> technique of advising has never worked for this case since
> self-insert-command is a builtin.

I wonder which calls to self-insert-command are problematic.

> (eq last-command self-insert-command)

Why last-command rather than this-command?
But note that if you test this-command, you'll miss most of the
electric-foo commands (which don't use post-self-insert-hook but
instead define new commands that then call self-insert-command).


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* post-self-insert-hook and last-command:
  2012-05-27 13:03 ` Stefan Monnier
@ 2012-05-27 14:38   ` T.V. Raman
  0 siblings, 0 replies; 3+ messages in thread
From: T.V. Raman @ 2012-05-27 14:38 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel

Stehane, will try this-command -- not clear which calls cause the
chatter, but with the new code installed, emacs chatters more
than it used to as it loads my .emacs.  Since this is a
substantial change in how emacspeak has done things over 18
years, I suspect it'll take some testing.

The electric commands are already advised to speak, and I'm
leaving those advice fragments in place.
-- 
Best Regards,
--raman

-- 
Best Regards,
--raman


On 5/27/12, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> emacspeak-self-insert-command.  It all works (almost) -- except
>> that the speech feedback is called in situations other than  when
>> the user executes self-insert-command. The usual emacspeak
>> technique of advising has never worked for this case since
>> self-insert-command is a builtin.
>
> I wonder which calls to self-insert-command are problematic.
>
>> (eq last-command self-insert-command)
>
> Why last-command rather than this-command?
> But note that if you test this-command, you'll miss most of the
> electric-foo commands (which don't use post-self-insert-hook but
> instead define new commands that then call self-insert-command).
>
>
>         Stefan
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-27 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-26 23:20 post-self-insert-hook and last-command: T.V. Raman
2012-05-27 13:03 ` Stefan Monnier
2012-05-27 14:38   ` T.V. Raman

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).