0

Adding (setq org-startup-with-inline-images t) trips debugger when opening an .org file with inline images. I've tested it both on Wayland and X11 and both on Mesa EGL and Nvidia. Same behavior in all cases.

Doom Emacs
GNU Emacs 28.2
Org mode version 9.7 (9.7-??-d6f3aed7b @ /home/user1/.config/emacs/.local/straight/build-28.2/org/)
OS: EndeavourOS Linux x86_64
Host: 81YT Lenovo Legion 7 15IMH05
Kernel: 6.4.6-arch1-1
DE: KDE
WM: KWin

inxi -G

Graphics:
  Device-1: Intel CometLake-H GT2 [UHD Graphics] driver: i915 v: kernel
  Device-2: NVIDIA TU104BM [GeForce RTX 2070 SUPER Mobile / Max-Q]
    driver: nvidia v: 535.86.05
  Display: server: X.Org v: 23.1.2 with: Xwayland v: 23.1.2 driver: X:
    loaded: modesetting dri: iris gpu: evdi,i915 resolution: 1: 1920x1080~60Hz
    2: 1920x1080~240Hz
  API: OpenGL v: 4.6 Mesa 23.1.4 renderer: Mesa Intel UHD Graphics (CML GT2)

I've turned that off, opened a file with debugger without inline images, run org-toggle-inline-images and error popped up again:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  get-char-property-and-overlay(nil org-image-overlay)
  org-display-user-inline-images(nil nil nil nil)
  apply(org-display-user-inline-images (nil nil nil nil))
  #f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is a link which follows either of these\nconventions:\n\n  1. Its path is a file with an extension matching return value\n     from `image-file-name-regexp' and it has no contents.\n\n  2. Its description consists in a single link of the previous\n     type.  In this case, that link must be a well-formed plain\n     or angle link, i.e., it must have an explicit \"file\" or\n     \"attachment\" type.\n\nEquip each image with the key-map `image-map'.\n\nWhen optional argument INCLUDE-LINKED is non-nil, also links with\na text description part will be inlined.  This can be nice for\na quick look at those images, but it does not reflect what\nexported files will look like.\n\nWhen optional argument REFRESH is non-nil, refresh existing\nimages between BEG and END.  This will create new image displays\nonly if necessary.\n\nBEG and END define the considered part.  They default to the\nbuffer boundaries with possible narrowing." (interactive "P") #<bytecode 0x113918429c3fe999>) org-display-user-inline-images)(nil nil nil nil)
  apply(#f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is a link which follows either of these\nconventions:\n\n  1. Its path is a file with an extension matching return value\n     from `image-file-name-regexp' and it has no contents.\n\n  2. Its description consists in a single link of the previous\n     type.  In this case, that link must be a well-formed plain\n     or angle link, i.e., it must have an explicit \"file\" or\n     \"attachment\" type.\n\nEquip each image with the key-map `image-map'.\n\nWhen optional argument INCLUDE-LINKED is non-nil, also links with\na text description part will be inlined.  This can be nice for\na quick look at those images, but it does not reflect what\nexported files will look like.\n\nWhen optional argument REFRESH is non-nil, refresh existing\nimages between BEG and END.  This will create new image displays\nonly if necessary.\n\nBEG and END define the considered part.  They default to the\nbuffer boundaries with possible narrowing." (interactive "P") #<bytecode 0x113918429c3fe999>) org-display-user-inline-images) (nil nil nil nil))
  (progn (fset #'create-image vnew) (apply fn args))
  (unwind-protect (progn (fset #'create-image vnew) (apply fn args)) (fset #'create-image old))
  (let* ((vnew #'(lambda (file-or-data &optional type data-p &rest props) "\n\n(fn FILE-OR-DATA &optional TYPE DATA-P &rest PRO..." (let ((type ...)) (apply create-image file-or-data type data-p props)))) (old (symbol-function #'create-image))) (unwind-protect (progn (fset #'create-image vnew) (apply fn args)) (fset #'create-image old)))
  (let ((create-image (symbol-function #'create-image))) (ignore create-image) (let* ((vnew #'(lambda (file-or-data &optional type data-p &rest props) "\n\n(fn FILE-OR-DATA &optional TYPE DATA-P &rest PRO..." (let (...) (apply create-image file-or-data type data-p props)))) (old (symbol-function #'create-image))) (unwind-protect (progn (fset #'create-image vnew) (apply fn args)) (fset #'create-image old))))
  +org--fix-inline-images-for-imagemagick-users-a(#f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is a link which follows either of these\nconventions:\n\n  1. Its path is a file with an extension matching return value\n     from `image-file-name-regexp' and it has no contents.\n\n  2. Its description consists in a single link of the previous\n     type.  In this case, that link must be a well-formed plain\n     or angle link, i.e., it must have an explicit \"file\" or\n     \"attachment\" type.\n\nEquip each image with the key-map `image-map'.\n\nWhen optional argument INCLUDE-LINKED is non-nil, also links with\na text description part will be inlined.  This can be nice for\na quick look at those images, but it does not reflect what\nexported files will look like.\n\nWhen optional argument REFRESH is non-nil, refresh existing\nimages between BEG and END.  This will create new image displays\nonly if necessary.\n\nBEG and END define the considered part.  They default to the\nbuffer boundaries with possible narrowing." (interactive "P") #<bytecode 0x113918429c3fe999>) org-display-user-inline-images) nil nil nil nil)
  apply(+org--fix-inline-images-for-imagemagick-users-a #f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is a link which follows either of these\nconventions:\n\n  1. Its path is a file with an extension matching return value\n     from `image-file-name-regexp' and it has no contents.\n\n  2. Its description consists in a single link of the previous\n     type.  In this case, that link must be a well-formed plain\n     or angle link, i.e., it must have an explicit \"file\" or\n     \"attachment\" type.\n\nEquip each image with the key-map `image-map'.\n\nWhen optional argument INCLUDE-LINKED is non-nil, also links with\na text description part will be inlined.  This can be nice for\na quick look at those images, but it does not reflect what\nexported files will look like.\n\nWhen optional argument REFRESH is non-nil, refresh existing\nimages between BEG and END.  This will create new image displays\nonly if necessary.\n\nBEG and END define the considered part.  They default to the\nbuffer boundaries with possible narrowing." (interactive "P") #<bytecode 0x113918429c3fe999>) org-display-user-inline-images) (nil nil nil nil))
  org-display-inline-images(nil nil nil nil)
  org-toggle-inline-images(nil)
  funcall-interactively(org-toggle-inline-images nil)
  call-interactively(org-toggle-inline-images record nil)
  command-execute(org-toggle-inline-images record)
  helm-M-x-execute-command(org-toggle-inline-images)
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  helm-internal((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1f4eec1ce0686f94>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f12 . #f(compiled-function () ... #<bytecode 0x1f401aa557ba80>)) (f11 . #f(compiled-function () ... #<bytecode 0x1f401aa556aa80>)) (f10 . #f(compiled-function () ... #<bytecode 0x1f401aa5509a80>)) (f9 . #f(compiled-function () ... #<bytecode 0x1f401aa5518a80>)) (f8 . #f(compiled-function () ... #<bytecode 0x1f401aa5687a80>)) (f7 . #f(compiled-function () ... #<bytecode 0x1f401aa5696a80>)) (f6 . #f(compiled-function () ... #<bytecode 0x1f401aa5595a80>)) (f5 . #f(compiled-function () ... #<bytecode 0x1f401aa5584a80>)) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc50ce8cbc56ea17>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x55bfc26bb228e73>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f12 . #f(compiled-function () ... #<bytecode 0x1f401aa557ba80>)) (f11 . #f(compiled-function () ... #<bytecode 0x1f401aa556aa80>)) (f10 . #f(compiled-function () ... #<bytecode 0x1f401aa5509a80>)) (f9 . #f(compiled-function () ... #<bytecode 0x1f401aa5518a80>)) (f8 . #f(compiled-function () ... #<bytecode 0x1f401aa5687a80>)) (f7 . #f(compiled-function () ... #<bytecode 0x1f401aa5696a80>)) (f6 . #f(compiled-function () ... #<bytecode 0x1f401aa5595a80>)) (f5 . #f(compiled-function () ... #<bytecode 0x1f401aa5584a80>)) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x8d178e7840c895c>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  apply(helm-internal ((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1f4eec1ce0686f94>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc50ce8cbc56ea17>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x55bfc26bb228e73>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x8d178e7840c895c>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history))
  helm((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1f4eec1ce0686f94>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f12 . #f(compiled-function () ... #<bytecode 0x1f401aa557ba80>)) (f11 . #f(compiled-function () ... #<bytecode 0x1f401aa556aa80>)) (f10 . #f(compiled-function () ... #<bytecode 0x1f401aa5509a80>)) (f9 . #f(compiled-function () ... #<bytecode 0x1f401aa5518a80>)) (f8 . #f(compiled-function () ... #<bytecode 0x1f401aa5687a80>)) (f7 . #f(compiled-function () ... #<bytecode 0x1f401aa5696a80>)) (f6 . #f(compiled-function () ... #<bytecode 0x1f401aa5595a80>)) (f5 . #f(compiled-function () ... #<bytecode 0x1f401aa5584a80>)) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc50ce8cbc56ea17>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x55bfc26bb228e73>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f12 . #f(compiled-function () ... #<bytecode 0x1f401aa557ba80>)) (f11 . #f(compiled-function () ... #<bytecode 0x1f401aa556aa80>)) (f10 . #f(compiled-function () ... #<bytecode 0x1f401aa5509a80>)) (f9 . #f(compiled-function () ... #<bytecode 0x1f401aa5518a80>)) (f8 . #f(compiled-function () ... #<bytecode 0x1f401aa5687a80>)) (f7 . #f(compiled-function () ... #<bytecode 0x1f401aa5696a80>)) (f6 . #f(compiled-function () ... #<bytecode 0x1f401aa5595a80>)) (f5 . #f(compiled-function () ... #<bytecode 0x1f401aa5584a80>)) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x8d178e7840c895c>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  apply(helm ((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1f4eec1ce0686f94>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc50ce8cbc56ea17>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x55bfc26bb228e73>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x8d178e7840c895c>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history))
  helm(:sources (((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1f4eec1ce0686f94>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f12 . #f(compiled-function () ... #<bytecode 0x1f401aa557ba80>)) (f11 . #f(compiled-function () ... #<bytecode 0x1f401aa556aa80>)) (f10 . #f(compiled-function () ... #<bytecode 0x1f401aa5509a80>)) (f9 . #f(compiled-function () ... #<bytecode 0x1f401aa5518a80>)) (f8 . #f(compiled-function () ... #<bytecode 0x1f401aa5687a80>)) (f7 . #f(compiled-function () ... #<bytecode 0x1f401aa5696a80>)) (f6 . #f(compiled-function () ... #<bytecode 0x1f401aa5595a80>)) (f5 . #f(compiled-function () ... #<bytecode 0x1f401aa5584a80>)) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc50ce8cbc56ea17>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x55bfc26bb228e73>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f12 . #f(compiled-function () ... #<bytecode 0x1f401aa557ba80>)) (f11 . #f(compiled-function () ... #<bytecode 0x1f401aa556aa80>)) (f10 . #f(compiled-function () ... #<bytecode 0x1f401aa5509a80>)) (f9 . #f(compiled-function () ... #<bytecode 0x1f401aa5518a80>)) (f8 . #f(compiled-function () ... #<bytecode 0x1f401aa5687a80>)) (f7 . #f(compiled-function () ... #<bytecode 0x1f401aa5696a80>)) (f6 . #f(compiled-function () ... #<bytecode 0x1f401aa5595a80>)) (f5 . #f(compiled-function () ... #<bytecode 0x1f401aa5584a80>)) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #f(compiled-function (candidates source) #<bytecode -0x129359f04d32b90b>) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x8d178e7840c895c>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) :prompt "M-x " :buffer "*helm M-x*" :history helm-M-x-input-history :truncate-lines t)
  helm-M-x-read-extended-command([## lsp-make-signature-help-options :closed-icon lsp:omnisharp-run-tests-in-class-request-column ccls-call-hierarchy-node jetbrains\ mono\ nl\ thin lsp-treemacs-cycle-severity mageia python-nav-beginning-of-defun-regexp eglot-reconnect curr-btn idx-max treemacs-dom-node->set-position! yas-x-prompt treemacs-icon-icon-refresh &error magit-buffer-lock-functions magit-xref-insert-button haskell-font-lock--put-face-on-type-or-constructor delphi-unit-statements treemacs-persp-scope edebug-mode-on-hook message-expand-name-databases :EndLineNumber er/looking-back-max :showDevDebugOutput traversed magit-list-modified-modules ns-l-compact-sequence which-key--stop-timer c-list-found-types byte-condition-case :mac isqrt helm-highlight-bookmark WatchKind lsp:set-rename-params-uri\? traversing\ a\ directory lsp-json-error\? lsp--virtual-buffer lsp:set-server-capabilities-document-symbol-provider\? :project-root dash-expand:&JSONResponse\? gud-target-name lsp:set-file-operation-pattern-options\? lsp-inlay-hint-face xref-group angle-bracket-arglist-escape exprs yaml--char-at-pos ...])
  helm-M-x(nil)
  funcall-interactively(helm-M-x nil)
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)

(setq org-startup-with-inline-images t):

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  get-char-property-and-overlay(nil org-image-overlay)
  org-display-user-inline-images()
  apply(org-display-user-inline-images nil)
  #f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is a link ... narrowing." (interactive "P") #<bytecode 0x113c8c5b51a7e999>) org-display-user-inline-images)()
  apply(#f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\n.... narrowing." (interactive "P") #<bytecode 0x113c8c5b51a7e999>) org-display-user-inline-images) nil)
  (progn (fset #'create-image vnew) (apply fn args))
  (unwind-protect (progn (fset #'create-image vnew) (apply fn args)) (fset #'create-image old))
  (let* ((vnew #'(lambda (file-or-data &optional type data-p &rest props) "\n\n(fn FILE-OR-DATA &optional TYPE DATA-P &rest PRO..." (let ((type ...)) (apply create-image file-or-data type data-p props)))) (old (symbol-function #'create-image))) (unwind-protect (progn (fset #'create-image vnew) (apply fn args)) (fset #'create-image old)))
  (let ((create-image (symbol-function #'create-image))) (ignore create-image) (let* ((vnew #'(lambda (file-or-data &optional type data-p &rest props) "\n\n(fn FILE-OR-DATA &optional TYPE DATA-P &rest PRO..." (let (...) (apply create-image file-or-data type data-p props)))) (old (symbol-function #'create-image))) (unwind-protect (progn (fset #'create-image vnew) (apply fn args)) (fset #'create-image old))))
  +org--fix-inline-images-for-imagemagick-users-a(#f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is ...e narrowing." (interactive "P") #<bytecode 0x113c8c5b51a7e999>) org-display-user-inline-images))
  apply(+org--fix-inline-images-for-imagemagick-users-a #f(advice-wrapper :after #f(compiled-function (&optional include-linked refresh beg end) "Display inline images.\n\nAn inline image is .... narrowing." (interactive "P") #<bytecode 0x113c8c5b51a7e999>) org-display-user-inline-images) nil)
  org-display-inline-images()
  org-mode()
  set-auto-mode-0(org-mode nil)
  ...
<TRUNCATED>
3
  • Hi, please add the versions of emacs and org-mode you are using, as well as distribution (you've already indicated Wayland). In addition, please, making no change other than switching away from Wayland, try again. If it turns out to be Wayland-specific, it might warrant your sending a message to the org mailing list.
    – Trevoke
    Jul 28, 2023 at 12:30
  • Thanks, I've added extra info. Will try back on X11 then. Maybe it's related to graphics - I will try using nvidia EGL as well. Jul 28, 2023 at 12:36
  • @Trevoke I've just tested all cases (Wayland, X11, with Mesa and Nvidia). Same behavior. Do you think this should be sent to the mailing list? I've never done this before. Jul 28, 2023 at 12:57

1 Answer 1

1

Since we have eliminated most things outside of emacs - I see you have org 9.7. Did you recently upgrade org? I know that org-mode is finnicky to upgrade, and I know that doom emacs has occasional problems in syncing that require deleting the entire package directory and doing a resync from scratch.

(I'm making this an answer because it could be the problem, but I sort of think it won't be).

One of the ways to see if we can narrow this down at least a little bit would be to open emacs without doom (emacs -Q to avoid using the init file) then opening an org-mode file there (this probably will be the version of org that ships with emacs, since we're not loading any other files) and trying this again. I expect that this will work properly.

If you look at the fifth line of the first debug log you shared, there's an advice-wrapper which means the function we're calling has a bunch of extensions/modifications to its behavior.

Assuming it works with unconfigured emacs and org-mode, the next step is to see if it works with just "doom emacs and org 9.7", which would require removing all doom plugins

when we remove the advice, so... Run emacs normally, loading doom.

Then evaluate the following lisp code:

(defun dkraj-advice-remove-all (symbol)
  "Remove all advice from function named SYMBOL."
  (advice-mapc (lambda (advice _props) (advice-remove symbol advice))
               symbol))

This will then let you easily remove advice (wrapper code) from all the org-mode functions we see in the debug log.. But this unfortunately you should probably do one at a time, starting with

(dkraj-advice-remove-all 'org-display-inline-images)

And next trying this one:

(dkraj-advice-remove-all 'org-display-user-inline-images)

It's important to note that it looks like multiple functions in this chain have advice on them, so there may be a cascading failure, or one failure hiding what would be another failure down the line.

In other words -- this might be something you need to bring up with doom emacs before you bring this up with org-mode itself.

6
  • Thank you and apologies for the late response - I've been trying to step through org-display-user-inline-images function with edebugger, but to no avail. I've just run emacs -Q, opened the .org file and run (org-toggle-inline-images) - image displayed without any error (nil). I'm looking now for a way to run "just "doom emacs and org 9.7" - haven't tried this before (maybe doom sandbox can do it). Thank you for mentioning the org-mode version - maybe downgrading to previous version could solve it as well? Jul 28, 2023 at 14:07
  • Sorry, I can't seem to find a way to isolate org 9.7 and doom emacs? Do you think that literally removing packages (rm -rf) from .config/emacs is the right way to do it? Jul 28, 2023 at 14:15
  • 1
    No; to isolate doom+org you need to go into your configuration and remove everything that is an org plugin (and in this case possibly things that are image plugins) - after which you will probably need to delete the package directory and run doom sync. The correct way to do it is probably somewhere in the doom configuration. I'm not a doom user, unfortunately, so I can't tell you how it works.
    – Trevoke
    Jul 28, 2023 at 14:18
  • Thank you again. I've removed packages.el and config.el, run doom sync, eveluated your dkraj-advice-remove-all and run it on 'org-display-inline-images - this worked. The error didn't appear when running org-toggle-inline-images. When running it on 'org-display-user-inline-images the error still appeared. As a bonus Wayland window manager had much easier time to position emacs frames with these plugins removed. I will start slowly reintroduce parts of package.el and config.el and see if they can be reduced. I will see if there is any way to list what advices exactly were there. Jul 28, 2023 at 15:11
  • 1
    Oh that last bit is easy, just open the help buffer for the function. The help buffer ... Helpfully... Lists all the advice :)
    – Trevoke
    Jul 28, 2023 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.