Show
Ignore:
Timestamp:
11/26/05 08:33:26 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-CVS_HEAD/lisp/cus-edit.el

    r3939 r3988  
    213213(defgroup lisp nil 
    214214  "Lisp support, including Emacs Lisp." 
     215  :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) 
    215216  :group 'languages 
    216217  :group 'development) 
     
    218219(defgroup c nil 
    219220  "Support for the C language and related languages." 
     221  :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) 
    220222  :link '(custom-manual "(ccmode)") 
    221223  :group 'languages) 
     
    324326(defgroup tex nil 
    325327  "Code related to the TeX formatter." 
     328  :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) 
    326329  :group 'wp) 
    327330 
     
    491494  "Prompt for a custom variable, defaulting to the variable at point. 
    492495Return a list suitable for use in `interactive'." 
    493    (let ((v (variable-at-point)) 
    494          (enable-recursive-minibuffers t) 
    495          val) 
     496   (let* ((v (variable-at-point)) 
     497          (default (and (symbolp v) (custom-variable-p v) (symbol-name v))) 
     498          (enable-recursive-minibuffers t) 
     499          val) 
    496500     (setq val (completing-read 
    497                 (if (and (symbolp v) (custom-variable-p v)) 
    498                     (format "Customize option (default %s): " v) 
     501                (if default (format "Customize option (default %s): " default) 
    499502                  "Customize option: ") 
    500                 obarray 'custom-variable-p t)) 
     503                obarray 'custom-variable-p t nil nil default)) 
    501504     (list (if (equal val "") 
    502505               (if (symbolp v) v nil) 
     
    798801  (interactive) 
    799802  (let ((children custom-options)) 
    800     (mapc (lambda (widget) 
    801             (and (widget-apply widget :custom-standard-value) 
    802                  (if (memq (widget-get widget :custom-state) 
    803                            '(modified set changed saved rogue)) 
    804                      (widget-apply widget :custom-reset-standard)))) 
    805             children))) 
     803    (when (or (and (= 1 (length children)) 
     804                   (memq (widget-type (car children)) 
     805                         '(custom-variable custom-face))) 
     806              (yes-or-no-p "Really erase all customizations in this buffer? ")) 
     807      (mapc (lambda (widget) 
     808              (and (if (widget-get widget :custom-standard-value) 
     809                       (widget-apply widget :custom-standard-value) 
     810                     t) 
     811                   (memq (widget-get widget :custom-state) 
     812                         '(modified set changed saved rogue)) 
     813                   (widget-apply widget :custom-reset-standard))) 
     814            children)))) 
    806815 
    807816;;; The Customize Commands 
     
    21242133(defun custom-add-parent-links (widget &optional initial-string) 
    21252134  "Add \"Parent groups: ...\" to WIDGET if the group has parents. 
    2126 The value if non-nil if any parents were found. 
     2135The value is non-nil if any parents were found. 
    21272136If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." 
    21282137  (let ((name (widget-value widget)) 
     
    21332142    (insert (or initial-string "Parent groups:")) 
    21342143    (mapatoms (lambda (symbol) 
    2135                 (let ((entry (assq name (get symbol 'custom-group)))) 
    2136                   (when (eq (nth 1 entry) type) 
    2137                     (insert " ") 
    2138                     (push (widget-create-child-and-convert 
    2139                            widget 'custom-group-link 
    2140                            :tag (custom-unlispify-tag-name symbol) 
    2141                            symbol) 
    2142                           buttons) 
    2143                     (setq parents (cons symbol parents)))))) 
     2144                (when (member (list name type) (get symbol 'custom-group)) 
     2145                  (insert " ") 
     2146                  (push (widget-create-child-and-convert 
     2147                         widget 'custom-group-link 
     2148                         :tag (custom-unlispify-tag-name symbol) 
     2149                         symbol) 
     2150                        buttons) 
     2151                  (setq parents (cons symbol parents))))) 
    21442152    (and (null (get name 'custom-links)) ;No links of its own. 
    21452153         (= (length parents) 1)         ;A single parent. 
     
    33983406(define-widget 'face 'symbol 
    33993407  "A Lisp face name (with sample)." 
    3400   :format "%t: (%{sample%}) %v" 
     3408  :format "%{%t%}: (%{sample%}) %v" 
    34013409  :tag "Face" 
    34023410  :value 'default