commit: Create the containing directory for the custom and init files if necessary.

Stephen J. Turnbull stephen at xemacs.org
Thu Jan 3 20:32:30 EST 2008


Aidan Kehoe writes:

 >  > On second thought, a better solution for the menubar item is to use
 >  > call-interactively to call `find-file'.  That way you get the normal
 >  > interface for creating parents.
 > 
 > That’s not any less confusing for the new user than the current behaviour.
 > Custom file? Huh? How do I tell the program to use it the next time it
 > starts up? 

Cut the attitude, please.  You should be able to figure this out for
yourself, you are a reviewer, for pete's sake.

The behavior I want to see for custom-save-all is

(1) Check if the directory portion of custom-file (usually
    "~/.xemacs") exists; if so save as usual.
(2) If not, check if the parent of that directory exists; if so,
    create it and save as usual, notifying the user of this behavior.
    This isn't 100% accurate, as the user might have custom-file
    located somewhere other than the user-init-directory, but it
    should be good enough.  (Maybe compare to the default and if
    custom-file is not the default, the user apparently knows what
    he's doing, so just create all missing parents.)
(3) If not, warn the user that he's apparently HOME-less, and ask if
    necessary parents should be created.  If he says no, warn that
    custom-file needs to be set appropriately, immediately (so that
    Custom can save) and also in the init file so it can be found in
    the future.

For the menu item for editing the init file, it turns out to be a
little more complicated than I thought since I forgot that
call-interactively doesn't allow you to set any parameters.

(1) Check if user-init-directory is the default.  If not, warn the
    user that he's in a non-default init directory, possibly another
    user's.  If he continues editing this file, he will need to use a
    runtime flag at startup to use it.
(2) Check if user-init-directory exists.  If so, find user-init-file.
(3) If not, check if the parent exists.  If so, create
    user-init-directory, notify the user that the directory was
    created, and find the file.
(4) If not, warn the user that he's apparently HOME-less, and ask if
    necessary parents should be created.  If yes, create the
    directories and find the file.



More information about the XEmacs-Patches mailing list