all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is there an after-move-functions hook?
@ 2002-10-29  9:04 Alan Mackenzie
  2002-10-29 10:40 ` John Paul Wallington
  2002-10-29 19:57 ` Peter Milliken
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Mackenzie @ 2002-10-29  9:04 UTC (permalink / raw)


i.e., something like after-changed-functions, but called each time point
is move?

My answer to the next question is this:  Suppose the user is typing in a
string, and has got this far:

"start of string
                ^
                |
              point

Should he move point away from the string without typing the terminating
", I would like to splash font-lock-warning-font all over the string.  As
soon as point comes back into the string, I would restore it to the
normal restful tasteful font-lock-string-font.

Alternatively, is there any other elisp programming trick which would
achieve this for me?

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: Is there an after-move-functions hook?
  2002-10-29  9:04 Is there an after-move-functions hook? Alan Mackenzie
@ 2002-10-29 10:40 ` John Paul Wallington
  2002-10-30 18:36   ` Alan Mackenzie
  2002-10-29 19:57 ` Peter Milliken
  1 sibling, 1 reply; 4+ messages in thread
From: John Paul Wallington @ 2002-10-29 10:40 UTC (permalink / raw)


Alan Mackenzie<none@example.invalid> wrote:

> i.e., something like after-changed-functions, but called each time point
> is move?

Have you considered the `point-entered' and `point-left' special text
properties?

-- 
John Paul Wallington

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

* Re: Is there an after-move-functions hook?
  2002-10-29  9:04 Is there an after-move-functions hook? Alan Mackenzie
  2002-10-29 10:40 ` John Paul Wallington
@ 2002-10-29 19:57 ` Peter Milliken
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Milliken @ 2002-10-29 19:57 UTC (permalink / raw)


Have a look at the pre-command-hook and post-command-hook. Movement of point
is directed by "commands", after all :-)

Peter

"Alan Mackenzie" <none@example.invalid> wrote in message
news:uuilpa.r5.ln@acm.acm...
> i.e., something like after-changed-functions, but called each time point
> is move?
>
> My answer to the next question is this:  Suppose the user is typing in a
> string, and has got this far:
>
> "start of string
>                 ^
>                 |
>               point
>
> Should he move point away from the string without typing the terminating
> ", I would like to splash font-lock-warning-font all over the string.  As
> soon as point comes back into the string, I would restore it to the
> normal restful tasteful font-lock-string-font.
>
> Alternatively, is there any other elisp programming trick which would
> achieve this for me?
>
> --
> Alan Mackenzie (Munich, Germany)
> Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
> (like "aa"), remove half of them (leaving, say, "a").
>

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

* Re: Is there an after-move-functions hook?
  2002-10-29 10:40 ` John Paul Wallington
@ 2002-10-30 18:36   ` Alan Mackenzie
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Mackenzie @ 2002-10-30 18:36 UTC (permalink / raw)


John Paul Wallington <jpw@shootybangbang.com> wrote on Tue, 29 Oct 2002
10:40:24 +0000:
> Alan Mackenzie<none@example.invalid> wrote:

>> i.e., something like after-changed-functions, but called each time point
>> is move?

> Have you considered the `point-entered' and `point-left' special text
> properties?

I did, and rejected them.  After all, point might be getting moved from
one open string (hey, how about that for terminology? :-) and another,
the properties would be the same, so nothing would get called.  Ha!

I've just had another look at the info page.  It was too subtle for me at
first reading.  It looks like _exactly_ what I need.  On each open string
I make point-entered 'restore-this-string-to-polite-fontification and
point-left 'put-horrible-garish-warning-font-on-this-string.

Now I'll just have a quick check that the other Emacs supports this too,
and it's as good as implemented.

Many thanks!

> -- 
> John Paul Wallington

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

end of thread, other threads:[~2002-10-30 18:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-29  9:04 Is there an after-move-functions hook? Alan Mackenzie
2002-10-29 10:40 ` John Paul Wallington
2002-10-30 18:36   ` Alan Mackenzie
2002-10-29 19:57 ` Peter Milliken

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.