Closed armindarvish closed 7 months ago
I have a very specific and weird issue. For some reason, enabling org-modern-mode breaks xwidget-webkit-browse-url in the specific case that it is run within a header that is at the top of the document!
org-modern-mode
xwidget-webkit-browse-url
See the screenshot below:
Here is the backtrace:
Debugger entered--Lisp error: (wrong-type-argument listp #("◉" 0 1 (face org-modern-symbol))) xwidget-at(1) xwidget-webkit-current-session() xwidget-webkit-goto-url("https://orgmode.org/") xwidget-webkit-browse-url("https://orgmode.org/") (progn (xwidget-webkit-browse-url "https://orgmode.org/")) org-babel-execute:emacs-lisp("\n(xwidget-webkit-browse-url \"https://orgmode.org/\"..." ((:colname-names) (:rowname-names) (:result-params "none") (:result-type . value) (:results . "none") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:lexical . "no"))) org-babel-execute-src-block(nil ("emacs-lisp" "\n(xwidget-webkit-browse-url \"https://orgmode.org/\"..." ((:colname-names) (:rowname-names) (:result-params "none") (:result-type . value) (:results . "none") (:exports . "code") (:lexical . "no") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 201 "(ref:%s)")) (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-block-info nil context))) (let nil (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-block-info nil context)))) (cond ((memq type '(src-block inline-src-block)) (let nil (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-block-info nil context))))) ((org-match-line "[ \11]*$") (let nil (or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))) ((memq type '(inline-babel-call babel-call)) (let nil (let ((info (org-babel-lob-get-info context))) (if info (progn (org-babel-execute-src-block nil info nil type)))))) ((eq type 'clock) (let nil (if (org-at-timestamp-p 'lax) (org-timestamp-change 0 'day) (org-clock-update-time-maybe)))) ((eq type 'dynamic-block) (let nil (save-excursion (goto-char (org-element-post-affiliated context)) (org-update-dblock)))) ((eq type 'footnote-definition) (let nil (goto-char (org-element-post-affiliated context)) (call-interactively 'org-footnote-action))) ((eq type 'footnote-reference) (let nil (call-interactively #'org-footnote-action))) ((memq type '(inlinetask headline)) (let nil (save-excursion (goto-char (org-element-begin context)) (call-interactively #'org-set-tags-command)))) ((eq type 'item) (let nil (if (or radio-list-p (and (boundp org-list-checkbox-radio-mode) org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* ((box (org-element--property :checkbox context nil nil)) (struct (let* ... ...)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-not-nil ...))) (org-list-set-checkbox (org-element-begin context) struct (cond (... "[-]") (... "[ ]") (... nil) (... "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ((block-item ...)) (if (and box ...) (if ... ... ...) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)) (if block-item (progn ...))))))) ((eq type 'plain-list) (let nil (if (or radio-list-p (and (boundp org-list-checkbox-radio-mode) org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* ((begin (org-element-contents-begin context)) (struct (let* ... ...)) (old-struct (copy-tree struct)) (first-box (save-excursion ... ... ...)) (new-box (cond ... ... ... ...))) (cond (arg (let ... ...)) ((and first-box ...) (org-list-set-checkbox begin struct new-box))) (if (equal (org-list-write-struct struct ... old-struct) old-struct) (progn (message "Cannot update this checkbox"))) (org-update-checkbox-count-maybe))))) ((eq type 'keyword) (let nil (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp 'org-table-coordinate-overlays) (progn (mapc #'delete-overlay org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) (let* ((--regions (org-fold-core-get-regions :with-markers ...))) (unwind-protect (progn (org-mode-restart)) (save-excursion (save-restriction ... ... ...))))) (message "Local setup has been refreshed"))) ((memq type '(node-property property-drawer)) (let nil (call-interactively #'org-property-action))) ((eq type 'radio-target) (let nil (call-interactively #'org-update-radio-target-regexp))) ((eq type 'statistics-cookie) (let nil (call-interactively #'org-update-statistics-cookies))) ((memq type '(table-row table-cell table)) (let nil (cond ((and (org-match-line "[ \11]*#\\+plot:") (< (point) (org-element-post-affiliated context))) (org-plot/gnuplot)) ((eq (org-element--property :type context nil nil) 'table.el) (message "%s" (substitute-command-keys "\\<org-mode-map>Use `\\[org-edit-special]' to edit t..."))) ((or (eq type 'table) (and (eq type ...) (= ... ...))) (save-excursion (if (org-at-TBLFM-p) (progn ... ...) (goto-char ...) (org-call-with-arg ... ...) (orgtbl-send-table ...)))) (t (org-table-maybe-eval-formula) (cond (arg (call-interactively ...)) ((org-table-maybe-recalculate-line)) (t (org-table-align))))))) ((eq type 'timestamp) (funcall pcase-1)) ((eq type 'planning) (cond ((org-at-timestamp-p 'lax) (funcall pcase-1)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) ((null type) (cond ((org-at-heading-p) (let nil (call-interactively #'org-set-tags-command))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0))) (let* ((pcase-1 #'(lambda nil (org-timestamp-change 0 'day))) (pcase-0 #'(lambda nil (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))) (cond ((memq type '(src-block inline-src-block)) (let nil (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-block-info nil context))))) ((org-match-line "[ \11]*$") (let nil (or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))) ((memq type '(inline-babel-call babel-call)) (let nil (let ((info (org-babel-lob-get-info context))) (if info (progn (org-babel-execute-src-block nil info nil type)))))) ((eq type 'clock) (let nil (if (org-at-timestamp-p 'lax) (org-timestamp-change 0 'day) (org-clock-update-time-maybe)))) ((eq type 'dynamic-block) (let nil (save-excursion (goto-char (org-element-post-affiliated context)) (org-update-dblock)))) ((eq type 'footnote-definition) (let nil (goto-char (org-element-post-affiliated context)) (call-interactively 'org-footnote-action))) ((eq type 'footnote-reference) (let nil (call-interactively #'org-footnote-action))) ((memq type '(inlinetask headline)) (let nil (save-excursion (goto-char (org-element-begin context)) (call-interactively #'org-set-tags-command)))) ((eq type 'item) (let nil (if (or radio-list-p (and (boundp org-list-checkbox-radio-mode) org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* ((box ...) (struct ...) (old-struct ...) (parents ...) (prevs ...) (orderedp ...)) (org-list-set-checkbox (org-element-begin context) struct (cond ... ... ... ... ...)) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let (...) (if ... ... ... ...) (if block-item ...)))))) ((eq type 'plain-list) (let nil (if (or radio-list-p (and (boundp org-list-checkbox-radio-mode) org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* ((begin ...) (struct ...) (old-struct ...) (first-box ...) (new-box ...)) (cond (arg ...) (... ...)) (if (equal ... old-struct) (progn ...)) (org-update-checkbox-count-maybe))))) ((eq type 'keyword) (let nil (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp 'org-table-coordinate-overlays) (progn (mapc ... org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) (let* ((--regions ...)) (unwind-protect (progn ...) (save-excursion ...)))) (message "Local setup has been refreshed"))) ((memq type '(node-property property-drawer)) (let nil (call-interactively #'org-property-action))) ((eq type 'radio-target) (let nil (call-interactively #'org-update-radio-target-regexp))) ((eq type 'statistics-cookie) (let nil (call-interactively #'org-update-statistics-cookies))) ((memq type '(table-row table-cell table)) (let nil (cond ((and (org-match-line "[ \11]*#\\+plot:") (< ... ...)) (org-plot/gnuplot)) ((eq (org-element--property :type context nil nil) 'table.el) (message "%s" (substitute-command-keys "\\<org-mode-map>Use `\\[org-edit-special]' to edit t..."))) ((or (eq type ...) (and ... ...)) (save-excursion (if ... ... ... ... ...))) (t (org-table-maybe-eval-formula) (cond (arg ...) (...) (t ...)))))) ((eq type 'timestamp) (funcall pcase-1)) ((eq type 'planning) (cond ((org-at-timestamp-p 'lax) (funcall pcase-1)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) ((null type) (cond ((org-at-heading-p) (let nil (call-interactively #'org-set-tags-command))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) (let* ((context (org-element-lineage (org-element-context) '(babel-call clock dynamic-block footnote-definition footnote-reference inline-babel-call inline-src-block inlinetask item keyword node-property paragraph plain-list planning property-drawer radio-target src-block statistics-cookie table table-cell table-row timestamp) t)) (radio-list-p (org-at-radio-list-p)) (type (org-element-type context))) (if (eq type 'paragraph) (progn (let ((parent (org-element-parent context))) (if (and (eq (org-element-type parent t) 'item) (= (line-beginning-position) (org-element-begin parent))) (progn (setq context parent) (setq type 'item)))))) (let* ((pcase-1 #'(lambda nil (org-timestamp-change 0 'day))) (pcase-0 #'(lambda nil (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))) (cond ((memq type '(src-block inline-src-block)) (let nil (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-block-info nil context))))) ((org-match-line "[ \11]*$") (let nil (or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))) ((memq type '(inline-babel-call babel-call)) (let nil (let ((info ...)) (if info (progn ...))))) ((eq type 'clock) (let nil (if (org-at-timestamp-p 'lax) (org-timestamp-change 0 'day) (org-clock-update-time-maybe)))) ((eq type 'dynamic-block) (let nil (save-excursion (goto-char (org-element-post-affiliated context)) (org-update-dblock)))) ((eq type 'footnote-definition) (let nil (goto-char (org-element-post-affiliated context)) (call-interactively 'org-footnote-action))) ((eq type 'footnote-reference) (let nil (call-interactively #'org-footnote-action))) ((memq type '(inlinetask headline)) (let nil (save-excursion (goto-char (org-element-begin context)) (call-interactively #'org-set-tags-command)))) ((eq type 'item) (let nil (if (or radio-list-p (and ... org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* (... ... ... ... ... ...) (org-list-set-checkbox ... struct ...) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ... ... ...))))) ((eq type 'plain-list) (let nil (if (or radio-list-p (and ... org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* (... ... ... ... ...) (cond ... ...) (if ... ...) (org-update-checkbox-count-maybe))))) ((eq type 'keyword) (let nil (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp ...) (progn ... ...)) (let* (...) (unwind-protect ... ...))) (message "Local setup has been refreshed"))) ((memq type '(node-property property-drawer)) (let nil (call-interactively #'org-property-action))) ((eq type 'radio-target) (let nil (call-interactively #'org-update-radio-target-regexp))) ((eq type 'statistics-cookie) (let nil (call-interactively #'org-update-statistics-cookies))) ((memq type '(table-row table-cell table)) (let nil (cond ((and ... ...) (org-plot/gnuplot)) ((eq ... ...) (message "%s" ...)) ((or ... ...) (save-excursion ...)) (t (org-table-maybe-eval-formula) (cond ... ... ...))))) ((eq type 'timestamp) (funcall pcase-1)) ((eq type 'planning) (cond ((org-at-timestamp-p 'lax) (funcall pcase-1)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) ((null type) (cond ((org-at-heading-p) (let nil (call-interactively ...))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0)))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0))))) (cond ((and (boundp 'org-columns-overlays) org-columns-overlays) (org-columns-quit)) ((or (and (boundp 'org-clock-overlays) org-clock-overlays) org-occur-highlights) (if (boundp 'org-clock-overlays) (progn (org-clock-remove-overlays))) (org-remove-occur-highlights) (message "Temporary highlights/overlays removed from current...")) ((and (local-variable-p 'org-finish-function) (fboundp org-finish-function)) (funcall org-finish-function)) ((org-babel-hash-at-point)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-hook)) (t (let* ((context (org-element-lineage (org-element-context) '(babel-call clock dynamic-block footnote-definition footnote-reference inline-babel-call inline-src-block inlinetask item keyword node-property paragraph plain-list planning property-drawer radio-target src-block statistics-cookie table table-cell table-row timestamp) t)) (radio-list-p (org-at-radio-list-p)) (type (org-element-type context))) (if (eq type 'paragraph) (progn (let ((parent ...)) (if (and ... ...) (progn ... ...))))) (let* ((pcase-1 #'(lambda nil ...)) (pcase-0 #'(lambda nil ...))) (cond ((memq type '...) (let nil (if org-babel-no-eval-on-ctrl-c-ctrl-c nil ... ...))) ((org-match-line "[ \11]*$") (let nil (or ... ...))) ((memq type '...) (let nil (let ... ...))) ((eq type 'clock) (let nil (if ... ... ...))) ((eq type 'dynamic-block) (let nil (save-excursion ... ...))) ((eq type 'footnote-definition) (let nil (goto-char ...) (call-interactively ...))) ((eq type 'footnote-reference) (let nil (call-interactively ...))) ((memq type '...) (let nil (save-excursion ... ...))) ((eq type 'item) (let nil (if ... ... ...))) ((eq type 'plain-list) (let nil (if ... ... ...))) ((eq type 'keyword) (let nil (let ... ... ...) (message "Local setup has been refreshed"))) ((memq type '...) (let nil (call-interactively ...))) ((eq type 'radio-target) (let nil (call-interactively ...))) ((eq type 'statistics-cookie) (let nil (call-interactively ...))) ((memq type '...) (let nil (cond ... ... ... ...))) ((eq type 'timestamp) (funcall pcase-1)) ((eq type 'planning) (cond (... ...) (... ...) (t ...))) ((null type) (cond (... ...) (... ...) (t ...))) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) 'nil) (t (funcall pcase-0))))))) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) command-execute(org-ctrl-c-ctrl-c)
I have a very specific and weird issue. For some reason, enabling
org-modern-mode
breaksxwidget-webkit-browse-url
in the specific case that it is run within a header that is at the top of the document!See the screenshot below:
Here is the backtrace: