unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71851: 31.0.50; error with (use-package org ...)
@ 2024-06-30  6:39 Paul Nelson
  2024-06-30 20:36 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-01 15:04 ` 孙曙光
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Nelson @ 2024-06-30  6:39 UTC (permalink / raw)
  To: 71851

Steps to reproduce: on the latest master, Emacs -Q, evaluating

(use-package org
  :custom
  (org-babel-load-languages '((latex . t) (emacs-lisp . t) (python . t))))

in *scratch* via C-x C-e yields the error

Error (use-package): org/:catch: Symbol’s value as variable is void:
org-preview-latex-process-alist

If I first (require 'org), then it works fine.

I suspected some version issue, but deleted all eln-cache stuff, and
tried rebuilding in a fresh directory and emptying my .emacs.d.


In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.5.0, NS
 appkit-2487.60 Version 14.5 (Build 23F79)) of 2024-06-30 built on
 d51735
Repository revision: c8473ee8c1914d15fb19207215f0a06c84d0915c
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.5

Configured using:
 'configure --with-ns --with-native-compilation --with-tree-sitter
 --with-gif --with-png --with-jpeg --with-rsvg --with-tiff
 --with-imagemagick --with-x-toolkit=gtk3 --with-xwidgets'

Configured features:
ACL DBUS GLIB GNUTLS IMAGEMAGICK LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM XWIDGETS ZLIB

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils compile text-property-search
comint subr-x ansi-osc ansi-color ring comp-run comp-common warnings
icons thingatpt find-func cal-menu calendar cal-loaddefs org-version
org-compat org-macs format-spec cl-macs gv cl-extra help-mode cl-seq
use-package-core cl-loaddefs cl-lib bytecomp byte-compile rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads xwidget-internal dbusbind kqueue cocoa ns lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 120273 12323) (symbols 48 12306 0) (strings 32 33300 3032)
 (string-bytes 1 1117542) (vectors 16 18104)
 (vector-slots 8 236238 8900) (floats 8 53 68) (intervals 56 264 0)
 (buffers 992 13))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#71851: 31.0.50; error with (use-package org ...)
  2024-06-30  6:39 bug#71851: 31.0.50; error with (use-package org ...) Paul Nelson
@ 2024-06-30 20:36 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-07-01 11:11   ` Ihor Radchenko
  2024-08-01 15:04 ` 孙曙光
  1 sibling, 1 reply; 4+ messages in thread
From: Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-06-30 20:36 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Ihor Radchenko, 71851

Paul Nelson <ultrono@gmail.com> writes:

> Steps to reproduce: on the latest master, Emacs -Q, evaluating
>
> (use-package org
>   :custom
>   (org-babel-load-languages '((latex . t) (emacs-lisp . t) (python . t))))
>
> in *scratch* via C-x C-e yields the error
>
> Error (use-package): org/:catch: Symbol’s value as variable is void:
> org-preview-latex-process-alist
>
> If I first (require 'org), then it works fine.
>
> I suspected some version issue, but deleted all eln-cache stuff, and
> tried rebuilding in a fresh directory and emptying my .emacs.d.
>
>
> In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.5.0, NS
>  appkit-2487.60 Version 14.5 (Build 23F79)) of 2024-06-30 built on
>  d51735
> Repository revision: c8473ee8c1914d15fb19207215f0a06c84d0915c
> Repository branch: master
> Windowing system distributor 'Apple', version 10.3.2487
> System Description:  macOS 14.5

Adding Ihor who may be able to review.

FWIW, I tried this on 29.4 and there is no error, so this may be from a recent commit.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#71851: 31.0.50; error with (use-package org ...)
  2024-06-30 20:36 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-07-01 11:11   ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-07-01 11:11 UTC (permalink / raw)
  To: Jeremy Bryant; +Cc: 71851, Paul Nelson

Jeremy Bryant <jb@jeremybryant.net> writes:

>> Steps to reproduce: on the latest master, Emacs -Q, evaluating
>>
>> (use-package org
>>   :custom
>>   (org-babel-load-languages '((latex . t) (emacs-lisp . t) (python . t))))
> ...
> Adding Ihor who may be able to review.
>
> FWIW, I tried this on 29.4 and there is no error, so this may be from a recent commit.

I was able to reproduce using exact steps, using Emacs master.
Emacs 29.4 has no problem. Loading external Org mode repo also works.

Sounds like something about autoloads? I am not sure.

The problem is triggered by

(defcustom org-babel-latex-process-alist
  `(,(cons 'png (alist-get 'dvipng org-preview-latex-process-alist)))

