comparison lisp/cus-edit.el @ 37911:747d5805111c

(custom-file): Fix last change.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 28 May 2001 07:13:32 +0000
parents 0b9965ee3ec4
children b174db545cfd
comparison
equal deleted inserted replaced
37910:902e099eaf57 37911:747d5805111c
3445 :type '(choice (const :tag "Your Emacs init file" nil) file) 3445 :type '(choice (const :tag "Your Emacs init file" nil) file)
3446 :group 'customize) 3446 :group 'customize)
3447 3447
3448 (defun custom-file () 3448 (defun custom-file ()
3449 "Return the file name for saving customizations." 3449 "Return the file name for saving customizations."
3450 (if (and (null user-init-file) 3450 (setq custom-file
3451 (or (file-exists-p "~/.emacs") 3451 (or custom-file
3452 (and (memq system-type '(ms-dos windows-nt)) 3452 (let ((user-init-file user-init-file)
3453 (file-exists-p "~/_emacs")))) 3453 (default-init-file
3454 ;; Started with -q, i.e. the file containing Custom settings 3454 (if (eq system-type 'ms-dos) "~/_emacs" "~/.emacs")))
3455 ;; hasn't been read. Saving settings there would overwrite 3455 (when (null user-init-file)
3456 ;; other settings. 3456 (if (or (file-exists-p default-init-file)
3457 (error "Saving settings when running -q would overwrite existing settings") 3457 (and (eq system-type 'windows-nt)
3458 (setq custom-file (or custom-file user-init-file)))) 3458 (file-exists-p "~/_emacs")))
3459 ;; Started with -q, i.e. the file containing
3460 ;; Custom settings hasn't been read. Saving
3461 ;; settings there would overwrite other settings.
3462 (error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
3463 (setq user-init-file default-init-file))
3464 user-init-file))))
3459 3465
3460 (defun custom-save-delete (symbol) 3466 (defun custom-save-delete (symbol)
3461 "Visit `custom-file' and delete all calls to SYMBOL from it. 3467 "Visit `custom-file' and delete all calls to SYMBOL from it.
3462 Leave point at the old location of the first such call, 3468 Leave point at the old location of the first such call,
3463 or (if there were none) at the end of the buffer." 3469 or (if there were none) at the end of the buffer."