X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fcus-edit.el;h=681f8bc06c8ef42533b6337184d75f4026551caf;hb=8a7a6a7d4b484344455aa637fa67fded622699cd;hp=983bace7a59975a6c899cbcaf455baaaf6b61e27;hpb=82da33b61c3e2dd2937db17b75b2838188793053;p=chise%2Fxemacs-chise.git- diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 983bace..681f8bc 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1,6 +1,6 @@ ;;; cus-edit.el --- Tools for customizating Emacs and Lisp packages. ;; -;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen ;; Maintainer: Hrvoje Niksic @@ -55,6 +55,7 @@ (require 'cus-load) (require 'cus-start) +(require 'cus-file) ;; Huh? This looks dirty! (put 'custom-define-hook 'custom-type 'hook) @@ -399,7 +400,7 @@ This only has an effect when `custom-unlispify-tag-names' or (custom-unlispify-menu-entry symbol t))) (defun custom-prefix-add (symbol prefixes) - ;; Addd SYMBOL to list of ignored PREFIXES. + ;; Add SYMBOL to list of ignored PREFIXES. (cons (or (get symbol 'custom-prefix) (concat (symbol-name symbol) "-")) prefixes)) @@ -1247,7 +1248,7 @@ item in another window.\n\n")) (defun custom-browse-insert-prefix (prefix) "Insert PREFIX. On XEmacs convert it to line graphics." - ;; ### Unfinished. + ;; #### Unfinished. (if nil ; (string-match "XEmacs" emacs-version) (progn (insert "*") @@ -1985,7 +1986,7 @@ Otherwise, look up symbol in `custom-guess-type-alist'." (widget-put widget :custom-magic magic) (push magic buttons)) ;; Insert documentation. - ;; ### NOTE: this is ugly!!!! I need to do update the :buttons property + ;; #### NOTE: this is ugly!!!! I need to do update the :buttons property ;; before the call to `widget-default-format-handler'. Otherwise, I ;; loose my current `buttons'. This function shouldn't be called like ;; this anyway. The doc string widget should be added like the others. @@ -2225,7 +2226,6 @@ Optional EVENT is the location for the menu." "Restore the saved value for the variable being edited by WIDGET." (let* ((symbol (widget-value widget)) (set (or (get symbol 'custom-set) 'set-default)) - (comment-widget (widget-get widget :comment-widget)) (value (get symbol 'saved-value)) (comment (get symbol 'saved-variable-comment))) (cond ((or value comment) @@ -2244,8 +2244,7 @@ Optional EVENT is the location for the menu." (defun custom-variable-reset-standard (widget) "Restore the standard setting for the variable being edited by WIDGET." (let* ((symbol (widget-value widget)) - (set (or (get symbol 'custom-set) 'set-default)) - (comment-widget (widget-get widget :comment-widget))) + (set (or (get symbol 'custom-set) 'set-default))) (if (get symbol 'standard-value) (funcall set symbol (eval (car (get symbol 'standard-value)))) (signal 'error (list "No standard setting known for variable" symbol))) @@ -2272,7 +2271,7 @@ Optional EVENT is the location for the menu." :format "%t: %v" :tag "Attributes" :extra-offset 12 - :button-args '(:help-echo "Control whether this attribute have any effect") + :button-args '(:help-echo "Control whether this attribute has any effect") :args (mapcar (lambda (att) (list 'group :inline t @@ -2308,19 +2307,33 @@ OS/2 Presentation Manager") pm) (const :format "MSWindows " :sibling-args (:help-echo "\ -Windows NT/95/97") +Microsoft Windows, displays") mswindows) - (const :format "DOS " + (const :format "MSPrinter " :sibling-args (:help-echo "\ -Plain MS-DOS") - pc) +Microsoft Windows, printers") + msprinter) (const :format "TTY%n" :sibling-args (:help-echo "\ Plain text terminals") tty))) (group :sibling-args (:help-echo "\ +Only match display or printer devices") + (const :format "Output: " + class) + (checklist :inline t + :offset 0 + (const :format "Display " + :sibling-args (:help-echo "\ +Match display devices") + display) + (const :format "Printer%n" + :sibling-args (:help-echo "\ +Match printer devices") + printer))) + (group :sibling-args (:help-echo "\ Only match the frames with the specified color support") - (const :format "Class: " + (const :format "Color support: " class) (checklist :inline t :offset 0 @@ -2756,7 +2769,7 @@ Optional EVENT is the location for the menu." :tag "Hook") (defun custom-hook-convert-widget (widget) - ;; Handle `:custom-options'. + ;; Handle `:options'. (let* ((options (widget-get widget :options)) (other `(editable-list :inline t :entry-format "%i %d%v" @@ -3225,15 +3238,6 @@ Optional EVENT is the location for the menu." (widget-put widget :custom-state found))) (custom-magic-reset widget)) -;;; The `custom-save-all' Function. -;;;###autoload -(defcustom custom-file "~/.emacs" - "File used for storing customization information. -If you change this from the default \"~/.emacs\" you need to -explicitly load that file for the settings to take effect." - :type 'file - :group 'customize) - (defun custom-save-delete (symbol) "Delete the call to SYMBOL form in `custom-file'. Leave point at the location of the call, or after the last expression." @@ -3279,7 +3283,7 @@ Leave point at the location of the call, or after the last expression." (princ "\n '(") (prin1 symbol) (princ " ") - ;; This comment stuf is in the way #### + ;; This comment stuff is in the way #### ;; Is (eq (third spec) (car saved-value)) ???? ;; (prin1 (third spec)) (prin1 (car (get symbol 'saved-value))) @@ -3580,6 +3584,19 @@ if that value is non-nil." (run-hooks 'custom-mode-hook)) +;;;###autoload +(defun custom-migrate-custom-file (new-custom-file-name) + "Migrate custom file from home directory." + (mapc 'custom-save-delete + '(custom-load-themes custom-reset-variables + custom-set-variables + custom-set-faces + custom-reset-faces)) + (with-current-buffer (find-file-noselect custom-file) + (save-buffer)) + (setq custom-file new-custom-file-name) + (custom-save-all)) + ;;; The End. (provide 'cus-edit)