Gets or sets a persistent value in the user's registry.
user-preference path value-name &key product => value, valuep
(setf user-preference) value path value-name &key product => value
A string or a list of strings.
A Lisp object.
user-preference reads the value of the registry entry value-name under path under the registry path defined for product by
). If the registry entry was found a second value
t is returned. If the registry entry was not found, then value is
(setf user-preference) sets the value of that registry entry to value.
If path is a list of strings, then it is interpreted like the directory component of a pathname. If path is a string, then any directory separators should be appropriate for the platform - that is, use backslash on Windows, and forward slash on non-Windows systems.
When value is a string,
user-preference stores a print-escaped string in the registry and reads it back with
read-from-string. Therefore it may not work with string values stored by other software.
While product can in principle be any Lisp object, values of product are compared by
eq, so you should use keywords.
The CAPI provides a way to store window geometry - see the reference entry for
capi:top-level-interface-save-geometry-p in the
CAPI User Guide and Reference Manual
This example is on Microsoft Windows. Note the use of backslashes as directory separators in the path argument:
(setf (user-preference "My Stuff\\FAQ"
This is equivalent to the previous example, and is portable because we avoid the explicit directory separators in the path argument:
(setf (user-preference (list "My Stuff" "FAQ")
We can retrieve values on Windows like this:
(user-preference "My Stuff\\FAQ"
We can retrieve values on any platform like this:
(user-preference (list "My Stuff" "FAQ")
LispWorks User Guide and Reference Manual - 20 Sep 2017