Am 12.06.22 um 12:11 schrieb Lars Ingebrigtsen:
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

Maybe a more suitable example:

(defvar ar-emacs-dir
  (cond (t t)
        (t 
           (when ar-emacs-dir ()))))
That doesn't give an error in either Emacs 28 nor Emacs 29.


Hmm, but it should, or? The use of a previous undefined var in its own definition should raise an error.


Unfortunately, have some difficulty translating my init-stuff into a generic report.

Here is what I --gladly-- get when starting from v28, but no longer from v29:

Debugger entered--Lisp error: (void-variable ar-emacs-dir)
  (if ar-emacs-dir (progn (kill-buffer "fns.c")))
  (cond ((boundp 'lisp-directory) (replace-regexp-in-string "/[^/]+/$" "" lisp-directory)) ((< (string-to-number (substring emacs-version 0 2)) 27) (alt-emacsdir)) (t (progn (elisp-find-definition "featurep") (replace-regexp-in-string "/[^/]+/$" "" (file-name-directory (buffer-file-name)))) (if ar-emacs-dir (progn (kill-buffer "fns.c")))))
  (defvar ar-emacs-dir (cond ((boundp 'lisp-directory) (replace-regexp-in-string "/[^/]+/$" "" lisp-directory)) ((< (string-to-number (substring emacs-version 0 2)) 27) (alt-emacsdir)) (t (progn (elisp-find-definition "featurep") (replace-regexp-in-string "/[^/]+/$" "" (file-name-directory (buffer-file-name)))) (if ar-emacs-dir (progn (kill-buffer "fns.c"))))))
  eval-buffer(#<buffer  *load*-897063> nil "/home/my-name/.gnu-emacs25" nil t)  ; Reading at buffer position 3749
  load-with-code-conversion("/home/my-name/.gnu-emacs25" "/home/my-name/.gnu-emacs25" nil nil)
  load("/home/my-name/.gnu-emacs25")
  (cond ((string-match "^23" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs23-cvs-custom")) (load (expand-file-name "~/.gnu-emacs23-all-cvs"))) ((string-match "^24" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs24-custom")) (load (expand-file-name "~/.gnu-emacs24"))) ((string-match "^25" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs25-custom")) (load (expand-file-name "~/.gnu-emacs25"))) ((string-match "^26" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs25-custom")) (load (expand-file-name "~/.gnu-emacs25"))) ((string-match "^27" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs25-custom")) (load (expand-file-name "~/.gnu-emacs25"))) ((string-match "^28" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs25-custom")) (load (expand-file-name "~/.gnu-emacs25"))) ((string-match "^29" emacs-version) (setq custom-file (expand-file-name "~/.gnu-emacs25-custom")) (load (expand-file-name "~/.gnu-emacs25"))))
  eval-buffer(#<buffer  *load*> nil "/home/my-name/.emacs" nil t)  ; Reading at buffer position 1480
  load-with-code-conversion("/home/my-name/.emacs" "/home/my-name/.emacs" t t)
  load("~/.emacs" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0xf76a6f1249f6a62>) #f(compiled-function () #<bytecode -0x1f3c686ddc0cdc35>) t)
  command-line()
  normal-top-level()

;;; below again the code which --gladly-- triggered this:


(defvar ar-emacs-dir
  (cond ((boundp 'lisp-directory)
         (replace-regexp-in-string "/[^/]+/$" "" lisp-directory))
        ((< (string-to-number (substring emacs-version 0 2)) 27)
         (alt-emacsdir))
        (t (progn (elisp-find-definition "featurep")
              (replace-regexp-in-string "/[^/]+/$" "" (file-name-directory (buffer-file-name))))
           (when ar-emacs-dir (kill-buffer "fns.c")))))