Subject: Re: bug#65401: 30.0.50; custom-theme-directory :type could be enhanced

From: Mauro Aranda <[email-masked]>
Date: Sun, 20 Aug 2023 08:28:48 -0300

Eli Zaretskii <[email-masked]> writes:

 >> Date: Sun, 20 Aug 2023 07:48:09 -0300
 >> From: Mauro Aranda <[email-masked]>
 >>
 >> The user option custom-theme-directory is supposed to hold a directory
 >> name.  But its :type is a string.
 >>
 >> I realize that it isn't really a bug, but in order to offer better
 >> completion, at least, I'd like to change the type to be directory.  So
 >> I'm filing this bug report to see if people would object to such a
 >> change.
 >
 > Does the directory have to exist?

I don't think so.  And I don't see a reason to force the existence by
putting a non-nil :must-match property.

The function custom-theme--load-path takes care of filtering out
custom-theme-directory if it doesn't exist.

And to check I evaled:
(defcustom custom-theme-directory user-emacs-directory
   "Default user directory for storing custom theme files.
The command `customize-create-theme' writes theme files into this
directory.  By default, Emacs searches for custom themes in this
directory first---see `custom-theme-load-path'."
   :initialize #'custom-initialize-delay
   :type 'directory
   :group 'customize
   :version "22.1")

M-x customize-option RET custom-theme-directory
Changed the value to something like "~/nonexistent" and set it for the
session.
M-x customize-create-theme
Answer y at the prompt
Give the theme a dummy name.
Action the Save Theme button
The theme was created under: ~/nonexistent/dummy-theme.el