unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* save-excursion or (let ((here (point)))
@ 2009-07-24 12:48 Lennart Borgman
  2009-07-24 19:28 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2009-07-24 12:48 UTC (permalink / raw)
  To: Emacs-Devel devel

I got some problem with flickering when using (let ((here (point))) +
(goto-char here). I am not sure why.

What is the best way to just save the point? Should save-excursion be
used instead or is it perhaps slow?




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

* Re: save-excursion or (let ((here (point)))
  2009-07-24 12:48 save-excursion or (let ((here (point))) Lennart Borgman
@ 2009-07-24 19:28 ` Stefan Monnier
  2009-07-25  0:54   ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2009-07-24 19:28 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

> I got some problem with flickering when using (let ((here (point))) +
> (goto-char here). I am not sure why.

If there's flickering, it means there's redisplay.  You need to figure
out where/when that happens.


        Stefan




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

* Re: save-excursion or (let ((here (point)))
  2009-07-24 19:28 ` Stefan Monnier
@ 2009-07-25  0:54   ` Lennart Borgman
  2009-07-25  2:21     ` Miles Bader
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2009-07-25  0:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs-Devel devel

On Fri, Jul 24, 2009 at 9:28 PM, Stefan Monnier<monnier@iro.umontreal.ca> wrote:
>> I got some problem with flickering when using (let ((here (point))) +
>> (goto-char here). I am not sure why.
>
> If there's flickering, it means there's redisplay.  You need to figure
> out where/when that happens.


Thanks. Sorry. I should have said "I can see the point moving and then
moving back sometimes". I am not sure if that can be avoided and that
is what I want to know.




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

* Re: save-excursion or (let ((here (point)))
  2009-07-25  0:54   ` Lennart Borgman
@ 2009-07-25  2:21     ` Miles Bader
  2009-07-25 10:08       ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Miles Bader @ 2009-07-25  2:21 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Stefan Monnier, Emacs-Devel devel

Lennart Borgman <lennart.borgman@gmail.com> writes:
>> If there's flickering, it means there's redisplay.  You need to figure
>> out where/when that happens.
>
> Thanks. Sorry. I should have said "I can see the point moving and then
> moving back sometimes". I am not sure if that can be avoided and that
> is what I want to know.

That means you're doing redisplay inside the let body; you need to
figure out where/when that happens.

-Miles

-- 
Electricity, n. The cause of all natural phenomena not known to be caused by
something else.




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

* Re: save-excursion or (let ((here (point)))
  2009-07-25  2:21     ` Miles Bader
@ 2009-07-25 10:08       ` Lennart Borgman
  2009-07-25 10:38         ` martin rudalics
  2009-07-25 14:44         ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Lennart Borgman @ 2009-07-25 10:08 UTC (permalink / raw)
  To: Miles Bader; +Cc: Stefan Monnier, Emacs-Devel devel

On Sat, Jul 25, 2009 at 4:21 AM, Miles Bader<miles@gnu.org> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>>> If there's flickering, it means there's redisplay.  You need to figure
>>> out where/when that happens.
>>
>> Thanks. Sorry. I should have said "I can see the point moving and then
>> moving back sometimes". I am not sure if that can be avoided and that
>> is what I want to know.
>
> That means you're doing redisplay inside the let body; you need to
> figure out where/when that happens.


Thanks, but how do I know if a function triggers redisplay?

It looks to me that this might happen while calling `message' when it
displays more than one line, but I am not sure.




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

* Re: save-excursion or (let ((here (point)))
  2009-07-25 10:08       ` Lennart Borgman
@ 2009-07-25 10:38         ` martin rudalics
  2009-07-25 14:44         ` Stefan Monnier
  1 sibling, 0 replies; 8+ messages in thread
From: martin rudalics @ 2009-07-25 10:38 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel, Stefan Monnier, Miles Bader

 > Thanks, but how do I know if a function triggers redisplay?

You could try to bind `inhibit-redisplay' to t around calls and
see whether the flickering goes away.

martin




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

* Re: save-excursion or (let ((here (point)))
  2009-07-25 10:08       ` Lennart Borgman
  2009-07-25 10:38         ` martin rudalics
@ 2009-07-25 14:44         ` Stefan Monnier
  2009-07-26  0:27           ` Lennart Borgman
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2009-07-25 14:44 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel, Miles Bader

> Thanks, but how do I know if a function triggers redisplay?

Very few functions cause redisplay.  The main ones are the ones that
wait (sleep, sit-for, read, ...).


        Stefan




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

* Re: save-excursion or (let ((here (point)))
  2009-07-25 14:44         ` Stefan Monnier
@ 2009-07-26  0:27           ` Lennart Borgman
  0 siblings, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2009-07-26  0:27 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs-Devel devel, Miles Bader

On Sat, Jul 25, 2009 at 4:44 PM, Stefan Monnier<monnier@iro.umontreal.ca> wrote:
>> Thanks, but how do I know if a function triggers redisplay?
>
> Very few functions cause redisplay.  The main ones are the ones that
> wait (sleep, sit-for, read, ...).


Thanks, the problem disappeared. I am not sure why. I don't think any
of the functions above where involved (I don't belive I am calling
them here).

I suspect that it had something to do with either error handling (I
was rewriting some code and the way I do that causes a lot of
errors...) or calling `message' with long lines that does not fit on
one line (these were trace messages used during the rewrite).




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

end of thread, other threads:[~2009-07-26  0:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-24 12:48 save-excursion or (let ((here (point))) Lennart Borgman
2009-07-24 19:28 ` Stefan Monnier
2009-07-25  0:54   ` Lennart Borgman
2009-07-25  2:21     ` Miles Bader
2009-07-25 10:08       ` Lennart Borgman
2009-07-25 10:38         ` martin rudalics
2009-07-25 14:44         ` Stefan Monnier
2009-07-26  0:27           ` Lennart Borgman

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