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: Mon, 28 Mar 2011 17:28:33 +0200 Message-ID: <87k4fj6z8e.fsf@member.fsf.org> References: <878vvz8sml.fsf@fastmail.fm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1301326647 12918 80.91.229.12 (28 Mar 2011 15:37:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2011 15:37:27 +0000 (UTC) Cc: 8364@debbugs.gnu.org To: sho nakatani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 28 17:37:23 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 1Q4EVJ-00042l-JX for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Mar 2011 17:37:17 +0200 Original-Received: from localhost ([127.0.0.1]:45686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4EVI-0003BA-FH for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Mar 2011 11:37:16 -0400 Original-Received: from [140.186.70.92] (port=51044 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4EVD-0003AW-Me for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2011 11:37:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4EVB-0002QT-MK for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2011 11:37:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4EVB-0002QN-KL for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2011 11:37:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q4ENK-0008FE-Dp; Mon, 28 Mar 2011 11:29:02 -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: Mon, 28 Mar 2011 15:29:02 +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: Original-Received: via spool by 8364-submit@debbugs.gnu.org id=B8364.130132612331668 (code B ref 8364); Mon, 28 Mar 2011 15:29:02 +0000 Original-Received: (at 8364) by debbugs.gnu.org; 28 Mar 2011 15:28:43 +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 1Q4EN0-0008Ej-Nw for submit@debbugs.gnu.org; Mon, 28 Mar 2011 11:28:42 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4EMz-0008ET-CX for 8364@debbugs.gnu.org; Mon, 28 Mar 2011 11:28:42 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 6788F781777E; Mon, 28 Mar 2011 17:28:35 +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 16536-03; Mon, 28 Mar 2011 17:28:34 +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 E80F57816FDB; Mon, 28 Mar 2011 17:28:33 +0200 (CEST) In-Reply-To: (sho nakatani's message of "Mon, 28 Mar 2011 23:56:14 +0900") 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: Mon, 28 Mar 2011 11:29:02 -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:45427 Archived-At: sho nakatani writes: Hi! >> Good, thanks. =C2=A0I'll still have to do it by hand, sadly, since I like >> to "fit the text" rather than "fit the page", i.e. I like to keep the >> margins outside of the viewable area. =C2=A0A command to do that >> automatically would be really nifty. > > Sad to say, I have no idea to realize such function, although I completely > agree with you. > Currently, the scale factor for enlarge/shrink is determined by the ratio= of > the size of PNG image to the size of window. It is pretty difficult to sp= ecify > where 'margins' are from PNG image. Users can cut the margins using the slice feature (`s m'). The information about the current slice (X Y WIDTH HEIGHT) can be accessed using the `doc-view-current-slice' macro. So it seems doable to calculate the right zoom factor and adjust the slice accordingly after zooming if a slice was set. How that can be done is left as an exercise to the reader. ;-) Nakatani, feel free to implement that, and send updated patches to this "bug" report. > It might be possible if the scale factor is determined not from PNG > image but from PDF/PS. However, it is far difficult than current > implementation. I'd advice not to add special-case code for certain kinds of documents. Bye, Tassilo