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.devel Subject: Re: Auto-resizing of images in image-mode Date: Mon, 20 Apr 2020 02:19:51 +0300 Organization: LINKOV.NET Message-ID: <87y2qrvzag.fsf@mail.linkov.net> References: <83r1wqgcl1.fsf@gnu.org> <87eesnayhf.fsf@mail.linkov.net> <83sgh2d2zo.fsf@gnu.org> <874ktg5pgt.fsf@mail.linkov.net> <83r1wjin8y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121306"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 20 01:28:40 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jQJMe-000VS4-AF for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Apr 2020 01:28:40 +0200 Original-Received: from localhost ([::1]:54072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJMd-0004z5-Bj for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Apr 2020 19:28:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38496 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJLw-0003hN-6u for emacs-devel@gnu.org; Sun, 19 Apr 2020 19:27:56 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQJLv-0002j7-SE for emacs-devel@gnu.org; Sun, 19 Apr 2020 19:27:56 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:47359) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jQJLt-0002KW-6a; Sun, 19 Apr 2020 19:27:53 -0400 X-Originating-IP: 91.129.99.85 Original-Received: from mail.gandi.net (m91-129-99-85.cust.tele2.ee [91.129.99.85]) (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 880B6C0004; Sun, 19 Apr 2020 23:27:50 +0000 (UTC) In-Reply-To: <83r1wjin8y.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 Apr 2020 17:06:05 +0300") Received-SPF: pass client-ip=217.70.183.198; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-detected-operating-system: by eggs1p.gnu.org: Linux 3.11 and newer [fuzzy] X-Received-From: 217.70.183.198 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:247338 Archived-At: >> Also there are no keys for image-transform-fit-to-width, >> image-transform-fit-to-height and image-transform-reset. >> I thought about using a prefix key 'f', so using 'f w' to fit width, >> but 'f' is already taken too. >> >> But anyway their docstrings say: >> >> This command has no effect unless Emacs is compiled with >> ImageMagick support. >> >> So these commands should be fixed to work without ImageMagick. > > Right. But that's for master, I think. After testing these commands it became clear that they all already work without ImageMagick, so I just removed mentions of ImageMagick from docstrings and these conditionals from menus: :visible (eq image-type 'imagemagick) So what remains to do in emacs-27 is to add defcustoms. As for master, there is much work remains to do to fix the mess what is image-mode currently is: 1. Figure out why there are two rotating commands: image-rotate bound to 'r' in image-map, and image-transform-set-rotation in image-mode. 2. Try to make sense out of commented code: ;; Not yet implemented. ;; (defvar image-transform-minor-mode-map ;; (let ((map (make-sparse-keymap))) ;; ;; (define-key map [(control ?+)] 'image-scale-in) ;; ;; (define-key map [(control ?-)] 'image-scale-out) ;; ;; (define-key map [(control ?=)] 'image-scale-none) ;; ;; (define-key map "c f h" 'image-scale-fit-height) ;; ;; (define-key map "c ]" 'image-rotate-right) ;; map) ;; "Minor mode keymap `image-transform-mode'.") ;; ;; (define-minor-mode image-transform-mode ;; "Minor mode for scaling and rotating images. ;; With a prefix argument ARG, enable the mode if ARG is positive, ;; and disable it otherwise. If called from Lisp, enable the mode ;; if ARG is omitted or nil. This minor mode requires Emacs to have ;; been compiled with ImageMagick support." ;; nil "image-transform" image-transform-minor-mode-map) >> (defcustom image-window-resize t >> "Non-nil to resize the image whenever the window's dimensions change." >> :type 'boolean >> :version "27.1" >> :group 'image) >> >> (defcustom image-window-resize-delay 1 >> "Number of seconds to wait before resizing according to `image-window-resize'." >> :type 'integer >> :version "27.1" >> :group 'image) >> >> If this looks good, I could send a complete patch. > > Please do, and thanks. It seems image-window-resize and image-window-resize-delay could be combined into one defcustom that will be either nil or number, will post the patch ASAP.