emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

:file keyword for Customize


From: Drew Adams
Subject: :file keyword for Customize
Date: Thu, 8 May 2008 09:35:04 -0700

How about adding a :file keyword for `defcustom' and `defface'?

(defcustom foo-bar-flag t
  "Non-nil means toto."
  :type 'boolean :group 'foo
  :file (if (eq system-type 'windows-nt)
            "C:\\foo-stuff\\foo-cus.el"
          "/toto/foo-stuff/foo-cus.el"))

Its argument would be evaluated to a file name. That particular `defcustom' or
`defface' setting would be saved in that file, instead of in `custom-file' or
`init-file'. A nil or "" value for :file would mean the same thing as the
absence of a :file keyword: as now, use `custom-file' or, if no `custom-file',
`init-file'.

This could provide a little more modularity for packages (and for any other
groupings of options & faces). It could help deal with things like platform
differences (for a package) and initialization order of settings. It could allow
users a little more flexibility in terms of when some groups of Customize
settings are loaded (currently, all Customize settings are loaded at once). It
could simplify communication with package authors about bugs (e.g. automatically
include the package's Customize settings in a bug report).

I don't have a particular use-case in mind; it's just something that occurred to
me. There is nothing special in this, but I think it might help organize things
a bit. A user's `custom-file' or `init-file' can become a monolithic blob, and
this could help cut down on that.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]