all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 23.0.60; doc-view: occasionally stuck at welcome screen
@ 2008-04-15 16:26 Markus Triska
  2008-04-16  6:25 ` Tassilo Horn
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Triska @ 2008-04-15 16:26 UTC (permalink / raw)
  To: emacs-pretest-bug


When I do M-x doc-view-clear-cache, and then:

   $ emacs -Q file.pdf

doc-view correctly displays the file (for example, with:
http://www.logic.at/prolog/testqueens.pdf ). If I quit, and again

   $ emacs -Q file.pdf

then doc-view is stuck at the welcome screen. (When I press "C-c" four
times, it displays the document.) When I do M-x doc-view-clear-cache,
I can again view the document with "emacs -Q file.pdf", but it fails
on every later attempt ("emacs -Q..."), until I clear the cache again.


In GNU Emacs 23.0.60.2 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9)
 of 2008-04-15 on mt-computer.local
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000
configured using `configure  '--disable-font-backend''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t





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

* Re: 23.0.60; doc-view: occasionally stuck at welcome screen
  2008-04-15 16:26 23.0.60; doc-view: occasionally stuck at welcome screen Markus Triska
@ 2008-04-16  6:25 ` Tassilo Horn
  2008-04-16 14:04   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Tassilo Horn @ 2008-04-16  6:25 UTC (permalink / raw)
  To: emacs-devel

Markus Triska <markus.triska@gmx.at> writes:

> When I do M-x doc-view-clear-cache, and then:
>
>    $ emacs -Q file.pdf
>
> doc-view correctly displays the file (for example, with:
> http://www.logic.at/prolog/testqueens.pdf ). If I quit, and again
>
>    $ emacs -Q file.pdf
>
> then doc-view is stuck at the welcome screen. (When I press "C-c" four
> times, it displays the document.)

I can reproduce that.  Hitting PageDown on the welcome screen is a
woraround, too.

> When I do M-x doc-view-clear-cache, I can again view the document with
> "emacs -Q file.pdf", but it fails on every later attempt ("emacs
> -Q..."), until I clear the cache again.

I've located the source of the problem.  In doc-view-display the

  (dolist (win (get-buffer-window-list buffer nil t)) ...)

doesn't iterate over any windows, e.g. get-buffer-window-list returns
nil.  I don't know why.  Maybe the with-current-buffer form shadows the
buffer-window association?

The caller is doc-view-initiate-display and the problem occurs when a
doc is already converted and thus the cached png files are used.  Then
the call is

  (doc-view-display (current-buffer) 'force)

Since the current buffer (which shows the welcome screen) in visible,
get-buffer-window-list should return that window...

Bye,
Tassilo




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

* Re: 23.0.60; doc-view: occasionally stuck at welcome screen
  2008-04-16  6:25 ` Tassilo Horn
@ 2008-04-16 14:04   ` Stefan Monnier
  2008-04-21  5:36     ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2008-04-16 14:04 UTC (permalink / raw)
  To: emacs-devel

>> When I do M-x doc-view-clear-cache, and then:
>> 
>> $ emacs -Q file.pdf
>> 
>> doc-view correctly displays the file (for example, with:
>> http://www.logic.at/prolog/testqueens.pdf ). If I quit, and again
>> 
>> $ emacs -Q file.pdf
>> 
>> then doc-view is stuck at the welcome screen. (When I press "C-c" four
>> times, it displays the document.)

> I can reproduce that.  Hitting PageDown on the welcome screen is a
> woraround, too.

>> When I do M-x doc-view-clear-cache, I can again view the document with
>> "emacs -Q file.pdf", but it fails on every later attempt ("emacs
>> -Q..."), until I clear the cache again.

> I've located the source of the problem.  In doc-view-display the
>   (dolist (win (get-buffer-window-list buffer nil t)) ...)
> doesn't iterate over any windows, e.g. get-buffer-window-list returns nil.

Is it run before `buffer' is shown in a window, maybe?

> I don't know why.  Maybe the with-current-buffer form shadows the
> buffer-window association?

No, with-current-buffer (i.e. set-buffer) should never affect the output
of get-buffer-window-list.

> The caller is doc-view-initiate-display and the problem occurs when a
> doc is already converted and thus the cached png files are used.  Then
> the call is

>   (doc-view-display (current-buffer) 'force)

> Since the current buffer (which shows the welcome screen) in visible,
> get-buffer-window-list should return that window...

Hmmm....


        Stefan




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

* Re: 23.0.60; doc-view: occasionally stuck at welcome screen
  2008-04-16 14:04   ` Stefan Monnier
@ 2008-04-21  5:36     ` Chong Yidong
  2008-04-29  0:00       ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2008-04-21  5:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

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

>> I've located the source of the problem.  In doc-view-display the
>>   (dolist (win (get-buffer-window-list buffer nil t)) ...)
>> doesn't iterate over any windows, e.g. get-buffer-window-list returns nil.
>
> Is it run before `buffer' is shown in a window, maybe?

I think what's happening is that doc-view-mode is being run during file
autodetection, before the selected window switches to the doc-view
buffer.  Thus, (window-buffer (selected-window)) is not equal to
(current-buffer).

Maybe you could fix this by reinstating the variable
doc-view-current-page, which was removed in your 2008-02-21 change.
That would provide a "default" current-page, applicable when the buffer
isn't shown in any windows.  Then modify doc-view-display accordingly.




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

* Re: 23.0.60; doc-view: occasionally stuck at welcome screen
  2008-04-21  5:36     ` Chong Yidong
@ 2008-04-29  0:00       ` Chong Yidong
  0 siblings, 0 replies; 5+ messages in thread
From: Chong Yidong @ 2008-04-29  0:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 142-done, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> I've located the source of the problem.  In doc-view-display the
>>>   (dolist (win (get-buffer-window-list buffer nil t)) ...)
>>> doesn't iterate over any windows, e.g. get-buffer-window-list returns nil.
>>
>> Is it run before `buffer' is shown in a window, maybe?
>
> I think what's happening is that doc-view-mode is being run during file
> autodetection, before the selected window switches to the doc-view
> buffer.  Thus, (window-buffer (selected-window)) is not equal to
> (current-buffer).

I've checked in a fix for this particular problem.

Taking a step back, though, I think the "window memory" feature you
introduced to image-mode and doc-view may be a misfeature.

Currently, if a window has previously been used to view a pdf file at a
particular page, then switching back to the pdf file jumps back to that
page automatically.  But this is not the way Emacs behaves for ordinary
buffers.  There, you jump to the value of point determined roughly as
follows:

(i) if there is at least one existing window displaying that buffer, use
the first such window found.

(ii) otherwise, use the last value of point set in that buffer (in any
window).

I think image-mode and doc-view should mirror the behavior of ordinary
buffers.  So instead of a buffer-local alist variable
((WIN . PROPS)...), we should have a buffer-local variable PROPS, and
update PROPS every time you scroll the image.

WDYT?




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

end of thread, other threads:[~2008-04-29  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 16:26 23.0.60; doc-view: occasionally stuck at welcome screen Markus Triska
2008-04-16  6:25 ` Tassilo Horn
2008-04-16 14:04   ` Stefan Monnier
2008-04-21  5:36     ` Chong Yidong
2008-04-29  0:00       ` Chong Yidong

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.