[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG] Inline images cannot be displayed [9.5 (release_9.5-108-g93132c @
From: |
Liu Hui |
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 |
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/)
- [BUG] Inline images cannot be displayed [9.5 (release_9.5-108-g93132c @ /tmp/org-mode/lisp/)],
Liu Hui <=