0

Running Doom Emacs 2.0.9 on Emacs 27.1.

When I select part of an org file containing only text with some editing markup and export it to a latex buffer, it produces an error:

ad-enable-advice: ad-enable-advice: ‘replace-highlight’ is not advised.

On turning toggle-debug-on-error, it produces:

Debugger entered--Lisp error: (error "ad-enable-advice: ‘replace-highlight’ is not advis...")
  signal(error ("ad-enable-advice: ‘replace-highlight’ is not advis..."))
  error("ad-enable-advice: `%s' is not advised" replace-highlight)
  ad-enable-advice(replace-highlight before preview)
  #f(compiled-function (symbol value) #<bytecode 0x1579b9b9dec5>)(preview-query-replace-reveal t)
  custom-initialize-reset(preview-query-replace-reveal (funcall #'#f(compiled-function () #<bytecode 0x1579b9b9deb9>)))
  custom-declare-variable(preview-query-replace-reveal (funcall #'#f(compiled-function () #<bytecode 0x1579b9b9deb9>)) "Make `query-replace' autoreveal previews." :group preview-appearance :type boolean :require preview :set #f(compiled-function (symbol value) #<bytecode 0x1579b9b9dec5>) :initialize custom-initialize-reset)
  byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317&\15\207" [custom-declare-variable preview-query-replace-reveal funcall function #f(compiled-function () #<bytecode 0x1579b9b9deb9>) "Make `query-replace' autoreveal previews." :group preview-appearance :type boolean :require preview :set #f(compiled-function (symbol value) #<bytecode 0x1579b9b9dec5>) :initialize custom-initialize-reset] 14)
  LaTeX-preview-setup()
  run-hooks(change-major-mode-after-body-hook text-mode-hook TeX-mode-hook LaTeX-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook TeX-mode-hook LaTeX-mode-hook))
  run-mode-hooks(text-mode-hook TeX-mode-hook LaTeX-mode-hook)
  TeX-latex-mode()
  apply(TeX-latex-mode nil)
  LaTeX-mode()
  (closure ((ext-plist) (body-only) (visible-only) (subtreep) (async) t) nil (LaTeX-mode))()
  funcall((closure ((ext-plist) (body-only) (visible-only) (subtreep) (async) t) nil (LaTeX-mode)))
  (and (functionp post-process) (funcall post-process))
  (save-current-buffer (set-buffer buffer) (erase-buffer) (setq buffer-file-coding-system encoding) (insert output) (goto-char (point-min)) (and (functionp post-process) (funcall post-process)))
  (let ((output (org-export-as backend subtreep visible-only body-only ext-plist)) (buffer (get-buffer-create buffer)) (encoding buffer-file-coding-system)) (if (and (org-string-nw-p output) (org-export--copy-to-kill-ring-p)) (progn (org-kill-new output))) (save-current-buffer (set-buffer buffer) (erase-buffer) (setq buffer-file-coding-system encoding) (insert output) (goto-char (point-min)) (and (functionp post-process) (funcall post-process))) (if org-export-show-temporary-export-buffer (progn (switch-to-buffer-other-window buffer))) buffer)
  (if async (let ((with-temp-message "Initializing asynchronous export process") (current-message)) (unwind-protect (progn (if with-temp-message (progn (setq current-message (current-message)) (message "%s" with-temp-message))) (let ((--copy-fun (org-export--generate-copy-script ...)) (--temp-file (make-temp-file "org-export-process")) (--coding buffer-file-coding-system)) (let ((temp-file --temp-file) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...))) (let* ((process-connection-type nil) (--proc-buffer ...) (--process ...)) (org-export-add-to-stack (get-buffer --proc-buffer) nil --process) (let (...) (set-process-sentinel --process ...))))) (and with-temp-message (if current-message (message "%s" current-message) (message nil))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist)) (buffer (get-buffer-create buffer)) (encoding buffer-file-coding-system)) (if (and (org-string-nw-p output) (org-export--copy-to-kill-ring-p)) (progn (org-kill-new output))) (save-current-buffer (set-buffer buffer) (erase-buffer) (setq buffer-file-coding-system encoding) (insert output) (goto-char (point-min)) (and (functionp post-process) (funcall post-process))) (if org-export-show-temporary-export-buffer (progn (switch-to-buffer-other-window buffer))) buffer))
  org-export-to-buffer(latex "*Org LATEX Export*" nil nil nil nil nil (closure ((ext-plist) (body-only) (visible-only) (subtreep) (async) t) nil (LaTeX-mode)))
  org-latex-export-as-latex(nil nil nil nil)
  funcall(org-latex-export-as-latex nil nil nil nil)
  (save-excursion (if arg (progn (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer (current-buffer))) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil)))) (funcall action (and (memq 'async optns) t) (and (memq 'subtree optns) t) (and (memq 'visible optns) t) (and (memq 'body optns) t)))
  (cond ((eql action 'template) (org-export-insert-default-template nil optns)) ((eql action 'stack) (org-export-stack)) ((eql action 'publish-current-file) (org-publish-current-file (memq 'force optns) (memq 'async optns))) ((eql action 'publish-current-project) (org-publish-current-project (memq 'force optns) (memq 'async optns))) ((eql action 'publish-choose-project) (org-publish (assoc (completing-read "Publish project: " org-publish-project-alist nil t) org-publish-project-alist) (memq 'force optns) (memq 'async optns))) ((eql action 'publish-all) (org-publish-all (memq 'force optns) (memq 'async optns))) (t (save-excursion (if arg (progn (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer ...)) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil)))) (funcall action (and (memq 'async optns) t) (and (memq 'subtree optns) t) (and (memq 'visible optns) t) (and (memq 'body optns) t)))))
  (let* ((input (cond ((equal arg '(16)) '(stack)) ((and arg org-export-dispatch-last-action)) (t (let ((wconfig ...)) (unwind-protect (progn ...) (set-window-configuration wconfig)))))) (action (car input)) (optns (cdr input))) (if (memq 'subtree optns) nil (move-marker org-export-dispatch-last-position nil)) (cond ((eql action 'template) (org-export-insert-default-template nil optns)) ((eql action 'stack) (org-export-stack)) ((eql action 'publish-current-file) (org-publish-current-file (memq 'force optns) (memq 'async optns))) ((eql action 'publish-current-project) (org-publish-current-project (memq 'force optns) (memq 'async optns))) ((eql action 'publish-choose-project) (org-publish (assoc (completing-read "Publish project: " org-publish-project-alist nil t) org-publish-project-alist) (memq 'force optns) (memq 'async optns))) ((eql action 'publish-all) (org-publish-all (memq 'force optns) (memq 'async optns))) (t (save-excursion (if arg (progn (if (eq ... ...) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil)))) (funcall action (and (memq 'async optns) t) (and (memq 'subtree optns) t) (and (memq 'visible optns) t) (and (memq 'body optns) t))))))
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)

This is the first time I remember seeing this behavior.

What could be going wrong? How do I set things right?

7
  • 1
    Did you recently update orgmode? Sometimes these issues popup when a new org version conflicts with byte-compiled libraries from the previous version. – Tyler Apr 21 at 13:57
  • ... Or upgrade Auctex? Often, restarting emacs "cures" the ills - or brings them to the fore: you might have to clean up some cruft when you restart (in which case, --debug-init is your friend). – NickD Apr 21 at 19:14
  • @Tyler apologies for the delayed reply. I recently upgraded my Linux installation. It was a major upgrade from kernel 5.4 to kernel 5.10. I have subsequently done doom sync – deshmukh May 3 at 8:15
  • @NickD Thanks. Well, I tried restarting emacs. That did not help. By the way, all tex files compile without an error. It is only in export that I face problems – deshmukh May 3 at 8:17
  • They compile correctly when you compile them from the command line? That will not exercise the path above. What happens if you open a TeX file in Auctex? – NickD May 3 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.