in ob-latex.

`org-preview-latex-process-alist' is defined in org.el and the backtrace
in the reproducer points to org.el loading ob-latex. Somehow, only on
master, `org-preview-latex-process-alist' is not available.

Debugger entered--Lisp error: (void-variable org-preview-latex-process-alist)
  #f(compiled-function () #<bytecode -0x14ab3e57384cb8f6>)()
  funcall(#f(compiled-function () #<bytecode -0x14ab3e57384cb8f6>))
  eval((funcall #'#f(compiled-function () #<bytecode -0x14ab3e57384cb8f6>)))
  custom-initialize-reset(org-babel-latex-process-alist (funcall #'#f(compiled-function () #<bytecode -0x14ab3e57384cb8f6>)))
  custom-declare-variable(org-babel-latex-process-alist (funcall #'#f(compiled-function () #<bytecode -0x14ab3e57384cb8f6>)) "Definitions of external processes for LaTeX result generation.\nSee `org-preview-latex-process-alist' for more details.\n\nThe following process symbols are recognized:\n- `png' :: Process used to produce .png output." :group org-babel :package-version (Org . "9.7") :type (alist :tag "LaTeX to image backends" :value-type (plist)))
  byte-code("\300\301\302\303\304DD\305\306\307\310\311&\7\210\300\312\302\303\313DD\314\306\307\310\303&\7\210\300\315\302\303\316DD\317\306\307\310\303&\7\210\300\320\302\303\321DD\322\306\307\310\303&\7\210\300\323\302\303\324DD\325\306\307\310\311\326\327&\11\210\300\330\302\303\331DD\332\306\307\310\333&\7\210\300\334\302\303\335DD\336\306\307\326\337\310\340&\11\207" [custom-declare-variable org-babel-latex-htlatex funcall function #f(compiled-function () #<bytecode -0x6ca028d8a28b9ec>) "The htlatex command to enable conversion of LaTeX to SVG or HTML." :group org-babel :type string org-babel-latex-preamble #f(compiled-function () #<bytecode 0x7df15e625b1ebfc>) "Closure which evaluates at runtime to the LaTeX preamble.\n\nIt takes 1 argument which is the parameters of the source block." org-babel-latex-begin-env #f(compiled-function () #<bytecode 0x7df15e625b1ebfc>) "Function that evaluates to the begin part of the document environment.\n\nIt takes 1 argument which is the parameters of the source block.\nThis allows adding additional code that will be ignored when\nexporting the literal LaTeX source." org-babel-latex-end-env #f(compiled-function () #<bytecode 0x7df15e625b1ebfc>) "Closure which evaluates at runtime to the end part of the document environment.\n\nIt takes 1 argument which is the parameters of the source block.\nThis allows adding additional code that will be ignored when\nexporting the literal LaTeX source." org-babel-latex-pdf-svg-process #f(compiled-function () #<bytecode 0x79ea5ab5192d60c>) "Command to convert a PDF file to an SVG file." :package-version (Org . "9.6") org-babel-latex-htlatex-packages #f(compiled-function () #<bytecode -0xc515f11e1fb26d2>) "Packages to use for htlatex export." (repeat (string)) org-babel-latex-process-alist #f(compiled-function () #<bytecode -0x14ab3e57384cb8f6>) "Definitions of external processes for LaTeX result generation.\nSee `org-preview-latex-process-alist' for more details.\n\nThe following process symbols are recognized:\n- `png' :: Process used to produce .png output." (Org . "9.7") (alist :tag "LaTeX to image backends" :value-type (plist))] 10)
  org-babel-do-load-languages(org-babel-load-languages ((latex . t) (emacs-lisp . t) (python . t)))
  custom-initialize-reset(org-babel-load-languages (funcall #'#f(compiled-function () #<bytecode 0x18c000ae69414>)))
  custom-declare-variable(org-babel-load-languages (funcall #'#f(compiled-function () #<bytecode 0x18c000ae69414>)) "Languages which can be evaluated in Org buffers.\n\\<org-mode-map>\nThis list can be used to load support for any of the available\nlanguages with babel support (see info node `(org) Languages').  Each\nlanguage will depend on a different set of system executables and/or\nEmacs modes.\n\nWhen a language is \"loaded\", code blocks in that language can\nbe evaluated with `org-babel-execute-src-block', which is bound\nby default to \\[org-ctrl-c-ctrl-c].\n\nThe `org-babel-no-eval-on-ctrl-c-ctrl-c' option can be set to\nremove code block evaluation from \\[org-ctrl-c-ctrl-c].  By\ndefault, only Emacs Lisp is loaded, since it has no specific\nrequirement." :group org-babel :set org-babel-do-load-languages :package-version (Org . "9.6") :type (alist :tag "Babel Languages" :key-type (choice (const :tag "Awk" awk) (const :tag "C, D, C++, and cpp" C) (const :tag "R" R) (const :tag "Calc" calc) (const :tag "Clojure and ClojureScript" clojure) (const :tag "CSS" css) (const :tag "Ditaa" ditaa) (const :tag "Dot" dot) (const :tag "Emacs Lisp" emacs-lisp) (const :tag "Eshell" eshell) (const :tag "Forth" forth) (const :tag "Fortran" fortran) (const :tag "GnuPlot" gnuplot) (const :tag "Groovy" groovy) (const :tag "Haskell" haskell) (const :tag "Java" java) (const :tag "JavaScript" js) (const :tag "Julia" julia) (const :tag "LaTeX" latex) (const :tag "LilyPond" lilypond) (const :tag "Lisp" lisp) (const :tag "Lua" lua) (const :tag "Makefile" makefile) (const :tag "Maxima" maxima) (const :tag "OCaml" ocaml) (const :tag "Octave and MatLab" octave) (const :tag "Org" org) (const :tag "Perl" perl) (const :tag "Processing" processing) (const :tag "PlantUML" plantuml) (const :tag "Python" python) (const :tag "Ruby" ruby) (const :tag "Sass" sass) (const :tag "Scheme" scheme) (const :tag "Screen" screen) (const :tag "Sed" sed) (const :tag "Shell Script" shell) (const :tag "Sql" sql) (const :tag "Sqlite" sqlite)) :value-type (boolean :tag "Activate" :value t)))
  byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315&\13\210\300\316\302\303\317DD\320\314\321\322\323\306\324&\11\210\325\326\327\"\210\325\330\327\"\207" [custom-declare-variable org-babel-load-languages funcall function #f(compiled-function () #<bytecode 0x18c000ae69414>) "Languages which can be evaluated in Org buffers.\n\\<org-mode-map>\nThis list can be used to load support for any of the available\nlanguages with babel support (see info node `(org) Languages').  Each\nlanguage will depend on a different set of system executables and/or\nEmacs modes.\n\nWhen a language is \"loaded\", code blocks in that language can\nbe evaluated with `org-babel-execute-src-block', which is bound\nby default to \\[org-ctrl-c-ctrl-c].\n\nThe `org-babel-no-eval-on-ctrl-c-ctrl-c' option can be set to\nremove code block evaluation from \\[org-ctrl-c-ctrl-c].  By\ndefault, only Emacs Lisp is loaded, since it has no specific\nrequirement." :group org-babel :set org-babel-do-load-languages :package-version (Org . "9.6") :type (alist :tag "Babel Languages" :key-type (choice (const :tag "Awk" awk) (const :tag "C, D, C++, and cpp" C) (const :tag "R" R) (const :tag "Calc" calc) (const :tag "Clojure and ClojureScript" clojure) (const :tag "CSS" css) (const :tag "Ditaa" ditaa) (const :tag "Dot" dot) (const :tag "Emacs Lisp" emacs-lisp) (const :tag "Eshell" eshell) (const :tag "Forth" forth) (const :tag "Fortran" fortran) (const :tag "GnuPlot" gnuplot) (const :tag "Groovy" groovy) (const :tag "Haskell" haskell) (const :tag "Java" java) (const :tag "JavaScript" js) (const :tag "Julia" julia) (const :tag "LaTeX" latex) (const :tag "LilyPond" lilypond) (const :tag "Lisp" lisp) (const :tag "Lua" lua) (const :tag "Makefile" makefile) (const :tag "Maxima" maxima) (const :tag "OCaml" ocaml) (const :tag "Octave and MatLab" octave) (const :tag "Org" org) (const :tag "Perl" perl) (const :tag "Processing" processing) (const :tag "PlantUML" plantuml) (const :tag "Python" python) (const :tag "Ruby" ruby) (const :tag "Sass" sass) (const :tag "Scheme" scheme) (const :tag "Screen" screen) (const :tag "Sed" sed) (const :tag "Shell Script" shell) (const :tag "Sql" sql) (const :tag "Sqlite" sqlite)) :value-type (boolean :tag "Activate" :value t)) org-clone-delete-id #f(compiled-function () #<bytecode 0x18c000ae69414>) "Remove ID property of clones of a subtree.\nWhen non-nil, clones of a subtree don't inherit the ID property.\nOtherwise they inherit the ID property with a new unique\nidentifier." boolean :version "24.1" org-id autoload org-release "org-version.el" org-git-version] 12)
  require(org nil t)
  (not (require 'org nil t))
  (if (not (require 'org nil t)) (display-warning 'use-package (format "Cannot load %s" 'org) :error))
  (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-babel-load-languages '((latex . t) (emacs-lisp . t) (python . t)) nil nil "Customized with use-package org"))) (if (not (require 'org nil t)) (display-warning 'use-package (format "Cannot load %s" 'org) :error)))
  (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-babel-load-languages '(... ... ...) nil nil "Customized with use-package org"))) (if (not (require 'org nil t)) (display-warning 'use-package (format "Cannot load %s" 'org) :error))) ((debug error) (funcall use-package--warning1 :catch err)))
  (progn (defvar use-package--warning1 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-babel-load-languages '... nil nil "Customized with use-package org"))) (if (not (require 'org nil t)) (display-warning 'use-package (format "Cannot load %s" 'org) :error))) ((debug error) (funcall use-package--warning1 :catch err))))
  (progn (progn (defvar use-package--warning1 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq ... custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-babel-load-languages ... nil nil "Customized with use-package org"))) (if (not (require 'org nil t)) (display-warning 'use-package (format "Cannot load %s" 'org) :error))) ((debug error) (funcall use-package--warning1 :catch err)))))
  eval((progn (progn (defvar use-package--warning1 #'(lambda (keyword err) (let (...) (display-warning ... msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq ... custom-known-themes) nil (custom-declare-theme ... ... nil ...) (enable-theme ...) (setq custom-enabled-themes ...)) (custom-theme-set-variables 'use-package '...)) (if (not (require ... nil t)) (display-warning 'use-package (format "Cannot load %s" ...) :error))) ((debug error) (funcall use-package--warning1 :catch err))))) t)
  elisp--eval-last-sexp(nil)
  #f(compiled-function () #<bytecode 0xf626b78376ca>)()
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#71851: 31.0.50; error with (use-package org ...)
  2024-06-30  6:39 bug#71851: 31.0.50; error with (use-package org ...) Paul Nelson
  2024-06-30 20:36 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-01 15:04 ` 孙曙光
  1 sibling, 0 replies; 4+ messages in thread
From: 孙曙光 @ 2024-08-01 15:04 UTC (permalink / raw)
  To: jb@jeremybryant.net, ultrono@gmail.com; +Cc: 71851

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

FYI.

I met the same issue. Org is deferred loaded. And I added `(latex . t)` to  `org-babel-load-languages` prior the loading of org. It triggers regression, that is, eager macro expansion and load `ob-latex` and `org` recursively.

BR
Shuguang Sun



[-- Attachment #2: Type: text/html, Size: 2557 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-01 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-30  6:39 bug#71851: 31.0.50; error with (use-package org ...) Paul Nelson
2024-06-30 20:36 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-01 11:11   ` Ihor Radchenko
2024-08-01 15:04 ` 孙曙光

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).