From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41222: 27.1; Auto-resizing of images in image-mode Date: Wed, 13 May 2020 01:57:38 +0300 Organization: LINKOV.NET Message-ID: <87tv0kkbkl.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="60525"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) To: 41222@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 13 01:00:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYdsq-000Fdv-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 01:00:20 +0200 Original-Received: from localhost ([::1]:50584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYdsp-0001mC-3w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 19:00:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYdsY-0001lU-Re for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 19:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYdsY-0007fb-Hf for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 19:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYdsY-0004Zj-Fq for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 19:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 May 2020 23:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41222 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158932439717550 (code B ref -1); Tue, 12 May 2020 23:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 May 2020 22:59:57 +0000 Original-Received: from localhost ([127.0.0.1]:56832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYdsT-0004Z0-5c for submit@debbugs.gnu.org; Tue, 12 May 2020 18:59:57 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYdsQ-0004Yi-Jx for submit@debbugs.gnu.org; Tue, 12 May 2020 18:59:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYdsQ-0001jh-Ba for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 18:59:54 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:33067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYdsO-0007cG-Tg for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 18:59:53 -0400 X-Originating-IP: 91.129.104.245 Original-Received: from mail.gandi.net (m91-129-104-245.cust.tele2.ee [91.129.104.245]) (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 26C6BFF808 for ; Tue, 12 May 2020 22:59:47 +0000 (UTC) Received-SPF: pass client-ip=217.70.183.199; envelope-from=juri@linkov.net; helo=relay9-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 18:59:48 X-ACL-Warn: Detected OS = Linux 3.11 and newer 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, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180127 Archived-At: This is a followup to the emacs-devel thread https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00777.html I noticed that image-mode still lacks one needed command: some image viewers have a menu item titled “Normal Size C-0” or “Original Size C-0”. Here's is the patch that implements it: diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 480b2e6b26..45007289c8 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -456,6 +456,7 @@ image-mode-map (define-key map "sb" 'image-transform-fit-both) (define-key map "ss" 'image-transform-set-scale) (define-key map "sr" 'image-transform-set-rotation) + (define-key map "so" 'image-transform-original) (define-key map "s0" 'image-transform-reset) ;; Multi-frame keys @@ -521,6 +522,8 @@ image-mode-map :help "Rotate the image"] ["Set Rotation..." image-transform-set-rotation :help "Set rotation angle of the image"] + ["Original Size" image-transform-original + :help "Reset image to original size"] ["Reset Transformations" image-transform-reset :help "Reset all image transformations"] "--" @@ -1382,6 +1385,13 @@ image-transform-set-rotation (setq image-transform-rotation (float (mod rotation 360))) (image-toggle-display-image)) +(defun image-transform-original () + "Display the current image with the original size and rotation." + (interactive) + (setq image-transform-resize nil + image-transform-scale 1) + (image-toggle-display-image)) + (defun image-transform-reset () "Display the current image with the default size and rotation." (interactive) BTW, like ‘image-auto-resize-on-window-resize’ was added recently to image-mode.el, is there a need to add a similar option to man.el to allow customization of auto-resizing of Man buffers as well? Maybe something like: diff --git a/lisp/man.el b/lisp/man.el index 5278a1a84d..a614cac536 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1579,7 +1579,8 @@ Man-mode (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) 'Man-bookmark-make-record) - (add-hook 'window-state-change-functions #'Man--window-state-change nil t)) + (when Man-fit-to-window-on-window-resize + (add-hook 'window-state-change-functions #'Man--window-state-change nil t))) (defun Man-build-section-list () "Build the list of manpage sections."