From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uJAnHMSNaWFfyQAAgWs5BA (envelope-from ) for ; Fri, 15 Oct 2021 16:18:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id iAqwF8SNaWEycAAAbx9fmQ (envelope-from ) for ; Fri, 15 Oct 2021 14:18:44 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CA7D6EE2C for ; Fri, 15 Oct 2021 16:18:42 +0200 (CEST) Received: from localhost ([::1]:51816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbO2i-0002LU-R1 for larch@yhetil.org; Fri, 15 Oct 2021 10:18:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbO1p-0002LK-FQ for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 10:17:45 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:41597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbO1i-0001YY-Sv for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 10:17:41 -0400 Received: by mail-pg1-x52f.google.com with SMTP id d23so8735103pgh.8 for ; Fri, 15 Oct 2021 07:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=1oANS+38++MsLb8EjJlihCeCmChR57PJ9pIj5dX4so0=; b=mI3Ugn2WxFxMkJT8y9AcK5Oi8W3dCoKS55ZhScq3ZsrqTjg5qfbYWDWYvJ0KZ2OYEJ Os2lymLxoz2Lle6guVwPXp2eF5T+iREEiyvfaoZxPsXKfO7BbqG7KCybTpBD3LJtbbWO 9pV/Xo9X0AzA7tDh/hiWufVvfKWxuqv9T1KzfPG7U5s451wwfNPHt/RdnEAjkM/wYmMM w5tglzsTxzY/n/cZb+RGANTYfg0OeIo1haavGBvnBdSt2MIr6wQW+uXKxI6FmbNi5sIb PAWK+bWOSrKptALNgTE0y9bIRV02M6/d97fihj4BegTtVUs7Km+mzTm7UjS45ygRKgzA Nd7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=1oANS+38++MsLb8EjJlihCeCmChR57PJ9pIj5dX4so0=; b=j+IVYL2fRwIg3vvmKhOXXApGtsfDWfFhRCBzKo79ZS2LxI1VrIo1L3nZNnPvkSzy4X fyghEagPdI8jLFnogp0TsUNgY0zgS3m976J+ohiN3TWkJTJ+7SJ1F7m6OsIi0RgKmuZm Lel8BoFdOF5LB7BXB84CL9nqOCCwrnyGIO9nzI+7IYtaIgAVI1caMZ5UKcKzvJT4MFht 7t7dj6OlGGnZSxlEK26Jjr0VKi5wj+IcTIcXD/bZd5TF01gKJU6DHXyjEwoayzQ+cfjO 5yL6IvSrZ2meT8FyHi1oWzabVqeE0yJIGyoiaXvq7rartfKy+ELiwABQOvMXUrAfTutN i8sg== X-Gm-Message-State: AOAM530mUzxT+ypWJuRBKM9HihRtlKKJkGABhRsQjin8oMf2kQyK0fnH s+2wdOFeIESHLwiQnmK372L5zsmtzig= X-Google-Smtp-Source: ABdhPJwm9g3OFcUokdbwTWbGSd0nGz6oLUCvv3NxbnnkWLr/S3M2lV4oSrJmULm0ldOUKVpbnb/svw== X-Received: by 2002:a05:6a00:1352:b0:44d:4573:3ac2 with SMTP id k18-20020a056a00135200b0044d45733ac2mr12185282pfu.12.1634307456381; Fri, 15 Oct 2021 07:17:36 -0700 (PDT) Received: from LH-K42 ([103.142.141.217]) by smtp.gmail.com with ESMTPSA id oc8sm5344743pjb.15.2021.10.15.07.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:17:36 -0700 (PDT) From: Liu Hui To: emacs-orgmode@gnu.org Subject: [BUG] Inline images cannot be displayed [9.5 (release_9.5-108-g93132c @ /tmp/org-mode/lisp/)] Date: Fri, 15 Oct 2021 22:17:10 +0800 Message-ID: <87h7djf2c8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=liuhui1610@gmail.com; helo=mail-pg1-x52f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634307524; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1oANS+38++MsLb8EjJlihCeCmChR57PJ9pIj5dX4so0=; b=nWZk68FyyNfBtH4XI/a9GsLp4F2QMVXHZ0qfvCuV/lJakOQlhCB5iQUaE5NS0mVuQYeGpW CfLqDvCntQzIMMpooghnOU6pLOvbr0XUHIayqHr1NIZR4l97eMcgqKT5Te8oNBa9TZsfjq jcR2etVfqSHnf2Hvbnd+sDqhMFsKG7WKb746V88VOCztxw1HGSyvAKCsoeqkr+PzswI8vp hFhrP1sjId3xnHuvCTr2U8sejBDYm8fUin3NnNNzfd3sKor9yx0LRtk9i/BIdswsJdcoQf /WeJi6S3FujUY8T3YqQN0HzBkb+QDEncv2rVbsbm9V29Swyx/rOJ04rSmYsumQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634307524; a=rsa-sha256; cv=none; b=gOAVEm6y7plgz4a8J2fBgOzIpEs84BOhJDgQeexh3za5lQDKVd1WqMc6uJqBT5BW8voOXG 5wgMufP8prc+NVYUS8RjMgIwzMt1LyQKpCwbK2utF9iK7pCQJo84VMGg+9w1f1j47lVVCZ JsmsklSlRI1rhQ1WGmBUYvwoaw4BRQWkR4RtNOLIAd8LTt8yleaw/IBlOWTU2wfb54c/4M TOTocG2IjObFJp/VBE1q7VFqvKcZAk6WenplImMFhVRZ++TUq54yDamGSVEIWAwa2OCvYj 1qMrzJ5o5NWCuxdEv6ppuTsfZOQp6VS5hjL3wSgzETI+TK0qi8TGbZ+xu0rTvA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mI3Ugn2W; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mI3Ugn2W; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: CA7D6EE2C X-Spam-Score: -1.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: AhNTvmlK6+Wz Hi, Org mode cannot display inline images because of an error caused by org-display-inline-image--width. It seems display-line-numbers-width is regarded as a number unconditionally. Recipe: 1. emacs -Q 2. Make the following settings: (setq org-image-actual-width nil) (setq org-startup-with-inline-images t) 3. Open some org-mode file containing image links, e.g. #+attr_org: :width 50% [[file:~/test.jpg]] Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) -(80 nil) (or (and (and (boundp 'visual-fill-column-mode) visual-fill-column-mode) (or visual-fill-column-width auto-fill-function)) (if auto-fill-function (progn fill-column)) (- (window-text-width) display-line-numbers-width)) (/ (or (and (and (boundp 'visual-fill-column-mode) visual-fill-column-mode) (or visual-fill-column-width auto-fill-function)) (if auto-fill-function (progn fill-column)) (- (window-text-width) display-line-numbers-width)) (float (window-total-width))) (* width (window-pixel-width) (/ (or (and (and (boundp 'visual-fill-column-mode) visual-fill-column-mode) (or visual-fill-column-width auto-fill-function)) (if auto-fill-function (progn fill-column)) (- (window-text-width) display-line-numbers-width)) (float (window-total-width)))) (round (* width (window-pixel-width) (/ (or (and (and (boundp 'visual-fill-column-mode) visual-fill-column-mode) (or visual-fill-column-width auto-fill-function)) (if auto-fill-function (progn fill-column)) (- (window-text-width) display-line-numbers-width)) (float (window-total-width))))) (if (and (floatp width) (<= 0.0 width 2.0)) (round (* width (window-pixel-width) (/ (or (and (and (boundp ...) visual-fill-column-mode) (or visual-fill-column-width auto-fill-function)) (if auto-fill-function (progn fill-column)) (- (window-text-width) display-line-numbers-width)) (float (window-total-width))))) width) (let* ((case-fold-search t) (par (org-element-lineage link '(paragraph))) (attr-re "^[ \11]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)") (par-end (org-element-property :post-affiliated par)) (attr-width (if (and par (let ((--mpom ...)) (save-excursion (if ... ...) (save-excursion ...)))) (progn (match-string 1)))) (attr-width-val (cond ((null attr-width) nil) ((string-match-p "\\`[0-9.]+%" attr-width) (/ (string-to-number attr-width) 100.0)) (t (string-to-number attr-width)))) (width (or attr-width-val (car org-image-actual-width)))) (if (and (floatp width) (<= 0.0 width 2.0)) (round (* width (window-pixel-width) (/ (or (and (and ... visual-fill-column-mode) (or visual-fill-column-width auto-fill-function)) (if auto-fill-function (progn fill-column)) (- (window-text-width) display-line-numbers-width)) (float (window-total-width))))) width)) (cond ((eq org-image-actual-width t) nil) ((listp org-image-actual-width) (let* ((case-fold-search t) (par (org-element-lineage link '(paragraph))) (attr-re "^[ \11]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)") (par-end (org-element-property :post-affiliated par)) (attr-width (if (and par (let ... ...)) (progn (match-string 1)))) (attr-width-val (cond ((null attr-width) nil) ((string-match-p "\\`[0-9.]+%" attr-width) (/ ... 100.0)) (t (string-to-number attr-width)))) (width (or attr-width-val (car org-image-actual-width)))) (if (and (floatp width) (<= 0.0 width 2.0)) (round (* width (window-pixel-width) (/ (or ... ... ...) (float ...)))) width))) ((numberp org-image-actual-width) org-image-actual-width) (t nil)) org-display-inline-image--width((link (:type "file" :path "~/test.jpg" :format bracket :raw-link "file:~/test.jpg" :application nil :search-option nil :begin 25 :end 51 :contents-begin nil :contents-end nil :post-blank 0 :parent (paragraph (:begin 2 :end 52 :contents-begin 25 :contents-end 52 :post-blank 0 :post-affiliated 25 :attr_org (":width 50%") :parent nil))))) Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-09-22 Package: Org mode version 9.5 (release_9.5-108-g93132c @ /tmp/org-mode/lisp/)