comparison lisp/cus-edit.el @ 68278:125d04254c22

(custom-buffer-create-internal): State in the text above the whole buffer buttons that they do not operate on hidden items. (custom-face-menu): Use `custom-face-save' instead of `custom-face-save-command'. (custom-face-save-command): Make it an alias for `custom-face-save' and declare it obsolete. (custom-face-save): Doc fix.
author Luc Teirlinck <teirllm@auburn.edu>
date Thu, 19 Jan 2006 23:26:04 +0000
parents 4580b1bedd8a
children 05dbd20a248e
comparison
equal deleted inserted replaced
68277:a4e264f94259 68278:125d04254c22
1483 :button-face 'custom-link 1483 :button-face 'custom-link
1484 :mouse-face 'highlight 1484 :mouse-face 'highlight
1485 :help-echo "Read the online help." 1485 :help-echo "Read the online help."
1486 "(emacs)Easy Customization") 1486 "(emacs)Easy Customization")
1487 (widget-insert " for more information.\n\n") 1487 (widget-insert " for more information.\n\n")
1488 (widget-insert "Operate on everything in this buffer:\n ")) 1488 (widget-insert "Operate on all settings in this buffer that \
1489 are not marked HIDDEN:\n "))
1489 (widget-insert " ")) 1490 (widget-insert " "))
1490 (widget-create 'push-button 1491 (widget-create 'push-button
1491 :tag "Set for Current Session" 1492 :tag "Set for Current Session"
1492 :help-echo "\ 1493 :help-echo "\
1493 Make your editing in this buffer take effect for this session." 1494 Make your editing in this buffer take effect for this session."
3321 (message "Creating face editor...done")))))) 3322 (message "Creating face editor...done"))))))
3322 3323
3323 (defvar custom-face-menu 3324 (defvar custom-face-menu
3324 `(("Set for Current Session" custom-face-set) 3325 `(("Set for Current Session" custom-face-set)
3325 ,@(when (or custom-file user-init-file) 3326 ,@(when (or custom-file user-init-file)
3326 '(("Save for Future Sessions" custom-face-save-command))) 3327 '(("Save for Future Sessions" custom-face-save)))
3327 ("Undo Edits" custom-redraw 3328 ("Undo Edits" custom-redraw
3328 (lambda (widget) 3329 (lambda (widget)
3329 (memq (widget-get widget :custom-state) '(modified changed)))) 3330 (memq (widget-get widget :custom-state) '(modified changed))))
3330 ("Reset to Saved" custom-face-reset-saved 3331 ("Reset to Saved" custom-face-reset-saved
3331 (lambda (widget) 3332 (lambda (widget)
3446 (put symbol 'customized-face-comment comment) 3447 (put symbol 'customized-face-comment comment)
3447 (put symbol 'face-comment comment) 3448 (put symbol 'face-comment comment)
3448 (custom-face-state-set widget) 3449 (custom-face-state-set widget)
3449 (custom-redraw-magic widget))) 3450 (custom-redraw-magic widget)))
3450 3451
3451 (defun custom-face-save-command (widget) 3452 (defun custom-face-save (widget)
3452 "Save in `.emacs' the face attributes in WIDGET." 3453 "Save in `.emacs' the face attributes in WIDGET."
3453 (custom-face-save widget)
3454 (custom-save-all))
3455
3456 (defun custom-face-save (widget)
3457 "Prepare for saving WIDGET's face attributes, but don't write `.emacs'."
3458 (let* ((symbol (widget-value widget)) 3454 (let* ((symbol (widget-value widget))
3459 (child (car (widget-get widget :children))) 3455 (child (car (widget-get widget :children)))
3460 (value (custom-post-filter-face-spec (widget-value child))) 3456 (value (custom-post-filter-face-spec (widget-value child)))
3461 (comment-widget (widget-get widget :comment-widget)) 3457 (comment-widget (widget-get widget :comment-widget))
3462 (comment (widget-value comment-widget))) 3458 (comment (widget-value comment-widget)))
3477 (put symbol 'customized-face-comment nil) 3473 (put symbol 'customized-face-comment nil)
3478 (put symbol 'saved-face-comment comment) 3474 (put symbol 'saved-face-comment comment)
3479 (custom-save-all) 3475 (custom-save-all)
3480 (custom-face-state-set widget) 3476 (custom-face-state-set widget)
3481 (custom-redraw-magic widget))) 3477 (custom-redraw-magic widget)))
3478
3479 ;; For backward compatibility.
3480 (define-obsolete-function-alias 'custom-face-save-command 'custom-face-save
3481 "22.1")
3482 3482
3483 (defun custom-face-reset-saved (widget) 3483 (defun custom-face-reset-saved (widget)
3484 "Restore WIDGET to the face's default attributes." 3484 "Restore WIDGET to the face's default attributes."
3485 (let* ((symbol (widget-value widget)) 3485 (let* ((symbol (widget-value widget))
3486 (child (car (widget-get widget :children))) 3486 (child (car (widget-get widget :children)))