joostkremers / writeroom-mode

Writeroom-mode: distraction-free writing for Emacs.
BSD 3-Clause "New" or "Revised" License
605 stars 28 forks source link

global-writeroom-mode breaks org mode export scope #68

Open B4rc1 opened 3 years ago

B4rc1 commented 3 years ago

When using (global-writeroom-mode) in my config.el and try to export with the scope of org mode changed to subtree, (hitting C-s during the export prompt) org just displays Args out of range: 1, 1 in my statusbar and does not produce any file. I have confirmed that i can export only the subtree by using writeroom-mode manually. I have tested this with emacs 27.1 and a bunch of 28 versions with and without native comp. I have experienced this on FreeBSD, on Arch and on Fedora 33. I use doom emacs, in case that's relevant.

joostkremers commented 3 years ago

I can't seem to reproduce this on Emacs 27. Would it be possible to produce a backtrace (M-x toggle-debug-on-error RET and then trigger the error) and post it here? That might be helpful.

B4rc1 commented 3 years ago
Debugger entered--Lisp error: (args-out-of-range 1 1)
  line-number-display-width()
  writeroom-full-line-number-width()
  writeroom--enable()
  writeroom-mode(1)
  turn-on-writeroom-mode()
  global-writeroom-mode-enable-in-buffers()
  run-hooks(after-change-major-mode-hook)
  run-mode-hooks(org-mode-hook)
  org-mode()
  (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode))
  (let ((inhibit-modification-hooks t)) (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode)) (set (make-local-variable 'org-hide-leading-stars) 't) (set (make-local-variable 'org-adapt-indentation) 'nil) (set (make-local-variable 'org-indent-mode) 't) (set (make-local-variable 'org-target-link-regexp) 'nil) (set (make-local-variable 'org-macro-templates) '(("date" . "") ("title" . "My Emacs config") ("email" . "") ("author" . "") ("input-file" . "config.org") ("modification-time" . "(eval\n(format-time-string $1\n   ...") ("n" . "(eval (org-macro--counter-increm...") ("keyword" . "(eval (org-macro--find-keyword-v...") ("time" . "(eval (format-time-string $1))") ("property" . "(eval (org-macro--get-property $..."))) (set (make-local-variable 'org-table-may-need-update) 't) (set (make-local-variable 'org-latex-and-related-regexp) '"") (set (make-local-variable 'org-todo-line-tags-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-complex-heading-regexp-format) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-complex-heading-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-todo-line-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-not-done-heading-regexp) '"^\\(\\*+\\)\\(?: +\\(HOLD\\|PROJ\\|STRT...") (set (make-local-variable 'org-not-done-regexp) '"\\(HOLD\\|PROJ\\|STRT\\|TODO\\|WAIT\\|...") (set (make-local-variable 'org-todo-regexp) '"\\(DONE\\|HOLD\\|KILL\\|PROJ\\|STRT\\|...") (set (make-local-variable 'org-not-done-keywords) '("TODO" "PROJ" "STRT" "WAIT" "HOLD" "[ ]" "[-]" "[?]")) (set (make-local-variable 'org-todo-log-states) 'nil) (set (make-local-variable 'org-todo-sets) '(("TODO" "PROJ" "STRT" "WAIT" "HOLD" "DONE" "KILL") ("[ ]" "[-]" "[?]" "[X]"))) (set (make-local-variable 'org-todo-heads) '("TODO" "[ ]")) (set (make-local-variable 'org-done-keywords) '("DONE" "KILL" "[X]")) (set (make-local-variable 'org-todo-keywords-1) '("TODO" "PROJ" "STRT" "WAIT" "HOLD" "DONE" "KILL" "[ ]" "[-]" "[?]" "[X]")) (set (make-local-variable 'org-todo-key-trigger) '(116 112 115 119 104 100 107 84 83 87 68)) (set (make-local-variable 'org-todo-key-alist) '((:startgroup) ("TODO" . 116) ("PROJ" . 112) ("STRT" . 115) ("WAIT" . 119) ("HOLD" . 104) ("DONE" . 100) ("KILL" . 107) (:endgroup) (:startgroup) ("[ ]" . 84) ("[-]" . 83) ("[?]" . 87) ("[X]" . 68) (:endgroup))) (set (make-local-variable 'org-todo-kwd-alist) '(("TODO" sequence "TODO" "DONE" "KILL") ("PROJ" sequence "TODO" "DONE" "KILL") ("STRT" sequence "TODO" "DONE" "KILL") ("WAIT" sequence "TODO" "DONE" "KILL") ("HOLD" sequence "TODO" "DONE" "KILL") ("DONE" sequence "TODO" "DONE" "KILL") ("KILL" sequence "TODO" "DONE" "KILL") ("[ ]" sequence "[ ]" "[X]" "[X]") ("[-]" sequence "[ ]" "[X]" "[X]") ("[?]" sequence "[ ]" "[X]" "[X]") ("[X]" sequence "[ ]" "[X]" "[X]"))) (set (make-local-variable 'org-table-formula-constants-local) 'nil) (set (make-local-variable 'org-keyword-properties) 'nil) (set (make-local-variable 'org-tag-groups-alist) 'nil) (set (make-local-variable 'org-current-tag-alist) 'nil) (set (make-local-variable 'org-file-tags) 'nil) (set (make-local-variable 'buffer-file-name) '"/home/jonas/.doom.d/config.org") ...)
  (lambda nil (let ((inhibit-modification-hooks t)) (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode)) (set (make-local-variable 'org-hide-leading-stars) 't) (set (make-local-variable 'org-adapt-indentation) 'nil) (set (make-local-variable 'org-indent-mode) 't) (set (make-local-variable 'org-target-link-regexp) 'nil) (set (make-local-variable 'org-macro-templates) '(... ... ... ... ... ... ... ... ... ...)) (set (make-local-variable 'org-table-may-need-update) 't) (set (make-local-variable 'org-latex-and-related-regexp) '"") (set (make-local-variable 'org-todo-line-tags-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-complex-heading-regexp-format) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-complex-heading-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-todo-line-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|HOLD\\|KILL...") (set (make-local-variable 'org-not-done-heading-regexp) '"^\\(\\*+\\)\\(?: +\\(HOLD\\|PROJ\\|STRT...") (set (make-local-variable 'org-not-done-regexp) '"\\(HOLD\\|PROJ\\|STRT\\|TODO\\|WAIT\\|...") (set (make-local-variable 'org-todo-regexp) '"\\(DONE\\|HOLD\\|KILL\\|PROJ\\|STRT\\|...") (set (make-local-variable 'org-not-done-keywords) '("TODO" "PROJ" "STRT" "WAIT" "HOLD" "[ ]" "[-]" "[?]")) (set (make-local-variable 'org-todo-log-states) 'nil) (set (make-local-variable 'org-todo-sets) '(... ...)) (set (make-local-variable 'org-todo-heads) '("TODO" "[ ]")) (set (make-local-variable 'org-done-keywords) '("DONE" "KILL" "[X]")) (set (make-local-variable 'org-todo-keywords-1) '("TODO" "PROJ" "STRT" "WAIT" "HOLD" "DONE" "KILL" "[ ]" "[-]" "[?]" "[X]")) (set (make-local-variable 'org-todo-key-trigger) '(116 112 115 119 104 100 107 84 83 87 68)) (set (make-local-variable 'org-todo-key-alist) '(... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (set (make-local-variable 'org-todo-kwd-alist) '(... ... ... ... ... ... ... ... ... ... ...)) (set (make-local-variable 'org-table-formula-constants-local) 'nil) (set (make-local-variable 'org-keyword-properties) 'nil) (set (make-local-variable 'org-tag-groups-alist) 'nil) (set (make-local-variable 'org-current-tag-alist) 'nil) (set (make-local-variable 'org-file-tags) 'nil) (set (make-local-variable 'buffer-file-name) '"/home/jonas/.doom.d/config.org") ...))()
  org-export-copy-buffer()
  #f(compiled-function (backend &optional subtreep visible-only body-only ext-plist) "Transcode current Org buffer into BACKEND code.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.\n\nIf narrowing is active in the current buffer, only transcode its\nnarrowed part.\n\nIf a region is active, transcode that region.\n\nWhen optional argument SUBTREEP is non-nil, transcode the\nsub-tree at point, extracting information from the headline\nproperties first.\n\nWhen optional argument VISIBLE-ONLY is non-nil, don't export\ncontents of hidden elements.\n\nWhen optional argument BODY-ONLY is non-nil, only return body\ncode, without surrounding template.\n\nOptional argument EXT-PLIST, when provided, is a property list\nwith external parameters overriding Org default settings, but\nstill inferior to file-local settings.\n\nReturn code as a string." #<bytecode 0x1c360d10dbcc104e>)(latex t nil nil (:output-file "config.tex"))
  apply(#f(compiled-function (backend &optional subtreep visible-only body-only ext-plist) "Transcode current Org buffer into BACKEND code.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.\n\nIf narrowing is active in the current buffer, only transcode its\nnarrowed part.\n\nIf a region is active, transcode that region.\n\nWhen optional argument SUBTREEP is non-nil, transcode the\nsub-tree at point, extracting information from the headline\nproperties first.\n\nWhen optional argument VISIBLE-ONLY is non-nil, don't export\ncontents of hidden elements.\n\nWhen optional argument BODY-ONLY is non-nil, only return body\ncode, without surrounding template.\n\nOptional argument EXT-PLIST, when provided, is a property list\nwith external parameters overriding Org default settings, but\nstill inferior to file-local settings.\n\nReturn code as a string." #<bytecode 0x1c360d10dbcc104e>) (latex t nil nil (:output-file "config.tex")))
  (let ((old-async-init-file org-export-async-init-file) (org-export-async-init-file (make-temp-file "doom-org-async-export"))) (let ((temp-file org-export-async-init-file) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (prin1 (list 'progn (list ... ... ... ... ...) (cons ... ...) (list ... org-export-async-init-file)) (current-buffer))) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (apply orig-fn args))
  +org--fix-async-export-a(#f(compiled-function (backend &optional subtreep visible-only body-only ext-plist) "Transcode current Org buffer into BACKEND code.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.\n\nIf narrowing is active in the current buffer, only transcode its\nnarrowed part.\n\nIf a region is active, transcode that region.\n\nWhen optional argument SUBTREEP is non-nil, transcode the\nsub-tree at point, extracting information from the headline\nproperties first.\n\nWhen optional argument VISIBLE-ONLY is non-nil, don't export\ncontents of hidden elements.\n\nWhen optional argument BODY-ONLY is non-nil, only return body\ncode, without surrounding template.\n\nOptional argument EXT-PLIST, when provided, is a property list\nwith external parameters overriding Org default settings, but\nstill inferior to file-local settings.\n\nReturn code as a string." #<bytecode 0x1c360d10dbcc104e>) latex t nil nil (:output-file "config.tex"))
  apply(+org--fix-async-export-a #f(compiled-function (backend &optional subtreep visible-only body-only ext-plist) "Transcode current Org buffer into BACKEND code.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.\n\nIf narrowing is active in the current buffer, only transcode its\nnarrowed part.\n\nIf a region is active, transcode that region.\n\nWhen optional argument SUBTREEP is non-nil, transcode the\nsub-tree at point, extracting information from the headline\nproperties first.\n\nWhen optional argument VISIBLE-ONLY is non-nil, don't export\ncontents of hidden elements.\n\nWhen optional argument BODY-ONLY is non-nil, only return body\ncode, without surrounding template.\n\nOptional argument EXT-PLIST, when provided, is a property list\nwith external parameters overriding Org default settings, but\nstill inferior to file-local settings.\n\nReturn code as a string." #<bytecode 0x1c360d10dbcc104e>) (latex t nil nil (:output-file "config.tex")))
  org-export-as(latex t nil nil (:output-file "config.tex"))
  #f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>)(latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>))
  apply(#f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) (latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>)))
  (let (before-save-hook after-save-hook) (apply orig-fn args))
  +org--dont-trigger-save-hooks-on-export-a(#f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>))
  apply(+org--dont-trigger-save-hooks-on-export-a #f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) (latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>)))
  #f(advice-wrapper :around #f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) +org--dont-trigger-save-hooks-on-export-a)(latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>))
  apply(#f(advice-wrapper :around #f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) +org--dont-trigger-save-hooks-on-export-a) (latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>)))
  (let ((old-async-init-file org-export-async-init-file) (org-export-async-init-file (make-temp-file "doom-org-async-export"))) (let ((temp-file org-export-async-init-file) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (prin1 (list 'progn (list ... ... ... ... ...) (cons ... ...) (list ... org-export-async-init-file)) (current-buffer))) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (apply orig-fn args))
  +org--fix-async-export-a(#f(advice-wrapper :around #f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) +org--dont-trigger-save-hooks-on-export-a) latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>))
  apply(+org--fix-async-export-a #f(advice-wrapper :around #f(compiled-function (backend file &optional async subtreep visible-only body-only ext-plist post-process) "Call `org-export-as' with output to a specified file.\n\nBACKEND is either an export back-end, as returned by, e.g.,\n`org-export-create-backend', or a symbol referring to\na registered back-end.  FILE is the name of the output file, as\na string.\n\nA non-nil optional argument ASYNC means the process should happen\nasynchronously.  The resulting buffer will then be accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as its\nargument and happens asynchronously when ASYNC is non-nil.  It\nhas to return a file name, or nil.  Export back-ends can use this\nto send the output file through additional processing, e.g,\n\n  (defun org-latex-export-to-latex\n    (&optional async subtreep visible-only body-only ext-plist)\n    (interactive)\n    (let ((outfile (org-export-output-file-name \".tex\" subtreep)))\n      (org-export-to-file \\='latex outfile\n        async subtreep visible-only body-only ext-plist\n        (lambda (file) (org-latex-compile file)))\n\nThe function returns either a file name returned by POST-PROCESS,\nor FILE." #<bytecode 0x7dd326c786ef74>) +org--dont-trigger-save-hooks-on-export-a) (latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>)))
  org-export-to-file(latex "config.tex" nil t nil nil nil #f(compiled-function (file) #<bytecode 0x12438b81f3b520ca>))
  org-latex-export-to-pdf(nil t nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)
joostkremers commented 3 years ago

This is strange... line-number-display-width is called once in writeroom-mode. It's called without argument, but that should be fine, because its single argument is optional.

I've gone through the following procedure with emacs -Q (actually, I'm using the Emacs sandbox script because it preconfigures Melpa):

This all works without issue. I'm using Emacs 27.1.91.

I also tried exporting to a LaTeX file (which I gather from the backtrace is what you're doing), but that also works fine.

So, yes, I'm beginning to suspect that Doom may have something to do with this. I took a quick look at the code that Doom adds, but there doesn't seem to be anything that might be problematic.

If you can reproduce the problem with emacs -Q (without Doom), please let me know. Otherwise you'll probably need to raise this issue with the Doom maintainers. If you do, feel free to mention me, so that I'm made aware of the thread and can join in if needed.