From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 13 17:38:28 2024 Received: (at submit) by debbugs.gnu.org; 13 Mar 2024 21:38:28 +0000 Received: from localhost ([127.0.0.1]:47533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkWIt-0000cg-24 for submit@debbugs.gnu.org; Wed, 13 Mar 2024 17:38:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:41970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkWIq-0000cY-W4 for submit@debbugs.gnu.org; Wed, 13 Mar 2024 17:38:26 -0400 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 1rkWIH-0002Gs-0y for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2024 17:37:49 -0400 Received: from sender-pp-o91.zoho.eu ([136.143.169.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkWID-000092-St for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2024 17:37:48 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1710365862; cv=none; d=zohomail.eu; s=zohoarc; b=i2/L6mSOJovA2G/3AIwxo2idquLsaGUyuRIvGFKA8X6GSEmdSgNLpTYGeQ8NEd0Zs3bnH5jme7WAFZ3bPPSea0hTFt/f4t2PVR+YYwsslj+v18IKsObMZS2L9ICftb/4Td49A+rA+OmhnBatyDQK3w8FE530GKiBIMvtJMoQd5c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1710365862; h=Content-Type:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=cQLhjGx7emLi5rkA2dR4YsSX5xDMnTf5fPDq7B0Avuc=; b=QT1c33iHV6Uc+nMuxD5c64M62eRPXk6lN//Ou3js+qU+Br5sHvyeiPujqYc3nNm3K0ysIMm05LbL26m6QvjzZdMKyWEll746QWA+9gTtsICf63mN0lhhFYx49PJfgcLK5uF7Nqwef8pA0aVqFAnQWSCiNR7vFdYtNmZYd5Vbydk= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=zohomail.eu; spf=pass smtp.mailfrom=rahguzar@zohomail.eu; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1710365862; s=zoho; d=zohomail.eu; i=rahguzar@zohomail.eu; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=cQLhjGx7emLi5rkA2dR4YsSX5xDMnTf5fPDq7B0Avuc=; b=jsyw6d62orCbtL52CYbf42gj1RTYhYfi7L4mhR5RMBsS/WLk4vpKOQAKGOUBmLqN ZfRILcCtXzuZGb/EDzjFaujz0PNRexKOJDb/prB0u/xhwKz/KyohRJoDrEvcmV3pyYf xUW+bw1oEHxsUBULGGeDjqBP0IsSAac6W55+DUYg= Received: from localhost (h-79-136-47-25.A980.priv.bahnhof.se [79.136.47.25]) by mx.zoho.eu with SMTPS id 1710365858603133.48610625288723; Wed, 13 Mar 2024 22:37:38 +0100 (CET) User-agent: mu4e 1.10.5; emacs 29.2 From: Rahguzar To: bug-gnu-emacs@gnu.org Subject: 29.2; Image mode can loop due to invalid images Date: Wed, 13 Mar 2024 22:13:55 +0100 Message-ID: <87edcdx17i.fsf@zohomail.eu> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.169.91; envelope-from=rahguzar@zohomail.eu; helo=sender-pp-o91.zoho.eu 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-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Dear Emacs developers, Starting with emacs -Q, evaluate (with-current-buffer (get-buffer-create "*image-mode-test*") (insert (propertize "abc" 'display (list 'image "Definitely not an image."))) (image-mode)) twice. The second time results in an error and pop ups the debugger, with the following text, Debugger entered--Lisp error: (excessive-lisp-nesting 1601) display-images-p() image-mode() major-mode-restore((image-mode image-mode-as-text)) image-mode-to-text() image-mode-as-text() image-mode--display() image-mode() major-mode-restore((image-mode image-mode-as-text)) image-mode-to-text() image-mode-as-text() image-mode--display() image-mode() major-mode-restore((image-mode image-mode-as-text)) image-mode-to-text() image-mode-as-text() image-mode--display() image-mode() ... It is unclear to me why this doesn't happen the first time but I think sequence causing it the second time is as follows: 1. 'image-mode' calls 'major-mode-suspend' when 'major' mode is 'fundamental-mode'. So 'major-mode--suspended' is not set. 2. 'image-mode--display' catches error and call 'image-mode-as-text' which calls 'image-mode-to-text'. 3. 'image-mode-as-text' calls 'major-mode-restore' with '(image-mode image-mode-as-text) as mode to avoid. 4. Since major-mode--suspended was not set in step 1 'major-mode-restore' falls back to 'normal-mode' which calls 'image-mode' causing the loop. I think the simplest way of fixing this is to make sure that 'image-mode' doesn't call 'major-mode-suspend' with 'fundamental-mode' instead calling 'text-mode' or 'special-mode' before calling 'major-mode-suspend' if it starts in 'fundamental-mode'. Thanks, Rahguzar In GNU Emacs 29.2 (build 1, aarch64-redhat-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-02-02 built on 4f70ed73c5a14276aae52125608014aa System Description: Fedora Linux Asahi Remix 39 (Thirty Nine) Configured using: 'configure --build=aarch64-redhat-linux --host=aarch64-redhat-linux --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-cairo --with-dbus --with-gif --with-gpm=no --with-harfbuzz --with-jpeg --with-json --with-modules --with-native-compilation=aot --with-pgtk --with-png --with-rsvg --with-sqlite3 --with-tiff --with-tree-sitter --with-webp --with-xpm --with-xwidgets build_alias=aarch64-redhat-linux host_alias=aarch64-redhat-linux CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig CXX=g++ 'CXXFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: mu4e:main Minor modes in effect: global-evil-surround-mode: t evil-surround-mode: t shell-dirtrack-mode: t recentf-mode: t save-place-mode: t global-so-long-mode: t which-key-mode: t savehist-mode: t better-jumper-mode: t better-jumper-local-mode: t global-company-mode: t company-mode: t vertico-multiform-mode: t vertico-mode: t nerd-icons-completion-mode: t marginalia-mode: t evil-goggles-mode: t evil-escape-mode: t evil-snipe-override-mode: t evil-snipe-mode: t gcmh-mode: t winner-mode: t smartparens-global-mode: t ws-butler-global-mode: t undo-fu-session-global-mode: t undo-fu-mode: t satchel-mode: t mu4e-search-minor-mode: t global-hl-line-mode: t hl-line-mode: t mu4e-update-minor-mode: t mu4e-context-minor-mode: t dirvish-override-dired-mode: t server-mode: t pixel-scroll-precision-mode: t repeat-mode: t midnight-mode: t evil-mode: t evil-local-mode: t +popup-mode: t +modeline-global-mode: t +modeline-mode: t global-ligature-mode: t ligature-mode: t general-override-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t window-divider-mode: t buffer-read-only: t size-indication-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: /home/azeem/.emacs.d/.local/straight/build-29.2/emacsql/emacsql-sqlite-builtin hides /home/azeem/.emacs.d/.local/straight/build-29.2/emacsql-sqlite-builtin/emacsql-sqlite-builtin /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e hides /usr/share/emacs/site-lisp/mu4e/mu4e /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-window hides /usr/share/emacs/site-lisp/mu4e/mu4e-window /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-view hides /usr/share/emacs/site-lisp/mu4e/mu4e-view /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-vars hides /usr/share/emacs/site-lisp/mu4e/mu4e-vars /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-update hides /usr/share/emacs/site-lisp/mu4e/mu4e-update /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-speedbar hides /usr/share/emacs/site-lisp/mu4e/mu4e-speedbar /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-server hides /usr/share/emacs/site-lisp/mu4e/mu4e-server /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-search hides /usr/share/emacs/site-lisp/mu4e/mu4e-search /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-query-items hides /usr/share/emacs/site-lisp/mu4e/mu4e-query-items /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-org hides /usr/share/emacs/site-lisp/mu4e/mu4e-org /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-obsolete hides /usr/share/emacs/site-lisp/mu4e/mu4e-obsolete /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-notification hides /usr/share/emacs/site-lisp/mu4e/mu4e-notification /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-modeline hides /usr/share/emacs/site-lisp/mu4e/mu4e-modeline /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-message hides /usr/share/emacs/site-lisp/mu4e/mu4e-message /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-mark hides /usr/share/emacs/site-lisp/mu4e/mu4e-mark /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-main hides /usr/share/emacs/site-lisp/mu4e/mu4e-main /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-lists hides /usr/share/emacs/site-lisp/mu4e/mu4e-lists /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-icalendar hides /usr/share/emacs/site-lisp/mu4e/mu4e-icalendar /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-helpers hides /usr/share/emacs/site-lisp/mu4e/mu4e-helpers /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-headers hides /usr/share/emacs/site-lisp/mu4e/mu4e-headers /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-folders hides /usr/share/emacs/site-lisp/mu4e/mu4e-folders /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-draft hides /usr/share/emacs/site-lisp/mu4e/mu4e-draft /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-contrib hides /usr/share/emacs/site-lisp/mu4e/mu4e-contrib /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-context hides /usr/share/emacs/site-lisp/mu4e/mu4e-context /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-contacts hides /usr/share/emacs/site-lisp/mu4e/mu4e-contacts /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-config hides /usr/share/emacs/site-lisp/mu4e/mu4e-config /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-compose hides /usr/share/emacs/site-lisp/mu4e/mu4e-compose /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-bookmarks hides /usr/share/emacs/site-lisp/mu4e/mu4e-bookmarks /home/azeem/.emacs.d/.local/straight/build-29.2/mu4e/mu4e-actions hides /usr/share/emacs/site-lisp/mu4e/mu4e-actions /home/azeem/.emacs.d/.local/straight/build-29.2/transient/transient hides /usr/share/emacs/29.2/lisp/transient /home/azeem/.emacs.d/.local/straight/build-29.2/ef-themes/theme-loaddefs hides /usr/share/emacs/29.2/lisp/theme-loaddefs /home/azeem/.emacs.d/.local/straight/build-29.2/eww-hacks/shr hides /usr/share/emacs/29.2/lisp/net/shr /home/azeem/.emacs.d/.local/straight/build-29.2/eww-hacks/eww hides /usr/share/emacs/29.2/lisp/net/eww Features: (evil-collection-proced proced shadow emacsbug descr-text consult-imenu use-package-lint consult-flymake tabify files-x find-dired checkdoc bicycle hideshow package-lint-flymake package-lint evil-collection-finder finder finder-inf lisp-mnt evil-collection-package-menu doom-packages package url-handlers highlight-quoted rainbow-delimiters highlight-numbers parent-mode hl-todo evil-collection-elisp-mode elisp-mode evil-collection-help evil-collection-xref xref cl-print cus-start crm dired-x dirvish-emerge dired-aux evil-embrace embrace expand-region text-mode-expansions the-org-mode-expansions org-element org-persist xdg org-id org-refile avl-tree generator er-basic-expansions expand-region-core expand-region-custom evil-surround diredfl dirvish-subtree dirvish-icons dirvish-widgets vc-hg evil-collection-vc-git vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs evil-collection-log-view log-view pcvs-util vc vc-dispatcher bug-reference image-mode exif evil-collection-indent vertico-directory evil-collection-helpful helpful cc-langs cc-vars cc-defs evil-collection-imenu imenu trace evil-collection-edebug edebug evil-collection-debug debug backtrace info-look evil-collection-info info f help-fns radix-tree evil-collection-elisp-refs elisp-refs s mastodon-notifications evil-collection-view view password-store auth-source-pass with-editor shell gts-engine-deepl gts-implements gts-faces gts-core guess-language flyspell company-ispell company-yasnippet company-dabbrev delsel display-line-numbers adaptive-wrap jit-spell ispell face-remap recentf tree-widget saveplace evil-collection-so-long so-long whitespace jka-compr link-hint ffap goto-addr avy cursor-sensor vertico-repeat shr-color smerge-mode diff evil-collection-diff-mode diff-mode mm-archive gnus-fun qp sort smiley gnus-cite mail-extr gnus-async gnus-bcklg gnus-ml disp-table nndraft nnmh epa-file gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache hide-mode-line fabs evil-collection-consult consult mastodon-media textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check mastodon-profile mastodon-tl network-stream url-http url-gw nsm url-cache url-auth mastodon-auth mastodon-client plstore mastodon mastodon-search mastodon-toot facemenu mastodon-iso persist mastodon-http request evil-collection-which-key which-key savehist better-jumper company-capf company vertico-multiform evil-collection-vertico vertico orderless nerd-icons-completion marginalia evil-goggles pulse color evil-easymotion evil-escape evil-snipe gcmh winner smartparens-config smartparens-text smartparens loadhist dash ws-butler undo-fu-session undo-fu satchel ibuf-ext evil-collection-ibuffer ibuffer ibuffer-loaddefs desktop frameset evil-collection-mu4e mu4e mu4e-org evil-collection-org smartparens-org org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func org-version org-compat org-macs mu4e-notification notifications mu4e-main mu4e-view gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus autorevert filenotify gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win evil-collection-gnus gnus nnheader range evil-collection-calendar cal-menu calendar cal-loaddefs mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr pixel-fill kinsoku url-file svg dom browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source url-vars flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers mu4e-config mu4e-window evil-collection-bookmark bookmark ido message sendmail mailcap yank-media puny dirvish transient format-spec eieio eieio-core compat evil-collection-dired dired dired-loaddefs rfc822 mml mml-sec password-cache evil-collection-epa epa epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader mu4e-obsolete server dtrt-indent ef-spring-theme ef-themes pixel-scroll cua-base repeat midnight html2text evil-collection-flymake flymake-proc flymake project evil-collection-compile evil-collection-custom cus-edit cus-load wid-edit evil-collection-comint evil-collection annalist compile text-property-search comint ansi-osc ansi-color ibuf-macs evil evil-integration evil-maps evil-commands reveal evil-jumps evil-command-window evil-types evil-search evil-macros evil-repeat evil-states evil-core advice evil-common thingatpt rect evil-vars ring edmacro kmacro nerd-icons nerd-icons-faces nerd-icons-data nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon nerd-icons-data-pomicon nerd-icons-data-ipsicon ligature derived comp comp-cstr warnings icons rx doom-editor doom-projects doom-ui easy-mmode doom-keybinds pp cl-extra help-mode use-package-core general tex-site clang-rename clang-include-fixer let-alist json map byte-opt bytecomp byte-compile clang-format xml doom-start :system doom-modules cl-seq doom doom-lib cl-macs cl-loaddefs cl-lib gv harfbuzz jansson dynamic-modules pcase subr-x rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd 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 xwidget-internal dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 1947280 182804) (symbols 48 88871 56) (strings 32 823936 14118) (string-bytes 1 19318565) (vectors 16 145143) (vector-slots 8 3823080 197541) (floats 8 2295 1214) (intervals 56 74905 6680) (buffers 984 584)) From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 06:19:41 2024 Received: (at 69785) by debbugs.gnu.org; 21 Mar 2024 10:19:41 +0000 Received: from localhost ([127.0.0.1]:35198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnFWP-0003Vn-7G for submit@debbugs.gnu.org; Thu, 21 Mar 2024 06:19:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnFWM-0003Va-QI for 69785@debbugs.gnu.org; Thu, 21 Mar 2024 06:19:39 -0400 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 1rnFVc-0001Nx-7L; Thu, 21 Mar 2024 06:18:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5l4BAxAdH024IPzR7Wd6l1LlArXPCFyYfCz9EVwpcdA=; b=YvFGeLuL0enu XNJUh1QjF2CMFsvHIsJ8vpiyNLQPyrUkaxRBzd4o3aU6w0LPiENKFpr9sl1WlBuxRasYpDjvw2vRR Hf0aJ/Bknn30VjV3Iw44OalcsPFgZl8DaSor/SFhlS2Z3grilPlkwb73dL0z8fkSNiyB1k7bWLFbi 6ihT1/p4ZMXP9xdrfbQqbFWAXT/nrP5LgZNWxxS7T5Ran35UGGSp4D78XLSZ3XmV2kZd2Y4dsseEm HhLKOti9PMobB9ku7vh9yK/9dboTg7XRIMTum4Pll7AEusmkY3BCW8K6TlIlx1vSTV4hM+z2Gq5Ap D6FkmszT8quCp2IZlPrIbw==; Date: Thu, 21 Mar 2024 12:18:44 +0200 Message-Id: <86cyrn3n23.fsf@gnu.org> From: Eli Zaretskii To: Rahguzar In-Reply-To: <87edcdx17i.fsf@zohomail.eu> (bug-gnu-emacs@gnu.org) Subject: Re: bug#69785: 29.2; Image mode can loop due to invalid images References: <87edcdx17i.fsf@zohomail.eu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69785 Cc: 69785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 13 Mar 2024 22:13:55 +0100 > From: Rahguzar via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Dear Emacs developers, > > Starting with emacs -Q, evaluate > > (with-current-buffer (get-buffer-create "*image-mode-test*") > (insert (propertize "abc" 'display (list 'image "Definitely not an image."))) > (image-mode)) > > twice. > > The second time results in an error and pop ups the debugger, with the > following text, > > Debugger entered--Lisp error: (excessive-lisp-nesting 1601) > display-images-p() > image-mode() > major-mode-restore((image-mode image-mode-as-text)) > image-mode-to-text() > image-mode-as-text() > image-mode--display() > image-mode() > major-mode-restore((image-mode image-mode-as-text)) > image-mode-to-text() > image-mode-as-text() > image-mode--display() > image-mode() > major-mode-restore((image-mode image-mode-as-text)) > image-mode-to-text() > image-mode-as-text() > image-mode--display() > image-mode() > ... > > It is unclear to me why this doesn't happen the first time but I think > sequence causing it the second time is as follows: > > 1. 'image-mode' calls 'major-mode-suspend' when 'major' mode is > 'fundamental-mode'. So 'major-mode--suspended' is not set. > > 2. 'image-mode--display' catches error and call 'image-mode-as-text' > which calls 'image-mode-to-text'. > > 3. 'image-mode-as-text' calls 'major-mode-restore' with '(image-mode > image-mode-as-text) as mode to avoid. > > 4. Since major-mode--suspended was not set in step 1 > 'major-mode-restore' falls back to 'normal-mode' which calls > 'image-mode' causing the loop. > > I think the simplest way of fixing this is to make sure that > 'image-mode' doesn't call 'major-mode-suspend' with 'fundamental-mode' > instead calling 'text-mode' or 'special-mode' before calling > 'major-mode-suspend' if it starts in 'fundamental-mode'. How about the patch below instead? diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 355685e..fa64f1a 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -654,8 +654,9 @@ image-mode (unless (display-images-p) (error "Display does not support images")) - (major-mode-suspend) - (setq major-mode 'image-mode) + (unless (eq major-mode 'image-mode) + (major-mode-suspend) + (setq major-mode 'image-mode)) (setq image-transform-resize image-auto-resize) ;; Bail out early if we have no image data. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 13:41:27 2024 Received: (at 69785) by debbugs.gnu.org; 22 Mar 2024 17:41:27 +0000 Received: from localhost ([127.0.0.1]:38132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnitT-0002ze-4F for submit@debbugs.gnu.org; Fri, 22 Mar 2024 13:41:27 -0400 Received: from sender11.zoho.eu ([31.186.226.224]:37293 helo=sender-pp-o91.zoho.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnitO-0002zM-MD for 69785@debbugs.gnu.org; Fri, 22 Mar 2024 13:41:24 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1711128328; cv=none; d=zohomail.eu; s=zohoarc; b=ihv0wZ1U74rJTN9Ze8NohYSIuffH9iI3JhxVqsPRAEIViw2PbyLBTie4siiFIThfJ56UsHNXqdF5gI7102756Ox2xDt0ORgtKL0W7QCsHqDEtl8Yiw+XAHZGt58XwfxykHykCjJV71PHA135g6+ZDlJRy4TYs1UBSj85g6byT9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1711128328; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=vsaAQo8ty+FYyOqH6WLJMZXwg3Ctb5haZHgOVXcw0BY=; b=hU/0TyXuXKpMFvwIgzSlSiXGWj1aLbGtGsh19cxLKnvDhzhXFzuO2YWeA0aRFmSjt8yJcK7GVYSlvGvYiUhouzJ4WIOAtCYF2ppbxJHhbfx66tF4C4N0DTf+2WLtAYFUmuuadfzrIkwPGuKJOBli74ZZYqkCrxDU6seo3UXf8bU= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=zohomail.eu; spf=pass smtp.mailfrom=rahguzar@zohomail.eu; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1711128328; s=zoho; d=zohomail.eu; i=rahguzar@zohomail.eu; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=vsaAQo8ty+FYyOqH6WLJMZXwg3Ctb5haZHgOVXcw0BY=; b=S7U8MP91MX6p+qcUwOeFNs1iUzrSRI3me/hN6c4HHthNnTHhPudAMYgfx0OEaTPT yqz7/DGSEoNsCCHTQVghEFg0V7mlTy71Gc1P9/cH0DeLTdaarjLUk8K70CuBdQbkYv6 Tvbr5mYeXbM6Bn+RKA92C+fFEUuDOGEmBjzjZooc= Received: from localhost (emp-182-126.eduroam.uu.se [130.238.182.126]) by mx.zoho.eu with SMTPS id 1711128326957805.2095985578184; Fri, 22 Mar 2024 18:25:26 +0100 (CET) References: <87edcdx17i.fsf@zohomail.eu> <86cyrn3n23.fsf@gnu.org> User-agent: mu4e 1.10.5; emacs 29.2 From: Rahguzar To: Eli Zaretskii Subject: Re: bug#69785: 29.2; Image mode can loop due to invalid images Date: Fri, 22 Mar 2024 18:24:09 +0100 In-reply-to: <86cyrn3n23.fsf@gnu.org> Message-ID: <87wmpudvqy.fsf@zohomail.eu> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69785 Cc: 69785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Eli, The patch fixes the problem. Thanks, Rahguzar Eli Zaretskii writes: >> Date: Wed, 13 Mar 2024 22:13:55 +0100 >> From: Rahguzar via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> >> Dear Emacs developers, >> >> Starting with emacs -Q, evaluate >> >> (with-current-buffer (get-buffer-create "*image-mode-test*") >> (insert (propertize "abc" 'display (list 'image "Definitely not an image."))) >> (image-mode)) >> >> twice. >> >> The second time results in an error and pop ups the debugger, with the >> following text, >> >> Debugger entered--Lisp error: (excessive-lisp-nesting 1601) >> display-images-p() >> image-mode() >> major-mode-restore((image-mode image-mode-as-text)) >> image-mode-to-text() >> image-mode-as-text() >> image-mode--display() >> image-mode() >> major-mode-restore((image-mode image-mode-as-text)) >> image-mode-to-text() >> image-mode-as-text() >> image-mode--display() >> image-mode() >> major-mode-restore((image-mode image-mode-as-text)) >> image-mode-to-text() >> image-mode-as-text() >> image-mode--display() >> image-mode() >> ... >> >> It is unclear to me why this doesn't happen the first time but I think >> sequence causing it the second time is as follows: >> >> 1. 'image-mode' calls 'major-mode-suspend' when 'major' mode is >> 'fundamental-mode'. So 'major-mode--suspended' is not set. >> >> 2. 'image-mode--display' catches error and call 'image-mode-as-text' >> which calls 'image-mode-to-text'. >> >> 3. 'image-mode-as-text' calls 'major-mode-restore' with '(image-mode >> image-mode-as-text) as mode to avoid. >> >> 4. Since major-mode--suspended was not set in step 1 >> 'major-mode-restore' falls back to 'normal-mode' which calls >> 'image-mode' causing the loop. >> >> I think the simplest way of fixing this is to make sure that >> 'image-mode' doesn't call 'major-mode-suspend' with 'fundamental-mode' >> instead calling 'text-mode' or 'special-mode' before calling >> 'major-mode-suspend' if it starts in 'fundamental-mode'. > > How about the patch below instead? > > diff --git a/lisp/image-mode.el b/lisp/image-mode.el > index 355685e..fa64f1a 100644 > --- a/lisp/image-mode.el > +++ b/lisp/image-mode.el > @@ -654,8 +654,9 @@ image-mode > (unless (display-images-p) > (error "Display does not support images")) > > - (major-mode-suspend) > - (setq major-mode 'image-mode) > + (unless (eq major-mode 'image-mode) > + (major-mode-suspend) > + (setq major-mode 'image-mode)) > (setq image-transform-resize image-auto-resize) > > ;; Bail out early if we have no image data. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 23 03:54:06 2024 Received: (at 69785-done) by debbugs.gnu.org; 23 Mar 2024 07:54:06 +0000 Received: from localhost ([127.0.0.1]:33926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnwCb-0003rN-V2 for submit@debbugs.gnu.org; Sat, 23 Mar 2024 03:54:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnwCZ-0003qh-U1 for 69785-done@debbugs.gnu.org; Sat, 23 Mar 2024 03:54:04 -0400 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 1rnwBp-0006oT-8N; Sat, 23 Mar 2024 03:53:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=l6Xlap5e2MrsE2Fx3RoxuOHcw2mkaMjTHuyXMF5zay8=; b=CL964a/HWRmO WkNt3xBv1IWad6NhGGIVGChbreM6flt8Y6USkNJFRRLKDYs9SPb0h3uO5AXhnEmhKyQzFB8ytI0oI 693BeHXwi4cEiyjkPLNVp58AtJNl26w9VeYTAkhOa0/+ZJBDvHBoyf+VuOnn+tL4jn/8FRxPpDCdt SuEkgzmov890O1/Ziee7NrdIvUjDwJYMDtlfA5v9ea8RsVMcA1PV3v5Q1F23hmeHPYTDYKjFtr9s0 hQHgJp0Md+NaPzJ2PVOmRnARvGXxhuQCLS9zR4lhxZNKcDap1s+X2C9zaDF4nx7LdVuAKAdHJauXJ OxMOjse9csEN8KJrEyx46Q==; Date: Sat, 23 Mar 2024 09:53:16 +0200 Message-Id: <86edc1z8nn.fsf@gnu.org> From: Eli Zaretskii To: Rahguzar In-Reply-To: <87wmpudvqy.fsf@zohomail.eu> (message from Rahguzar on Fri, 22 Mar 2024 18:24:09 +0100) Subject: Re: bug#69785: 29.2; Image mode can loop due to invalid images References: <87edcdx17i.fsf@zohomail.eu> <86cyrn3n23.fsf@gnu.org> <87wmpudvqy.fsf@zohomail.eu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69785-done Cc: 69785-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Rahguzar > Cc: 69785@debbugs.gnu.org > Date: Fri, 22 Mar 2024 18:24:09 +0100 > > Hi Eli, > The patch fixes the problem. Thanks, installed on master, and closing the bug. From unknown Mon Aug 18 17:53:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Apr 2024 11:24:15 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator