emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
622 stars 162 forks source link

ess.elc failed to define function poly-quarto-mode #1216

Closed slackline closed 2 years ago

slackline commented 2 years ago

Hi,

I'm keen to use the quarto-mode and have added the following to my ESS config to make quarto mode available as per the instructions.

(use-package ess
  :ensure t
  :defer 1
  :init
  :mode (("/R/.*\\.q\\'"       . R-mode)
         ("\\.[rR]\\'"         . R-mode)
         ("\\.[rR]profile\\'"  . R-mode)
         ("NAMESPACE\\'"       . R-mode)
         ("CITATION\\'"        . R-mode)
         ("\\.[Rr]out"         . R-transcript-mode)
         ("\\.Rmd\\'"          . Rd-mode)
         ("\\.qmd\\'"          . poly-quarto-mode)
         ("\\.Rd\\'"           . Rd-mode))
  :interpreter (("R" . R-mode)
                ("R" . R-transcript-mode)
                ("R" . Rd-mode))
  :config
  (setq ess-r-backend 'lsp)
  (setq comint-input-ring-size 1000)
  (setq ess-indent-offset 2)
  (setq ess-eval-visibly-p nil)
  (setq ess-ask-for-ess-directory nil)
  (setq ess-togggle-underscore nil)
  (setq ess-eval-visibly 'nowait)
  :hook
  (ess-mode . company-mode)
  (inferior-ess-mode . company-mode)
  )

(use-package quarto-mode
  :mode (("\\.Rmd" . poly-quarto-mode)))

(use-package ess-r-mode
  :ensure ess
  :defer 1
  :bind
  (:map ess-r-mode-map ("C-|" . " |>\n"))
  (:map ess-r-mode-map (";" . ess-insert-assign))
  (:map inferior-ess-r-mode-map ("C-|" . " |>\n"))
  (:map inferior-ess-r-mode-map (";" . ess-insert-assign)))

On opening a .qmd file poly-quarto-mode is not loaded and I get the error...

File mode specification error: (error Autoloading file /home/nshephard/.config/emacs/elpa/ess-20220815.2020/ess.elc failed to define function poly-quarto-mode)

Same error if after opening a file I try to set the mode with M-x poly-quarto-mode.

What I have to do is open and evaluate the quarto-mode.el and then I can manually activate M-x poly-quarto-mode. This kind of suggests to me that its an issue with quarto-mode rather than ESS but I'm not sure and as its ESS reporting the error thought I'd report here first. Apologies if this is wrong and I should post to quarto-mode.

slackline commented 2 years ago

I'm an idiot and shouldn't have included ("\\.qmd\\'" . poly-quarto-mode) under ess configuration section, removing it everything works as it should.