abougouffa / minemacs

MinEmacs: an Emacs configuration framework for daily use
https://abougouffa.github.io/minemacs/
MIT License
140 stars 17 forks source link

[BUG] org-latex-classes is void #108

Closed raylemon closed 1 year ago

raylemon commented 1 year ago

Describe the bug Avec le dernier commit, le message d’erreur survient à l’ouverture d’un nouveau fichier org: Symbol’s value as variable is void: org-latex-classes

Emacs version Emacs 29.0.92 sous Windows

GNU Emacs 29.0.92 (build 9, x86_64-w64-mingw32) of 2023-07-19

Checkup list

To Reproduce Steps to reproduce the behavior:

  1. Ouvrir un nouveau fichier org

Expected behavior Passage en org-mode

Backtrace If the bug rises an error, please attach the full backtrace. To be sure to obtain a backtrace, you should launch Emacs with MINEMACS_DEBUG=1 emacs or emacs --debug-init.

Debugger entered--Lisp error: (void-variable org-latex-classes)
  (member '("koma-letter" "\\documentclass{scrletter}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes)
  (if (member '("koma-letter" "\\documentclass{scrletter}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("koma-letter" "\\documentclass{scrletter}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes)))
  (closure (t) nil (setopt--set 'org-latex-packages-alist '(("AUTO" "inputenc" t ("pdflatex")) ("" "lmodern" nil) ("T1" "fontenc" t ("pdflatex")) ("" "fontspec" t ("xelatex" "lualatex")) ("AUTO" "polyglossia" t ("xelatex" "lualatex")) ("AUTO" "babel" t ("pdflatex")))) (if (member '("koma-letter" "\\documentclass{scrletter}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("koma-letter" "\\documentclass{scrletter}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes))) (if (member '("koma-article" "\\documentclass{scrartcl}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("koma-article" "\\documentclass{scrartcl}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes))) (if (member '("cours" "\\documentclass{scrreprt}\n\\usepackage{graphicx}\n\\us..." ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("cours" "\\documentclass{scrreprt}\n\\usepackage{graphicx}\n\\us..." ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes))) (if (member '("koma-report" "\\documentclass{scrreprt}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("koma-report" "\\documentclass{scrreprt}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) org-latex-classes))) (if (member '("koma-book" "\\documentclass[11pt]{scrbook}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("koma-book" "\\documentclass[11pt]{scrbook}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) org-latex-classes))) (if (member '("beamer" "\\documentclass[presentation]{beamer}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")) org-latex-classes) org-latex-classes (setq org-latex-classes (cons '("beamer" "\\documentclass[presentation]{beamer}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")) org-latex-classes))))()
  eval-after-load-helper("e:/emacs/share/emacs/29.0.92/lisp/org/org.elc")
  run-hook-with-args(eval-after-load-helper "e:/emacs/share/emacs/29.0.92/lisp/org/org.elc")
  do-after-load-evaluation("e:/emacs/share/emacs/29.0.92/lisp/org/org.elc")
  org-mode()
  #f(compiled-function (mode &optional keep-mode-if-same) "Apply MODE and return it.\nIf optional arg KEEP-MODE-IF-SAME is non-nil, MODE is chased of\nany aliases and compared to current major mode.  If they are the\nsame, do nothing and return nil." #<bytecode -0x15f859f56587f34>)(org-mode nil)
  apply(#f(compiled-function (mode &optional keep-mode-if-same) "Apply MODE and return it.\nIf optional arg KEEP-MODE-IF-SAME is non-nil, MODE is chased of\nany aliases and compared to current major mode.  If they are the\nsame, do nothing and return nil." #<bytecode -0x15f859f56587f34>) (org-mode nil))
  set-auto-mode-0(org-mode nil)
  set-auto-mode--apply-alist((("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.ps[dm]?1\\'" . powershell-mode) ("\\.asbx\\'" . asm-blox-mode) ("/PKGBUILD\\'" . pkgbuild-mode) ("/systemd/[^z-a]+?\\.d/[^/]+?\\.conf\\'" . systemd-mode) ("\\.#\\(?:[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|..." . systemd-mode) ("[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|m..." . systemd-mode) ("\\.nspawn\\'" . systemd-mode) ("docker-compose[^/]*\\.ya?ml\\'" . docker-compose-mode) ("\\.hva\\'" . latex-mode) ("\\.md\\'" . poly-markdown-mode) ("README\\.md\\'" . gfm-mode) ("\\.epub\\'" . nov-mode) ("\\.pdf\\'" . pdf-view-mode) ("\\.d2\\'" . d2-mode) ("\\.mmd\\'" . mermaid-mode) ("\\.plantuml\\'" . plantuml-mode) ("\\.\\(plantuml\\|pum\\|plu\\)\\'" . plantuml-mode) ("\\.gv\\'" . graphviz-dot-mode) ("\\.dot\\'" . graphviz-dot-mode) ("\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'" . json-mode) ("\\(?:\\(?:\\.\\(?:b\\(?:\\(?:abel\\|ower\\)rc\\)\\|json\\(?:l..." . json-mode) ("\\.toml\\'" . toml-mode) ("Procfile\\'" . yaml-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.csv\\'" . csv-mode) ("\\.tsv\\'" . tsv-mode) ("\\.[Cc][Ss][Vv]\\'" . csv-mode) ("\\.fidl\\'" . franca-idl-mode) ("\\.lua\\'" . lua-mode) ("\\.cl\\'" . opencl-mode) ("\\.cuh\\'" . cuda-mode) ("\\.cu\\'" . cuda-mode) ("\\.rs\\'" . rust-mode) ("\\.vim\\(rc\\)?\\'" . vimrc-mode) ("\\.exrc\\'" . vimrc-mode) ("[._]?g?vimrc\\'" . vimrc-mode) ("\\.vim\\'" . vimrc-mode) ("\\.editorconfig\\'" . editorconfig-conf-mode) ("/.dockerignore\\'" . gitignore-mode) ("/git/ignore\\'" . gitignore-mode) ("/info/exclude\\'" . gitignore-mode) ("/\\.gitignore\\'" . gitignore-mode) ("/etc/gitconfig\\'" . gitconfig-mode) ("/\\.gitmodules\\'" . gitconfig-mode) ("/git/config\\'" . gitconfig-mode) ("/modules/.*/config\\'" . gitconfig-mode) ("/\\.git/config\\'" . gitconfig-mode) ("/\\.gitconfig\\'" . gitconfig-mode) ("/git/attributes\\'" . gitattributes-mode) ...) nil nil)
  #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if there an `auto-mode-alist' entry in `.dir-locals.el',\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the file name against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\nIt also obeys `major-mode-remap-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0xd672fa1d6dce8df>)()
  so-long--set-auto-mode(#f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if there an `auto-mode-alist' entry in `.dir-locals.el',\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the file name against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\nIt also obeys `major-mode-remap-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0xd672fa1d6dce8df>))
  apply(so-long--set-auto-mode #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if there an `auto-mode-alist' entry in `.dir-locals.el',\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the file name against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\nIt also obeys `major-mode-remap-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0xd672fa1d6dce8df>) nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer os-tech.org> "d:/Latex/os-tech/os-tech.org" nil nil "d:/Latex/os-tech/os-tech.org" (9851624184879303 2189295367))
  find-file-noselect("d:/Latex/os-tech/os-tech.org" nil nil nil)
  find-file("d:/Latex/os-tech/os-tech.org")
  project-find-file-in(#("d:/Latex/" 0 9 (indent-prefix #(" " 0 1 (display (space :align-to (- center 27)))) line-prefix #(" " 0 1 (display (space :align-to (- center 27)))))) ("d:/Latex/") (vc Git "d:/Latex/") nil)
  project-find-file()
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_57>("d:/Latex/")
  funcall(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_57> "d:/Latex/")
  (lambda (&rest _) (funcall (dashboard-projects-backend-switch-function) (dashboard-expand-path-alist "0|d:/Latex/" dashboard-projects-alist)))((item :tag " d:/Latex/" :action (lambda (&rest _) (funcall (dashboard-projects-backend-switch-function) (dashboard-expand-path-alist "0|d:/Latex/" dashboard-projects-alist))) :button-face dashboard-items-face :mouse-face highlight :button-prefix "" :button-suffix "" :format "%[%t%]" :button-overlay #<overlay from 616 to 626 in *dashboard*> :from #<marker (moves after insertion) at 616 in *dashboard*> :to #<marker at 626 in *dashboard*>) nil)
  widget-apply-action((item :tag " d:/Latex/" :action (lambda (&rest _) (funcall (dashboard-projects-backend-switch-function) (dashboard-expand-path-alist "0|d:/Latex/" dashboard-projects-alist))) :button-face dashboard-items-face :mouse-face highlight :button-prefix "" :button-suffix "" :format "%[%t%]" :button-overlay #<overlay from 616 to 626 in *dashboard*> :from #<marker (moves after insertion) at 616 in *dashboard*> :to #<marker at 626 in *dashboard*>) nil)
  widget-button-press(617)
  evil-ret-gen(nil nil)
  evil-ret(nil)
  funcall-interactively(evil-ret nil)
  call-interactively(evil-ret nil nil)
  command-execute(evil-ret)
abougouffa commented 1 year ago

Je n'arrive pas à reproduire le bug. Ça ressemble à un problème avec votre config.el, si vous modifiez le org-latex-classes dans votre config.el, vous devez le faire dans un bloc:

(with-eval-after-load 'ox-latex ;; <-- `org-latex-classes' est défini dans `ox-latex' et non pas `org'
  ;; modify `org-latex-classes`
)

Pour info, le module ox-koma-letter est maintenant active par défaut:

https://github.com/abougouffa/minemacs/blob/36523e6872a654c2dcc2f2dd22ba32dd7fd49dcd/core/me-builtin.el#L774-L776

raylemon commented 1 year ago

Ok, ça fonctionne. J’avais le ox-koma-letter dans le config.el. Je sais pas pourquoi ça créait le bug, mais je l’ai supprimé et ça fonctionne à nouveau…

Merci !!