From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#8364: 24.0.9999; PATCH: Fit to width/height/page for doc-view.el Date: Thu, 31 Mar 2011 08:32:27 +0200 Message-ID: <877hbf94w4.fsf@member.fsf.org> References: <878vvz8sml.fsf@fastmail.fm> <87k4fj6z8e.fsf@member.fsf.org> <87hbanw3ll.fsf@member.fsf.org> <8762r0wsqj.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301553454 26426 80.91.229.12 (31 Mar 2011 06:37:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2011 06:37:34 +0000 (UTC) Cc: sho nakatani , 8364@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 31 08:37:29 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5BVY-00083j-VA for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Mar 2011 08:37:29 +0200 Original-Received: from localhost ([127.0.0.1]:47693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5BVY-0006IK-C5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Mar 2011 02:37:28 -0400 Original-Received: from [140.186.70.92] (port=60644 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5BVQ-0006HW-AB for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2011 02:37:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5BVP-0006Pd-6w for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2011 02:37:20 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5BVP-0006PV-5Z for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2011 02:37:19 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q5BRF-0006Gz-Tb; Thu, 31 Mar 2011 02:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Mar 2011 06:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8364 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 8364-submit@debbugs.gnu.org id=B8364.130155315824083 (code B ref 8364); Thu, 31 Mar 2011 06:33:01 +0000 Original-Received: (at 8364) by debbugs.gnu.org; 31 Mar 2011 06:32:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5BQq-0006GO-PZ for submit@debbugs.gnu.org; Thu, 31 Mar 2011 02:32:37 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5BQp-0006GB-7c for 8364@debbugs.gnu.org; Thu, 31 Mar 2011 02:32:36 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 207F17816F90; Thu, 31 Mar 2011 08:32:29 +0200 (CEST) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29376-07; Thu, 31 Mar 2011 08:32:28 +0200 (CEST) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from thinkpad (tsdh.uni-koblenz.de [141.26.67.142]) by deliver.uni-koblenz.de (Postfix) with ESMTP id E9BF57816F67; Thu, 31 Mar 2011 08:32:27 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Wed, 30 Mar 2011 17:07:34 -0400") User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.9999 (gnu/linux) X-Virus-Scanned: amavisd-new at uni-koblenz.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 31 Mar 2011 02:33:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45515 Archived-At: Stefan Monnier writes: >> Implementation-wise, the difference is that Nakatani's current >> approach simply uses the image slice for the geometry, your rectangle >> approach requires another buffer-local variable. > > I don't see why you'd need another buffer-local var. It'd just set > the zoom level and the scrolling. Unless you mean a new buffer-local > var to remember "keep it fitted", but I don't need that. Oh, right. So you'd set the rectangle once, which would adjust the zoom level and hscroll, and since doc-view preserves the hscroll anyway, there's nothing to remember. Hm, I can see that this is also handy, although not much different to slice&fit. One complication here is that you have to set the hscroll in terms of columns while the rectangle is pixel-based. Nakatani, if you want, you could try to implement a `doc-view-fit-rectangle-to-window' function. Basically, the right factor for zooming is exactly the same calculation as for the slices, except that you read the geometry first by letting the user drag a rectangle like in `doc-view-set-slice-using-mouse'. It makes sense to split this functionality into a separate function and use it then from these two places. I'm not sure about the right value to give to `set-window-hscroll', though. Bye, Tassilo