From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner Newsgroups: gmane.emacs.devel Subject: Retain image properties after image-mode commands Date: Sun, 03 Mar 2024 22:07:49 -0800 Message-ID: <878r2ytqnx.fsf@ushin.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27194"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Devel Mailing List Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 04 12:54:38 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 1rh6tx-0006qx-S9 for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Mar 2024 12:54:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rh6tF-0003Bj-35; Mon, 04 Mar 2024 06:53:53 -0500 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 1rh2Wr-0001Ci-0a for emacs-devel@gnu.org; Mon, 04 Mar 2024 02:14:29 -0500 Original-Received: from out-175.mta0.migadu.com ([2001:41d0:1004:224b::af]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rh2Wo-0006Nn-Im for emacs-devel@gnu.org; Mon, 04 Mar 2024 02:14:28 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ushin.org; s=key1; t=1709536455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLis0XxER8Fhp1lsXf8US+ufI8c2ftFGt05G3sYITeA=; b=opG20IfLclp7UD6wMBRur0p1tAVROfWFIIPuNJO8ZSRm5x1ztPjBTOBuw5OxvsVqFi4w7g rT5e8j3q1ze/GE6Ohq+/tQYwxfHdyefX55KNilyykNM5R3c9kXBJ+cnYNWfv1bwwQcm69c j+/bu62fpGdXciluEAen1YYWJZcMj/YVijsgeJCwuflZ49/wO7QqwgQL7K2Ktk8dzkHQlI o/dAuefOBl4yrvOwrgx1HGhqeqQ+YJc/Tr3JXv/MbQWz2UEIfFE5sz5hB1xSUQC2U9WqsE yFM3ipxLZyhYBzlSFXTO2Szg3PDpGD4RLRxpj1MYUfryxmdOxZZI+TO0G4BdDw== X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::af; envelope-from=joseph@ushin.org; helo=out-175.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 04 Mar 2024 06:53:50 -0500 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:316787 Archived-At: Hello! I would like to use `image-mode' commands such as `image-transform-set-scale' on non-file-backed images which have image properties. That command internally calls `image-toggle-display-image', which recontructs the image with `create-image', throwing away any existing image properties. A concrete example: Evalute the following form to render an SVG image in an Emacs buffer: (with-current-buffer (get-buffer-create "*image-properties-test*") (let ((svg-string "\n\n\n\n\n\norggraphview\n\n\n\na\n\n\nHover me!\n\n\n\n\n\n") (map '(((circle (85 . 85) . 80) "1" (help-echo "Surprise!")))) (inhibit-read-only t)) (fundamental-mode) (erase-buffer) (insert-image (create-image svg-string 'svg t :map map) svg-string) (image-mode) (pop-to-buffer (current-buffer)))) Mouse over the circle in the center of the SVG to see the tooltip. Then zoom in on the image: Interactively run `image-transform-set-scale' by pressing "s s" then type the number 2 and press RET. The image gets bigger, but now mousing over the circle has no effect. How can I keep the mouse-over effect (the image :map property) after running `image-mode' commands which reconstruct the image? Thank you!! Joseph