all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mimic the window scrolling behavior of *Messages*
@ 2013-09-17 16:29 Michael Heerdegen
  2013-09-17 19:47 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2013-09-17 16:29 UTC (permalink / raw
  To: emacs-devel

Hi,

another question for my log mode: I want to mimic the window scrolling
behavior of the *Messages* buffer: In any window *Messages* is displayed
where window point is at eob, window point will stay at the buffer end,
and the buffer is scrolled automatically in that window.

How can I adopt that behavior for my own log mode?  Currently, whenever
I insert to my log buffer, I loop over all windows displaying it a
function that moves window point to the buffer end when it was there
before the insertion.  This works in general - but not always.  It
doesn't work for recursive edits.  When I hit M-: foo C-g, for example,
window points are all restored to their values before the M-:.  After
that, the thing doesn't work anymore, because window point is not at eob
anymore.

If I set `window-point-insertion-type' to t, it _does_ work, however.
But I can't set the global value in my package.  Using
`window-point-insertion-type' as a buffer local variable doesn't work,
however, as well as let-binding it.  In my experience,
`window-point-insertion-type' must be t in the current buffer (not in
the log buffer) to get what I want.

I'm thankful for any hints!


Regards,

Michael.




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

* Re: Mimic the window scrolling behavior of *Messages*
  2013-09-17 16:29 Mimic the window scrolling behavior of *Messages* Michael Heerdegen
@ 2013-09-17 19:47 ` Stefan Monnier
  2013-09-18  0:10   ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-09-17 19:47 UTC (permalink / raw
  To: Michael Heerdegen; +Cc: emacs-devel

> If I set `window-point-insertion-type' to t, it _does_ work, however.
> But I can't set the global value in my package.  Using
> `window-point-insertion-type' as a buffer local variable doesn't work,

It should.
But it needs to be set before displaying the buffer.  Could the problem
be that you set the variable after displaying the buffer?


        Stefan



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

* Re: Mimic the window scrolling behavior of *Messages*
  2013-09-17 19:47 ` Stefan Monnier
@ 2013-09-18  0:10   ` Michael Heerdegen
  2013-09-18  1:58     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2013-09-18  0:10 UTC (permalink / raw
  To: emacs-devel

Hi Stefan,

> > If I set `window-point-insertion-type' to t, it _does_ work, however.
> > But I can't set the global value in my package.  Using
> > `window-point-insertion-type' as a buffer local variable doesn't work,
>
> It should.
> But it needs to be set before displaying the buffer.  Could the problem
> be that you set the variable after displaying the buffer?

No, I had set it as a buffer local variable directly after creating the
log buffer.  But only the binding in the buffer of the selected window seems
to count later.  Anyway, I think found a different approach that works
ok now.


Thanks,

Michael.




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

* Re: Mimic the window scrolling behavior of *Messages*
  2013-09-18  0:10   ` Michael Heerdegen
@ 2013-09-18  1:58     ` Stefan Monnier
  2013-09-24 17:46       ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-09-18  1:58 UTC (permalink / raw
  To: Michael Heerdegen; +Cc: emacs-devel

> No, I had set it as a buffer local variable directly after creating the
> log buffer.  But only the binding in the buffer of the selected window seems
> to count later.

That would be a bug.  Please send a recipe to M-x report-emacs-bug.


        Stefan



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

* Re: Mimic the window scrolling behavior of *Messages*
  2013-09-18  1:58     ` Stefan Monnier
@ 2013-09-24 17:46       ` Michael Heerdegen
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2013-09-24 17:46 UTC (permalink / raw
  To: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > No, I had set it as a buffer local variable directly after creating the
> > log buffer.  But only the binding in the buffer of the selected
> > window seems
> > to count later.
>
> That would be a bug.  Please send a recipe to M-x report-emacs-bug.

Done: 15457.  Please join the discussion.


Thanks,

Michael.




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

end of thread, other threads:[~2013-09-24 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 16:29 Mimic the window scrolling behavior of *Messages* Michael Heerdegen
2013-09-17 19:47 ` Stefan Monnier
2013-09-18  0:10   ` Michael Heerdegen
2013-09-18  1:58     ` Stefan Monnier
2013-09-24 17:46       ` Michael Heerdegen

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.