Received: (at 69565) by debbugs.gnu.org; 15 Mar 2024 07:44:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 15 03:44:42 2024 Received: from localhost ([127.0.0.1]:51835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rl2F8-000655-KA for submit <at> debbugs.gnu.org; Fri, 15 Mar 2024 03:44:42 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:48753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1rl2F6-00064r-Ho for 69565 <at> debbugs.gnu.org; Fri, 15 Mar 2024 03:44:41 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id E8870FF80B; Fri, 15 Mar 2024 07:43:36 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= <rudolf@HIDDEN> Subject: Re: bug#69565: Fit Image Width menu In-Reply-To: <86cys20zq0.fsf@HIDDEN> (Juri Linkov's message of "Sun, 10 Mar 2024 19:30:03 +0200") Organization: LINKOV.NET References: <86wmqglirq.fsf@HIDDEN> <m21q8kz7cs.fsf@HIDDEN> <86cys20zq0.fsf@HIDDEN> Date: Fri, 15 Mar 2024 09:28:37 +0200 Message-ID: <86le6k0x96.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69565 Cc: 69565 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain > OTOH, I'm worried that both 'image-transform-fit-to-width' > and 'image-transform-fit-to-height' were declared obsolete. > > So I'm not going to revive them. > > Instead I'll implement a more useful item > "Fill Image to Window" that will fill the image > as much as possible to the window without leaving > any glaring empty space. This means applying > either fit-to-width to vertical images (portrait orientation), > or fit-to-height to horizontal images (landscape orientation). This works nicely: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=image-transform-fill-window.patch diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 3bf4dd1ad7c..3039d13d9af 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -559,6 +559,8 @@ image-mode-menu :help "Resize image to match the window height and width"] ["Fit Image to Window (Scale down only)" image-transform-fit-both :help "Scale image down to match the window height and width"] + ["Fill Window with Image" image-transform-fill-window + :help "Resize image to fill either width or height of the window"] ["Zoom In" image-increase-size :help "Enlarge the image"] ["Zoom Out" image-decrease-size @@ -1591,6 +1593,18 @@ image-transform-fit-to-window (setq image-transform-resize 'fit-window) (image-toggle-display-image)) +(defun image-transform-fill-window () + "Fill the window with the image while keeping image proportions. +This means filling the window with the image as much as possible +without leaving empty space around image edges. Then you can use +either horizontal or vertical scrolling to see the remaining parts +of the image." + (interactive nil image-mode) + (let ((size (image-display-size (image-get-display-property) t))) + (setq image-transform-resize + (if (> (car size) (cdr size)) 'fit-height 'fit-width))) + (image-toggle-display-image)) + (defun image-transform-set-rotation (rotation) "Prompt for an angle ROTATION, and rotate the image by that amount. ROTATION should be in degrees." --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#69565
; Package emacs
.
Full text available.Received: (at 69565) by debbugs.gnu.org; 10 Mar 2024 17:33:31 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 10 13:33:31 2024 Received: from localhost ([127.0.0.1]:37815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rjN3D-00086l-0f for submit <at> debbugs.gnu.org; Sun, 10 Mar 2024 13:33:31 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1rjN39-00086J-1G for 69565 <at> debbugs.gnu.org; Sun, 10 Mar 2024 13:33:29 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id D990B40003; Sun, 10 Mar 2024 17:32:46 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= <rudolf@HIDDEN> Subject: Re: bug#69565: Fit Image Width menu In-Reply-To: <m21q8kz7cs.fsf@HIDDEN> ("Rudolf =?utf-8?Q?Adamkovi?= =?utf-8?Q?=C4=8D=22's?= message of "Fri, 08 Mar 2024 23:28:19 +0100") Organization: LINKOV.NET References: <86wmqglirq.fsf@HIDDEN> <m21q8kz7cs.fsf@HIDDEN> Date: Sun, 10 Mar 2024 19:30:03 +0200 Message-ID: <86cys20zq0.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69565 Cc: 69565 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >> + ["Fit Image Width" image-transform-fit-to-width > > To match the similar entry above, this should say "Fit Image to Window > Width", which is not only consistent but also clearer and grammatical. > >> + :help "Resize image to the width of the current window."] > > Ditto, to match the similar entry above, this should say "Scale image > down to match the window width". Agreed. This title was copied from other programs, but should match the existing style. OTOH, I'm worried that both 'image-transform-fit-to-width' and 'image-transform-fit-to-height' were declared obsolete. So I'm not going to revive them. Instead I'll implement a more useful item "Fill Image to Window" that will fill the image as much as possible to the window without leaving any glaring empty space. This means applying either fit-to-width to vertical images (portrait orientation), or fit-to-height to horizontal images (landscape orientation).
bug-gnu-emacs@HIDDEN
:bug#69565
; Package emacs
.
Full text available.Received: (at 69565) by debbugs.gnu.org; 9 Mar 2024 03:13:49 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 22:13:49 2024 Received: from localhost ([127.0.0.1]:60012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rin9g-0002bA-Jf for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 22:13:49 -0500 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]:44703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rudolf@HIDDEN>) id 1riii4-0003p5-E8 for 69565 <at> debbugs.gnu.org; Fri, 08 Mar 2024 17:29:04 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 926F511400E3; Fri, 8 Mar 2024 17:28:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 08 Mar 2024 17:28:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamkovic.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1709936902; x=1710023302; bh=6jJJUA7vnGKwMRlcP757Xg3nBORD2SmsZjKnUndHEDI=; b= nQXgQWu2LhE7SjAlc9efR4zRyAKcPCWT9o1s9ZRE5e+CdRR57usoDikGXoT5H8gB HiWBW2RGwVjrhoQ+TmlIaStb2TTSUnDfTD4L1w1lyxxTYaRuUY3vAT3Ay+wt+XSk vjWFldRZVhmAl53XzwJaBmu1bY7mSNED4hJeFBoSY3FBKzkq0G1khGna+iepuqrX 9X5Slux98WU+V6quq8HZMDAxjV1kCjVAXQwG9h7VW3A0362+sRy9ib1ryrsY94d/ 8ixPJppUQIHBSiJaqY/xNK5ZouRJV/tsvHgPqyV8Rqmyr9+3o7KtinbK50kojEKi GmdEjRqG6F6o2xNXqISmdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709936902; x= 1710023302; bh=6jJJUA7vnGKwMRlcP757Xg3nBORD2SmsZjKnUndHEDI=; b=h 8q1QdCBSzzyUscr1KLBn5H7vFL2V894EUknMsvSaQLnId9mKpLYsn3yvQy/Cw7zf WABHgKIlbK7CZryUMfmA5Rnzs6pdscoPgafic3//16yc5udi+b8sZy+dCouXLMge SFrF77Exm+P7/8f/ejlK/xdjpJP0vCJGJQCRrqu8JWy89W3qVAY78yTCXSOT3Kt9 4MowHrE09s2mrflxZtCTGeR77CeK80yJSY6Drfgd0gsyY7lVZ45qhYEqtdVvbmEK XcdpIA3NStJvxrhoOTSHufOCNYHMZG+XQpzHVvJSrEQZktBk2hHfYjvpF9TNoFE2 Z425rLVVI1zfLkPpn08Og== X-ME-Sender: <xms:BpHrZepnNpQWBFVvmGW2Mod0MO_UrpqyFLi5Vv7WN4Y8yoqpACT21g> <xme:BpHrZcqWNPwm9DggNdX2WHpe-vyFhiphWPYkMZ0vMqwip5GjHg2fxMo6Y3qJeg2h5 IbGcD79WCbhX6IbssY> X-ME-Received: <xmr:BpHrZTMIdse5CqeB9Ez_FKTsjOfeoI019aFCgqLikUoCIlzGFrFKwmoYK6p3KMZ-d8sWZ3naF1LcG17W5Ha8I9JLKStbxO3ckaVdXlh2xRwxn-4T9fk> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieehgdduiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpeftuhguohhl fhcutegurghmkhhovhhitgcuoehruhguohhlfhesrggurghmkhhovhhitgdrohhrgheqne cuggftrfgrthhtvghrnhepieetheelveduueelveegieekjeeuteeuudeuleehheeiueeh tdelffdvkefgieehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprhhuugholhhfsegruggrmhhkohhvihgtrdhorhhg X-ME-Proxy: <xmx:BpHrZd67hgZLzjCgnIyKea7yfM-IvKiBhC4aInUa415xPEMuzytSUg> <xmx:BpHrZd41E8Xu74HEJy-n29uTCcN6xkq4FdkEIPTds-7usYzKIUVTHg> <xmx:BpHrZdj_IdlucYt4tNoe6e9_mOGWgYiF6ypj2GbvRWkzfkL0Fn1Waw> <xmx:BpHrZdHgz70LtyvA9BDhf2uzmOGQ7CTOMdUUhyXx6pSnYeuBmp0SVA> Feedback-ID: i88214938:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Mar 2024 17:28:21 -0500 (EST) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= <rudolf@HIDDEN> To: Juri Linkov <juri@HIDDEN>, 69565 <at> debbugs.gnu.org Subject: Re: bug#69565: Fit Image Width menu In-Reply-To: <86wmqglirq.fsf@HIDDEN> References: <86wmqglirq.fsf@HIDDEN> Date: Fri, 08 Mar 2024 23:28:19 +0100 Message-ID: <m21q8kz7cs.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69565 X-Mailman-Approved-At: Fri, 08 Mar 2024 22:13:44 -0500 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Juri Linkov <juri@HIDDEN> writes: > + ["Fit Image Width" image-transform-fit-to-width To match the similar entry above, this should say "Fit Image to Window Width", which is not only consistent but also clearer and grammatical. > + :help "Resize image to the width of the current window."] Ditto, to match the similar entry above, this should say "Scale image down to match the window width". --=20 =E2=80=9CThose who cannot remember the past are condemned to repeat it.=E2= =80=9D --- George Santayana, Life of Reason: Reason in Common Sense, 1905 Rudolf Adamkovi=C4=8D <rudolf@HIDDEN> [he/him] Studenohorsk=C3=A1 25, 84103 Bratislava, Slovakia, European Union
bug-gnu-emacs@HIDDEN
:bug#69565
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 5 Mar 2024 16:59:20 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 05 11:59:20 2024 Received: from localhost ([127.0.0.1]:48860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rhY8N-0001TU-OU for submit <at> debbugs.gnu.org; Tue, 05 Mar 2024 11:59:19 -0500 Received: from lists.gnu.org ([209.51.188.17]:41002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1rhY8L-0001TH-QI for submit <at> debbugs.gnu.org; Tue, 05 Mar 2024 11:59:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1rhY7r-00037q-6l for bug-gnu-emacs@HIDDEN; Tue, 05 Mar 2024 11:58:47 -0500 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1rhY7p-0003ew-KQ for bug-gnu-emacs@HIDDEN; Tue, 05 Mar 2024 11:58:46 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id A8C1F20002 for <bug-gnu-emacs@HIDDEN>; Tue, 5 Mar 2024 16:58:41 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: Fit Image Width menu Organization: LINKOV.NET Date: Tue, 05 Mar 2024 18:56:25 +0200 Message-ID: <86wmqglirq.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@HIDDEN Received-SPF: pass client-ip=2001:4b98:dc4:8::227; envelope-from=juri@HIDDEN; helo=relay7-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.7 (--) Tags: patch PDF/image viewers provide a menu item "Fit Image Width". It's very useful to read long text on images. Therefore here is the same for the image-mode menu: diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 355685e70fd..a2f1a6c2d74 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -559,6 +559,8 @@ image-mode-menu :help "Resize image to match the window height and width"] ["Fit Image to Window (Scale down only)" image-transform-fit-both :help "Scale image down to match the window height and width"] + ["Fit Image Width" image-transform-fit-to-width + :help "Resize image to the width of the current window."] ["Zoom In" image-increase-size :help "Enlarge the image"] ["Zoom Out" image-decrease-size @@ -1574,7 +1576,6 @@ image-transform-fit-to-height (defun image-transform-fit-to-width () "Fit the current image to the width of the current window." - (declare (obsolete image-transform-fit-to-window "29.1")) (interactive nil image-mode) (setq image-transform-resize 'fit-width) (image-toggle-display-image))
Juri Linkov <juri@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#69565
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.