From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Abdul-Lateef Haji-Ali via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62637: 29.0.60; Issues when displaying images Date: Sun, 02 Apr 2023 14:31:12 +0100 Organization: Heriot-Watt University Message-ID: Reply-To: Abdul-Lateef Haji-Ali Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26524"; mail-complaints-to="usenet@ciao.gmane.io" To: 62637@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 03 07:37:24 2023 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 1pjCse-0006e5-5Q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Apr 2023 07:37:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjCsK-0005Y0-AL; Mon, 03 Apr 2023 01:37:04 -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 1pjCsI-0005XZ-M4 for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2023 01:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjCsI-0008Nf-2S for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2023 01:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pjCsH-00012h-Qz for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2023 01:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Abdul-Lateef Haji-Ali Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Apr 2023 05:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62637 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.16805001993961 (code B ref -1); Mon, 03 Apr 2023 05:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Apr 2023 05:36:39 +0000 Original-Received: from localhost ([127.0.0.1]:43121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjCru-00011n-9S for submit@debbugs.gnu.org; Mon, 03 Apr 2023 01:36:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pixwW-00013a-V9 for submit@debbugs.gnu.org; Sun, 02 Apr 2023 09:40:27 -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 1pixwW-00036p-JA for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 09:40:24 -0400 Original-Received: from mail-cwlgbr01on072e.outbound.protection.outlook.com ([2a01:111:f400:fe14::72e] helo=GBR01-CWL-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pixwT-0007Dm-QH for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 09:40:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h+vlUGkqfbs9Ob/6sBYMLARulw0t1lFoR5eJ3BrQFebRLLnyTI4jgBSn/a42GaT3oojw9bffwEwer9nhtUnBq1I2rUYH8BKcxr5eBBFk1J0RawxTyDpfd00zUdjiTVH+Nu3f8Gu9i68Xl7QrvKFxSqnZI/qJp8W2BRy3tbiABTta3iaxEMh2kzHc6SxX1FhaiDd6JOE06PiYMjDNj1WlNJF0pTtD2lV+87Nen1XQb2os/QyA51nGFMRsrzdlUy5dh1rRMbd7/iGvvgBZMBzoq5Z+zEHgBKShDwTEImorkuZMowE06PCDFzj4HA1io02KOXssqK7mQLEkNi1Qe8qj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XbhF/XWMHZXhAV++jwU6/6T7EzXhbOJe2Sm4EBAJ1B8=; b=G+y5L8geQ+Xr3hNKd+FB5DDPFqwfzBQ3kYVUhVnlpXOd29sVjeANqHtgAmh0N5+py8kDgrca+rg+2Dwx7PqKk1yVh3VN2Nx1tKZZd4C6JHcjKQq7dS7kqO8HQnV8xYbuzwlb7gOjVgZuNM24f8u0Fw18/J/FbIO3fLhohybUqmFQN5+uZhiW2fxNxlB55VqO2Hxna3xNHjGw4nw2m3SWRfyY+IhlSywea0NZAdbNGijhl1p8q+Iau9xvA8fyw3EoTipNyvHR4yMwE3utryd9i634yyjH2Bp1GZlkBOjQIDXIGNdr/o2EIDp0FJhJYY2nYxQmOaOQBth34JInrUsx+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hw.ac.uk; dmarc=pass action=none header.from=hw.ac.uk; dkim=pass header.d=hw.ac.uk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heriotwatt.onmicrosoft.com; s=selector2-heriotwatt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XbhF/XWMHZXhAV++jwU6/6T7EzXhbOJe2Sm4EBAJ1B8=; b=P/kNCKm7WDnSs9oK72qHuhud6XuQDaXZcGzvWXIW/Hv3IDwh5A518mQBqwX9TdLMPxloL7gP0c94VG/eMvEhNCxI16MSM258TAV10FMFM5t6wPNFFnkO9TEi35FfMhf1ft0SXxbvgXdzA9vansos5V9E8TnOMHG5DEsbrxid5cg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=hw.ac.uk; Original-Received: from LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:37e::12) by LO0P302MB0049.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:363::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.29; Sun, 2 Apr 2023 13:35:15 +0000 Original-Received: from LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM ([fe80::9a97:1ac6:5e76:7737]) by LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM ([fe80::9a97:1ac6:5e76:7737%4]) with mapi id 15.20.6254.030; Sun, 2 Apr 2023 13:35:15 +0000 X-ClientProxiedBy: LO4P123CA0301.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:196::18) To LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:37e::12) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO6P302MB0318:EE_|LO0P302MB0049:EE_ X-MS-Office365-Filtering-Correlation-Id: 263ddd29-a7ba-4157-5e39-08db337f1773 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Zsv+eBYaocA4qpkwEC07m6s0Ik9686HiC+ww8spggFmdGSlNggk7CEoC4aau4RfdzJzr/SUO7ed2YK4tepZz+WU+v2p9d2wyC0fcpZap4rP+EvsP7ZLloNsKGy041nH1pFhMh1EM1qkdrXRK6ODfaB3+5UjP2ZH/2xCpgGQnzZ6aR12m4qvsJLjORkieWztYZOdOUoM0qr4J+7SusyC39qE2/z54IBS979VgrwRIk4IKvDdoXA8fYCcd92xEH6B6e83okYprU/YBJbgedIznmgzvaCBBMxVPV8+suB5bO10OxExd7Cfhf5O+wJz46K9hs2fr2EWdip7DcLnUoFnYwBiy8r+Nq0Rm/Q7Kr2ttBDnOjSLgf9DlHTZ3rWK2gt90DU3DNg5QyAvIwbEKBEkH89YA8wJkaxA16+p4Hr/EdoOIGMk/LvQ/eY5vAbgp93dsB/GfRXm4j71Twv5CQs81a8h204OAT6j+IwudA+WEaLvBSGh5D/3QzC5Lshyb1pB2at173COBqUf38Jgq54Ihq18hw6NXTZQ59MdxiqHFBRNgQYkmcj8uXkCDphRM+bT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(39850400004)(136003)(346002)(376002)(366004)(451199021)(41300700001)(8676002)(6916009)(66476007)(66946007)(66556008)(478600001)(316002)(786003)(8936002)(5660300002)(38100700002)(4743002)(186003)(83380400001)(2616005)(36916002)(6666004)(6486002)(26005)(6512007)(6506007)(86362001)(36756003)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nomcLjOLz+78TtZhjv5PM93YYXDOGyqgUR9oYjHDz10ElKztjLJD8s/navp1zqyzd44r4Yy6oNwQ+JifWUeM1C6c8gi362uGGzLG9soRXoau3aq5adT1Sd7rSbcoQXLwAtKGa0wNvYRMPCBTQ2VqRHKGfJpWqCM+m98SBd+fr2oK82m1gGk6bnK80VdWVKuDOWVjD2j91nkxlv44kX9W8RPlWZNZU0/Z7xayyZTwAdAS0vWdek5yoU/reni4xzKBEEnvEE4I2Q8WuAP8OVxoUyjpLq1tYyynmRWHfL4TTNjZnUV7lErW5xGz/28qk8qFCD49DP8DTyxyd32kAMafh7lINvgz5vjjfbeD+hy35P+XIxiqYTBIUXi3vrgkbf9m46k2KPQOsLKZiNN2nWSReWJT4VsIRYyu00tO9aJ1JZkLTKwUryWYWYK+AzpFthNOyuegCQYHyWQvwvIBgkjQjQ8vUdE+LIr0mz0rPKJ0J2kVMdTDwoT/rMh9YN3fXuYBIEf1lN+ikA0Juf1YnUmBqDfe61i8ECrUXGffWCzi7D7kQicmSXfOQNbavKabEskNcvdHpPDQ6yYssc7uazypYA72KF7MA7yA38UFqLKJzG3AOlScqMovcIipYQzLg5nQ9wVwYNI8gGBDSxhTM8WtpVtfVZ/ZnFKo7cNVdXS8NS9iXEdymhtnCQwdURMkxq/UCHDCnF69A59ZnHKcsmr8QEbfc+ELlt8V843L7/U+Gkoyfv7THrYQBic672 7BM/BDXAA8/e/dNrqqrn35j8NJHU1vh9ZZvt2hVtnkqB/wHkz8aCO0WU6d98T67f42eIceUVjyDe3oOpz8+00qEjXf7I5jn1Dw X-OriginatorOrg: hw.ac.uk X-MS-Exchange-CrossTenant-Network-Message-Id: 263ddd29-a7ba-4157-5e39-08db337f1773 X-MS-Exchange-CrossTenant-AuthSource: LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2023 13:35:15.1861 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6c425ff2-6865-42df-a4db-8e6af634813d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R0xaD9CVPtpKwhVbo4Aeb9fyi7Zgvgxhv5vqgci++u9RmfFqQZCTdKaOOxTTlnUc X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO0P302MB0049 Received-SPF: pass client-ip=2a01:111:f400:fe14::72e; envelope-from=A.HajiAli@hw.ac.uk; helo=GBR01-CWL-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 03 Apr 2023 01:36:36 -0400 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259152 Archived-At: It seems that `mm-inline-image` switched to using `insert-image` instead of `put-image` which resulted in some regressions in notmuch that I noticed between emacs 29 and emacs 28.2. However, I tracked down the discrepancy to the following issues in displaying images in emacs-29. First the following code (assuming some image in /tmp/tmp.png), executed in "emacs -Q" on either emacs 28.2 or emacs 29: (let (content-begin content-end) (goto-char (point-max)) (insert "\n") (setq content-begin (point)) (insert-image (create-image "/tmp/tmp.png")) (setq content-end (point)) ;; I expect the following line to indent the image (or not). ;; instead the image is removed completely ;;(indent-rigidly content-begin content-end 1) ;; This line should hide the image, but it doesn't ;;(overlay-put (make-overlay content-begin content-end) 'invisible t) ) Uncommenting each of the two lines of code shows the two issues (explained in comments). These issues appear in both emacs 29 and 28.2 (though they might be specific to MacOS). Similar code to this example is executed in notmuch when displaying message, but using `mm-inline-image` instead of insert-image: (let* ((buffer (find-file-noselect "/tmp/tmp.png" t t)) (handle (list buffer '("image/jpeg" (charset)) nil nil nil nil `(image :type jpeg :data ,(with-current-buffer buffer (buffer-string)) :scale 1 :transform-smoothing t) nil)) content-begin content-end) (goto-char (point-max)) (insert "\n") (setq content-begin (point)) (require 'mm-view) (mm-inline-image handle) (setq content-end (point)) ;; I expect the following line to indent the image (or not). ;; instead the image is removed completely ;;(indent-rigidly content-begin content-end 1) ;; This line should hide the image, but it doesn't ;;(overlay-put (make-overlay content-begin content-end) 'invisible t) ) In this case, in Emacs 29, the behaviour is similar to the "wrong" behaviour of the first example. In Emacs 28.2 on the other hand, the behaviour is what I would expect in both cases (though the undo stack gets messed up and I cannot undo inserting the image. Indenting also doesn't work, but at least the image is not removed) As a last test, in case it is helpful, I tried the following in emacs 29 using `put-image` instead of `insert-image` (`mm-inline-image` uses in Emacs 28.2 uses `put-image` while in Emacs 29 it uses 'insert-image'), and noticed an equally puzzling behaviour: (let (content-begin content-end) (goto-char (point-max)) (insert "\n") (setq content-begin (point)) (put-image (create-image "/tmp/tmp.png") (point-marker)) (setq content-end (point)) ;; I expect the following line to indent the image (or not). ;; instead the image is removed completely ;;(indent-rigidly content-begin content-end 1) ;; This line should hide the image, but it doesn't ;;(overlay-put (make-overlay content-begin content-end) 'invisible t) ) In this case, `indent-rigidly` does not remove the image, but hiding the overlay does not work. Best regards, -- Al ---------------------------------------------------------------------------- In GNU Emacs 29.0.60 (build 1, aarch64-apple-darwin22.3.0, NS appkit-2299.40 Version 13.2.1 (Build 22D68)) of 2023-03-22 built on HW-R9XXWKPJ4D Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.2.1 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs-plus@29/29.0.60 --with-xml2 --with-gnutls --with-native-compilation --without-compress-install --without-dbus --with-imagemagick --with-modules --with-rsvg --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe -mmacosx-version-min=13 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' 'CPPFLAGS=-I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/jpeg/include -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/openssl@1.1/include -isystem/opt/homebrew/include -F/opt/homebrew/Frameworks -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk' 'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/jpeg/lib -L/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/lib -F/opt/homebrew/Frameworks -Wl,-headerpad_max_install_names -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'' Configured features: ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 77309 5714) ________________________________ Heriot-Watt University was founded in 1821 and is a registered Scottish charity (SC000278). (symbols 48 7039 0) (strings 32 18694 2727) (string-bytes 1 577061) (vectors 16 16292) (vector-slots 8 324373 10025) (floats 8 27 46) (intervals 56 297 0) (buffers 984 10))