From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian D Newsgroups: gmane.emacs.devel Subject: Re: Doc View Page Problems Date: Wed, 16 Apr 2014 09:06:01 -0400 Message-ID: <8738hdh1ae.fsf@gnu.org> References: <87mwfmwwsi.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397653577 5584 80.91.229.3 (16 Apr 2014 13:06:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Apr 2014 13:06:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 16 15:06:09 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WaPXU-0008Qo-O3 for ged-emacs-devel@m.gmane.org; Wed, 16 Apr 2014 15:06:08 +0200 Original-Received: from localhost ([::1]:54537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaPXU-0003DH-9f for ged-emacs-devel@m.gmane.org; Wed, 16 Apr 2014 09:06:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaPXQ-0003DC-3l for emacs-devel@gnu.org; Wed, 16 Apr 2014 09:06:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WaPXP-0005ul-4L for emacs-devel@gnu.org; Wed, 16 Apr 2014 09:06:04 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaPXP-0005uh-0c for emacs-devel@gnu.org; Wed, 16 Apr 2014 09:06:03 -0400 Original-Received: from [2620:0:2820:902:226:b6ff:fee6:518e] (port=50740 helo=parabola) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1WaPXO-0002NU-Ky; Wed, 16 Apr 2014 09:06:02 -0400 In-Reply-To: (Stefan Monnier's message of "Tue, 15 Apr 2014 12:51:34 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171452 Archived-At: Stefan Monnier writes: >> P.S. I apologize if the bug mailing list would have been the >> appropriate mailing list to which to send this. > >It would have worked as well, maybe even better. > Noted. I will remember that for next time. > Could you provide a ChangeLog entry for that change? Are we sure > (image-mode-window-get 'page t) can't return nil? > I put the ChangeLog entry at the end of this email. The first thing that DocView does when it opens a file is adds the default configuration to image-mode-winprop-alist. image-mode won't remove it, since the key is `t'. That means that (image-mode-window-get 'page t) will always return something, unless the user has specifically removed it. >> (setf (doc-view-current-page) page >> + (image-mode-window-get 'page t) page ;; Update the default page. > > Wouldn't it be better to do that directly inside image-mode-window-put? > > > Stefan > I used `image-mode-window-get' because that was what was being used through most of the document (including the line above it). It could just as easily be (image-mode-window-put 'page page t). Ian D ChangeLog entry: 2014-04-16 Ian Dunn * doc-view.el (doc-view-new-window-function): If no window exists, move to the last known page. (doc-view-goto-page): Updates the page of the default window configuration.