From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 5f9b5803bea: Fix zooming images in SHR Date: Wed, 26 Jun 2024 19:04:44 +0300 Message-ID: <86y16r7krn.fsf@gnu.org> References: <171912324641.7384.11296304660836747605@vcs2.savannah.gnu.org> <20240623061407.0C6DDC1FB5C@vcs2.savannah.gnu.org> <5f6b8e84-cd41-4229-ab22-64c931ff7966@app.fastmail.com> <50938116-7ba6-5625-94e0-fb55dfdc449d@gmail.com> <86o77rcvjz.fsf@gnu.org> <4f280b27-80f6-c691-2a74-1b667160e7cd@gmail.com> <86y16ublts.fsf@gnu.org> <868qyr95m0.fsf@gnu.org> <2e12b1d2-3fc2-49d5-e47b-0bb6b60add91@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13693"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jm@pub.pink, emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 26 18:05:14 2024 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 1sMV8z-0003G1-Cj for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Jun 2024 18:05:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMV8c-00012q-6x; Wed, 26 Jun 2024 12:04:50 -0400 Original-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 ) id 1sMV8a-00012R-6M for emacs-devel@gnu.org; Wed, 26 Jun 2024 12:04:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMV8Z-0003eA-Kw; Wed, 26 Jun 2024 12:04:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:Subject:In-Reply-To:To:From: Date; bh=ipLOZtWSlt8CLS7KNJ92CTeEiqBl4/Lyv0K0wxg/OVI=; b=Us5Mwg7NKkO2ZJUT1DBX Iof4UhdNtEJgvFDm7AfnRiE2QMeMOPf+8Vv7Qai3F2QadZ5xZe8dVgwUubIz+EsW7QH17lFs1z+43 TyccqnsszahTjWEyQg6w3gC3sK0ZUo+VDE30gx67eY6fts7qJ3vwVMg9iBa0ktxp9lLplpWkTwDle DOp1/taNqnTdUE45fB28YZ0NOTdPklGThEWk7+g/qwfgZcD01U60N0lnUI0Cu9y4sCvMqB/fsWfsc P1M4RWKCY23gLffzdzotUoUOMidPJ0RP8PqUpr7AInUpYzo/6UC4BVAOoNPndOg2jyPeflgdAF0KU vTuBne4plRDXFA==; In-Reply-To: <2e12b1d2-3fc2-49d5-e47b-0bb6b60add91@gmail.com> (message from Jim Porter on Wed, 26 Jun 2024 08:58:29 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320726 Archived-At: > Date: Wed, 26 Jun 2024 08:58:29 -0700 > Cc: jm@pub.pink, emacs-devel@gnu.org > From: Jim Porter >=20 > On 6/26/2024 6:49 AM, Eli Zaretskii wrote: > >> Date: Tue, 25 Jun 2024 22:09:20 -0700 > >> Cc: jm@pub.pink, emacs-devel@gnu.org > >> From: Jim Porter > >> > >> Hmm. What do you see if you try this patch? (Warning, it may print qui= te > >> a bit since it'll dump the full buffer contents including properties.) > >=20 > > It doesn't apply, please resend as attachment. >=20 > Here you go. Thanks. The result: Initial buffer contents: #("*" 0 1 (help-echo #("*" 0 1 (shr-indentation nil)) image-displayer #[771= "=E2=98=BB\2052 \302\303=E2=99=A6\"\203( \300\2052 \300=E2=99=A5\304\225\3= 05O!\211\205' =E2=98=BBb\210 =E2=98=BA=E2=99=A6=E2=99=A6{\"\210`=E2=98=BB|\= 207\306=E2=99=A5\307p=E2=99=A3=E2=99=A3E\310\211%\207" [nil shr-put-image-f= unction string-match "\\`cid:" 0 nil url-retrieve shr-image-fetched t] 9 ("= d:/gnu/git/emacs/branch/lisp/net/shr.elc" . 34913)] image-url "file://d:/gn= u/git/emacs/branch/test/data/image/blank-100x200.png" shr-alt "*" context-m= enu-functions (image-context-menu) keymap (keymap keymap (keymap (13 . shr-= browse-url) (79 . shr-save-contents) (118 . shr-browse-url) (117 . shr-mayb= e-probe-and-copy-url) (119 . shr-maybe-probe-and-copy-url) (73 . shr-insert= -image) (C-down-mouse-1 . shr-mouse-browse-url-new-window) (mouse-2 . shr-b= rowse-url) (follow-link . mouse-face) (9 . shr-next-link) (122 . shr-zoom-i= mage) (27 keymap (9 . shr-previous-link) (105 . shr-browse-image)) (97 . sh= r-show-alt-text)) keymap (105 keymap (118 . image-flip-vertically) (104 . i= mage-flip-horizontally) (114 . image-rotate)) keymap (C-mouse-4 . image-mou= se-increase-size) (C-wheel-up . image-mouse-increase-size) (C-mouse-5 . ima= ge-mouse-decrease-size) (C-wheel-down . image-mouse-decrease-size) (105 key= map (120 . image-cut) (99 . image-crop) (111 . image-save) (43 . image-incr= ease-size) (45 . image-decrease-size))) inhibit-isearch nil rear-nonsticky = t display (image :type svg :data " " :scale 1 :tra= nsform-smoothing t :ascent 100))) Test shr-test/zoom-image backtrace: signal(error ("Timed out waiting for initial load")) error("Timed out waiting for initial load") (progn (error message)) (if (> (float-time (time-since start)) shr-test--max-wait-time) (pro (while (not (funcall predicate)) (if (> (float-time (time-since star (let ((start (current-time)) (message (or message "timed out waiting shr-test-wait-for(#f(lambda () [(put-image-calls 0)] (=3D put-image-ca (let ((dom (libxml-parse-html-region (point-min) (point-max)))) (era (let ((shr-image-animate nil)) (let ((dom (libxml-parse-html-region (let ((shr-use-fonts nil)) (let ((shr-image-animate nil)) (let ((dom (let ((shr-width 80)) (let ((shr-use-fonts nil)) (let ((shr-image-an (let ((shr-put-image-function #'(lambda (&rest args) (setq put-image (let ((put-image-calls 0)) (let ((shr-put-image-function #'(lambda ( (progn (fset 'url-queue-retrieve vnew) (let ((put-image-calls 0)) (l (unwind-protect (progn (fset 'url-queue-retrieve vnew) (let ((put-im (let* ((vnew #'(lambda (&rest args) (apply #'run-at-time 0 nil #'url (progn (fset 'display-graphic-p #'always) (let* ((vnew #'(lambda (&r (unwind-protect (progn (fset 'display-graphic-p #'always) (let* ((vn (let* ((old (symbol-function 'display-graphic-p))) (unwind-protect ( (let ((ert--infos (cons (cons "Info: " (format "image with alt=3D%S" a (progn (let ((ert--infos (cons (cons "Info: " (format "image with al (unwind-protect (progn (let ((ert--infos (cons (cons "Info: " (forma (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current (let ((alt (car tail))) (let ((temp-buffer (generate-new-buffer " *t (while tail (let ((alt (car tail))) (let ((temp-buffer (generate-new (let ((tail '(nil))) (while tail (let ((alt (car tail))) (let ((temp (let ((image (expand-file-name "data/image/blank-100x200.png" (geten #f(lambda () [t] (let ((value-60 (gensym "ert-form-evaluation-aborte #f(compiled-function () #)() handler-bind-1(#f(compiled-function () #