From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: 23.0.60; doc-view: occasionally stuck at welcome screen Date: Mon, 28 Apr 2008 20:00:39 -0400 Message-ID: <87abjdy1g8.fsf@stupidchicken.com> References: <20080415162635.832C6809A05@mt-computer.local> <87hce22u5j.fsf@member.fsf.org> <87zlrnbwgg.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1209427563 8284 80.91.229.12 (29 Apr 2008 00:06:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2008 00:06:03 +0000 (UTC) Cc: 142-done@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 29 02:06:39 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JqdMb-0006V5-Rf for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2008 02:06:30 +0200 Original-Received: from localhost ([127.0.0.1]:53299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqdLv-00067x-74 for ged-emacs-devel@m.gmane.org; Mon, 28 Apr 2008 20:05:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqdLK-0005sr-6Q for emacs-devel@gnu.org; Mon, 28 Apr 2008 20:05:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqdLI-0005rZ-GP for emacs-devel@gnu.org; Mon, 28 Apr 2008 20:05:09 -0400 Original-Received: from [199.232.76.173] (port=54341 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqdLI-0005rQ-AT for emacs-devel@gnu.org; Mon, 28 Apr 2008 20:05:08 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JqdLI-0001pd-3h for emacs-devel@gnu.org; Mon, 28 Apr 2008 20:05:08 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 5A94A4E27B; Mon, 28 Apr 2008 20:00:39 -0400 (EDT) In-Reply-To: <87zlrnbwgg.fsf@stupidchicken.com> (Chong Yidong's message of "Mon, 21 Apr 2008 01:36:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96107 Archived-At: Chong Yidong writes: > Stefan Monnier 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?