all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* hook into window's content flux?
@ 2006-04-03 19:43 Joe Corneli
  2006-04-04 16:42 ` Kevin Rodgers
  2006-04-05  1:12 ` Joe Corneli
  0 siblings, 2 replies; 9+ messages in thread
From: Joe Corneli @ 2006-04-03 19:43 UTC (permalink / raw)


I'd like to run a function to examine the contexts that are being
displayed in my Emacs windows, whenever these change.  I'm
particularly interested in content changes related to scrolling; when
I press next-line or scroll-up, etc., the window's content changes
even though the buffer is not modified.

There are two things I think I think I'll need to know to achieve this.

1. Are there any hooks I can add to that run when the window's content
   changes?

2. Are there variables that indicate the beginning and end positions
   of the string that is being displayed on the screen?

Additional motion-dependent question, extending 1, is: are there hooks
I can run when the cursor changes position (whether or not the
window's content changes)?

These questions relate to my work on the Arxana hypertext system for
Emacs, 

http://lists.gnu.org/archive/html/gnu-emacs-sources/2006-03/msg00017.html

and particularly to the problem of contextual display of annotations.

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

* hook into window's content flux?
@ 2006-04-04 13:50 Joe Corneli
  2006-04-04 18:38 ` Eli Zaretskii
  2006-04-04 20:22 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Joe Corneli @ 2006-04-04 13:50 UTC (permalink / raw)



(This is a copy of a message I posted to help-gnu-emacs@gnu.org
yesterday, haven't heard back yet.  Anyone?)

I'd like to run a function to examine the contexts that are being
displayed in my Emacs windows, whenever these change.  I'm
particularly interested in content changes related to scrolling; when
I press next-line or scroll-up, etc., the window's content changes
even though the buffer is not modified.

There are two things I think I think I'll need to know to achieve this.

1. Are there any hooks I can add to that run when the window's content
   changes?

2. Are there variables that indicate the beginning and end positions
   of the string that is being displayed on the screen?

Additional motion-dependent question, extending 1, is: are there hooks
I can run when the cursor changes position (whether or not the
window's content changes)?

These questions relate to my work on the Arxana hypertext system for
Emacs, 

http://lists.gnu.org/archive/html/gnu-emacs-sources/2006-03/msg00017.html

and particularly to the problem of contextual display of annotations.

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

* Re: hook into window's content flux?
  2006-04-03 19:43 Joe Corneli
@ 2006-04-04 16:42 ` Kevin Rodgers
  2006-04-05  0:48   ` Joe Corneli
  2006-04-05  1:12 ` Joe Corneli
  1 sibling, 1 reply; 9+ messages in thread
From: Kevin Rodgers @ 2006-04-04 16:42 UTC (permalink / raw)


Joe Corneli wrote:
> 2. Are there variables that indicate the beginning and end positions
>    of the string that is being displayed on the screen?

See the Window Start node of the Emacs Lisp manual, which describes the
window-start and window-end functions.

-- 
Kevin Rodgers

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

* Re: hook into window's content flux?
  2006-04-04 13:50 hook into window's content flux? Joe Corneli
@ 2006-04-04 18:38 ` Eli Zaretskii
  2006-04-04 20:22 ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2006-04-04 18:38 UTC (permalink / raw)
  Cc: emacs-devel

> From: Joe Corneli <jcorneli@planetmath.org>
> Date: Tue,  4 Apr 2006 09:50:12 -0400 (EDT)
> 
> I'd like to run a function to examine the contexts that are being
> displayed in my Emacs windows, whenever these change.  I'm
> particularly interested in content changes related to scrolling; when
> I press next-line or scroll-up, etc., the window's content changes
> even though the buffer is not modified.
> 
> There are two things I think I think I'll need to know to achieve this.
> 
> 1. Are there any hooks I can add to that run when the window's content
>    changes?

Did you try looking in the ELisp manual?  It has a node called "Window
hooks" that describes some likely candidates.

> 2. Are there variables that indicate the beginning and end positions
>    of the string that is being displayed on the screen?

Did you try the manual?  It describes (in the node "Window Start") two
functions called `window-start' and `window-end' that sound like what
you are looking for.

> Additional motion-dependent question, extending 1, is: are there hooks
> I can run when the cursor changes position (whether or not the
> window's content changes)?

The usual way to accomplish this is to put `point-entered' and
`point-left' text properties on regions of text that you want to be
cursor-sensitive.  See the node "Special Properties" in the ELisp
manual.

Since the answers to your questions are readily available in the
manual, could you please tell why you didn't find them?  Perhaps
indexing Needs Work (tm) (assuming you did try to find the relevant
information using the index search).

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

* Re: hook into window's content flux?
  2006-04-04 13:50 hook into window's content flux? Joe Corneli
  2006-04-04 18:38 ` Eli Zaretskii
@ 2006-04-04 20:22 ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2006-04-04 20:22 UTC (permalink / raw)
  Cc: emacs-devel

> I'd like to run a function to examine the contexts that are being
> displayed in my Emacs windows, whenever these change.  I'm
> particularly interested in content changes related to scrolling; when
> I press next-line or scroll-up, etc., the window's content changes
> even though the buffer is not modified.

- window-scroll-functions (when a window's starting pos changes)
- fontification-functions (when a piece of text needs to be displayed)
- before/after-change-functions (when a piece of text is modified)
- window-start and window-end
- pre/post-command-hook (run before/after each command, so you can detect
  cursor motion)


        Stefan

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

* Re: hook into window's content flux?
  2006-04-04 16:42 ` Kevin Rodgers
@ 2006-04-05  0:48   ` Joe Corneli
  2006-04-05  1:13     ` Joe Corneli
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Corneli @ 2006-04-05  0:48 UTC (permalink / raw)



   > 2. Are there variables that indicate the beginning and end positions
   >    of the string that is being displayed on the screen?

   See the Window Start node of the Emacs Lisp manual, which describes the
   window-start and window-end functions.

Thanks!  Any thoughts on 1.!?

   1. Are there any hooks I can add to that run when the window's content
      changes?

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

* Re: hook into window's content flux?
  2006-04-03 19:43 Joe Corneli
  2006-04-04 16:42 ` Kevin Rodgers
@ 2006-04-05  1:12 ` Joe Corneli
  2006-04-05  3:37   ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Joe Corneli @ 2006-04-05  1:12 UTC (permalink / raw)


Thanks for your help gents.

PS. Eli - I did look at the manual's index, or at least part of it;
the text associated with "Windows" is "Manipulating windows and
displaying buffers."  I wasn't concerned about manipulating windows or
displaying buffers, so I gave up at that point.  If the string had
been "Pretty much everything related to windows" I would have delved
deeper.  I'm afraid I'm not very good at thinking hierarchically.  I
should probably have the whole detailed node listing printed out in a
giant font or something like that.

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

* Re: hook into window's content flux?
  2006-04-05  0:48   ` Joe Corneli
@ 2006-04-05  1:13     ` Joe Corneli
  0 siblings, 0 replies; 9+ messages in thread
From: Joe Corneli @ 2006-04-05  1:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

Actually I've been helped by emacs-devel, problem solved.

   From: Joe Corneli <jcorneli@planetmath.org>
   Date: Tue,  4 Apr 2006 20:48:10 -0400 (EDT)


      > 2. Are there variables that indicate the beginning and end positions
      >    of the string that is being displayed on the screen?

      See the Window Start node of the Emacs Lisp manual, which describes the
      window-start and window-end functions.

   Thanks!  Any thoughts on 1.!?

      1. Are there any hooks I can add to that run when the window's content
         changes?

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

* Re: hook into window's content flux?
  2006-04-05  1:12 ` Joe Corneli
@ 2006-04-05  3:37   ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2006-04-05  3:37 UTC (permalink / raw)
  Cc: emacs-devel

> From: Joe Corneli <jcorneli@planetmath.org>
> Date: Tue,  4 Apr 2006 21:12:17 -0400 (EDT)
> 
> PS. Eli - I did look at the manual's index, or at least part of it;
> the text associated with "Windows" is "Manipulating windows and
> displaying buffers."  I wasn't concerned about manipulating windows or
> displaying buffers, so I gave up at that point.  If the string had
> been "Pretty much everything related to windows" I would have delved
> deeper.  I'm afraid I'm not very good at thinking hierarchically.  I
> should probably have the whole detailed node listing printed out in a
> giant font or something like that.

No, that's not the best way of looking up information in the manual.
The best way is through the `i' command, which searches the index
entries.  It prompts you for a string, where you should type a word or
a partial phrase that to you sound relevant to the issue you are
looking for.  Since you specifically asked about hooks, typing "hooks"
there would be a good start.

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

end of thread, other threads:[~2006-04-05  3:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-04 13:50 hook into window's content flux? Joe Corneli
2006-04-04 18:38 ` Eli Zaretskii
2006-04-04 20:22 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2006-04-03 19:43 Joe Corneli
2006-04-04 16:42 ` Kevin Rodgers
2006-04-05  0:48   ` Joe Corneli
2006-04-05  1:13     ` Joe Corneli
2006-04-05  1:12 ` Joe Corneli
2006-04-05  3:37   ` Eli Zaretskii

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.