Subject: bug#24920: 24.5; Error on customize-update-all

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 03 Sep 2021 11:03:51 +0200

[email-masked] writes:

> Running "M-x customize-option Tex-auto-global" works fine. However, it
> throws an error if I hit "Save for future sessions":
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   file-name-directory(nil)
>   (expand-file-name "../var/auctex" (file-name-directory load-file-name))
>   eval((expand-file-name "../var/auctex" (file-name-directory load-file-name)))
>   custom-push-theme(theme-value TeX-auto-global user set
> "d:/home/.emacs.d/var/auctex")

[...]

> AFAICT, the problem is that auctex uses a standard-value for
> Tex-auto-global that includes (file-name-directory load-file-name) as
> part of the expression.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Hm...  this is the definition of that variable:

(defcustom TeX-auto-global
    (if (file-writable-p "/usr/local/var/auctex") "/usr/local/var/auctex" "~/.emacs.d/auctex")
  "Directory containing automatically generated information.

For storing automatic extracted information about the TeX macros
shared by all users of a site."
  :group 'TeX-file
  :type 'directory)

Doesn't seem to be any mention of load-file-name.  There's stuff like

(defvar TeX-lisp-directory
  (file-name-directory load-file-name)

but that shouldn't affect this user option, surely?  Hm...  anybody know
what's going on?  (Or has this been fixed in the years since it was
reported?  I haven't tried to reproduce the problem.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no