Gnus development mailing list
 help / color / mirror / Atom feed
* hook to set point in article buffer?
@ 1998-03-25 11:02 jari.aalto
  1998-03-26 14:51 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: jari.aalto @ 1998-03-25 11:02 UTC (permalink / raw)



    Hi,

    What hook should I use to position the point in article buffer?
    I have some automated messages that are sent to me and I'd
    like to position point to "error message" when I select the 
    article

    I looked briefly the *article* hooks, but there seem to be 
    run inside save-excursion and that means...you know.

    jari


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

* Re: hook to set point in article buffer?
  1998-03-25 11:02 hook to set point in article buffer? jari.aalto
@ 1998-03-26 14:51 ` Lars Magne Ingebrigtsen
       [not found]   ` <6f4t0l8ngp.fsf@bavur.dna.lth.se>
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-26 14:51 UTC (permalink / raw)


<jari.aalto@poboxes.com> writes:

> What hook should I use to position the point in article buffer?
> I have some automated messages that are sent to me and I'd
> like to position point to "error message" when I select the 
> article
> 
> I looked briefly the *article* hooks, but there seem to be 
> run inside save-excursion and that means...you know.

Yes, that means that you should use `set-window-point', we know. 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: hook to set point in article buffer?
       [not found]   ` <6f4t0l8ngp.fsf@bavur.dna.lth.se>
@ 1998-03-26 17:07     ` Lars Magne Ingebrigtsen
  1998-03-27 12:37       ` jari.aalto
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-26 17:07 UTC (permalink / raw)


Kurt Swanson <ksw@dna.lth.se> writes:

> > Yes, that means that you should use `set-window-point', we know. 
> 
> That still won't work within a save-excursion, you know.

I take it you have tried?

Here's two examples:

(save-excursion
  (set-buffer (get-buffer "*Help*"))
  (set-window-point (get-buffer-window (current-buffer)) (point-max)))

(save-excursion
  (set-buffer (get-buffer "*Help*"))
  (goto-char (point-max)))

(It helps if you have point at point-min in the *Help* buffer (and
that it exists, of course.)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: hook to set point in article buffer?
  1998-03-26 17:07     ` Lars Magne Ingebrigtsen
@ 1998-03-27 12:37       ` jari.aalto
  0 siblings, 0 replies; 4+ messages in thread
From: jari.aalto @ 1998-03-27 12:37 UTC (permalink / raw)


| 98-03-26 "EXT Lars Magne Ingebrigtsen" <larsi@gnus.org> list.ding
|   (set-window-point (get-buffer-window (current-buffer)) (point-max))

I tried putting this anywhere I could think of

        gnus-article-prepare-hook
        gnus-select-article-hook
        gnus-article-display-hook

And I verified that point moved when the hook run at that point 
but when the article display was completed, the point was always
at point-min. Next I looked what was going on and did

    (defadvice gnus-article-set-window-start  (around my  act)
      "Disable function so that point can be set in buffer.")

and now the point can be changed with set-window-point in
gnus-select-article-hook. Please tell if there is another way
without the advice code.

jari



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

end of thread, other threads:[~1998-03-27 12:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-25 11:02 hook to set point in article buffer? jari.aalto
1998-03-26 14:51 ` Lars Magne Ingebrigtsen
     [not found]   ` <6f4t0l8ngp.fsf@bavur.dna.lth.se>
1998-03-26 17:07     ` Lars Magne Ingebrigtsen
1998-03-27 12:37       ` jari.aalto

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 NNTP newsgroup(s).