diff options
| author | Karl Heuer | 1998-02-25 22:46:28 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-02-25 22:46:28 +0000 |
| commit | 176eb8cb50fee6791c9e41aed504ab35ce79aa6e (patch) | |
| tree | 2d389d8c5067ba9635702320360bf0e23e5ced45 | |
| parent | a1fee1bc2add11a9814bc43b11804f1f5822f646 (diff) | |
| download | emacs-176eb8cb50fee6791c9e41aed504ab35ce79aa6e.tar.gz emacs-176eb8cb50fee6791c9e41aed504ab35ce79aa6e.zip | |
(custom-file): New function.
(custom-save-delete): Use it.
(custom-save-all): Use it.
| -rw-r--r-- | lisp/cus-edit.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index e53459ecee6..aa9b88c0ee5 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -2984,11 +2984,19 @@ you need to explicitly load that file for the settings to take effect." | |||
| 2984 | :type '(choice (const :tag "Your Emacs init file" nil) file) | 2984 | :type '(choice (const :tag "Your Emacs init file" nil) file) |
| 2985 | :group 'customize) | 2985 | :group 'customize) |
| 2986 | 2986 | ||
| 2987 | (defun custom-file () | ||
| 2988 | "Return the file name for saving customizations." | ||
| 2989 | (setq custom-file | ||
| 2990 | (or custom-file | ||
| 2991 | user-init-file | ||
| 2992 | (read-file-name "File for customizations: " | ||
| 2993 | "~/" nil nil ".emacs")))) | ||
| 2994 | |||
| 2987 | (defun custom-save-delete (symbol) | 2995 | (defun custom-save-delete (symbol) |
| 2988 | "Delete the call to SYMBOL from `custom-file'. | 2996 | "Delete the call to SYMBOL from `custom-file'. |
| 2989 | Leave point at the location of the call, or after the last expression." | 2997 | Leave point at the location of the call, or after the last expression." |
| 2990 | (let ((default-major-mode)) | 2998 | (let ((default-major-mode)) |
| 2991 | (set-buffer (find-file-noselect (or custom-file user-init-file)))) | 2999 | (set-buffer (find-file-noselect (custom-file)))) |
| 2992 | (goto-char (point-min)) | 3000 | (goto-char (point-min)) |
| 2993 | (catch 'found | 3001 | (catch 'found |
| 2994 | (while t | 3002 | (while t |
| @@ -3096,7 +3104,7 @@ Leave point at the location of the call, or after the last expression." | |||
| 3096 | (custom-save-faces) | 3104 | (custom-save-faces) |
| 3097 | (save-excursion | 3105 | (save-excursion |
| 3098 | (let ((default-major-mode nil)) | 3106 | (let ((default-major-mode nil)) |
| 3099 | (set-buffer (find-file-noselect (or custom-file user-init-file)))) | 3107 | (set-buffer (find-file-noselect (custom-file)))) |
| 3100 | (save-buffer)))) | 3108 | (save-buffer)))) |
| 3101 | 3109 | ||
| 3102 | ;;; The Customize Menu. | 3110 | ;;; The Customize Menu. |