emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/cus-edit.el


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el
Date: Sun, 27 Feb 2005 05:34:05 -0500

Index: emacs/lisp/cus-edit.el
diff -c emacs/lisp/cus-edit.el:1.213 emacs/lisp/cus-edit.el:1.214
*** emacs/lisp/cus-edit.el:1.213        Tue Feb 22 23:12:15 2005
--- emacs/lisp/cus-edit.el      Sun Feb 27 10:34:05 2005
***************
*** 1367,1373 ****
    :group 'custom-buffer)
  
  (defun custom-buffer-create-internal (options &optional description)
-   (message "Creating customization buffer...")
    (custom-mode)
    (if custom-buffer-verbose-help
        (progn
--- 1367,1372 ----
***************
*** 1387,1393 ****
                       :help-echo "Read the online help."
                       "(emacs)Easy Customization")
        (widget-insert " for more information.\n\n")
-       (message "Creating customization buttons...")
        (widget-insert "Operate on everything in this buffer:\n "))
      (widget-insert " "))
    (widget-create 'push-button
--- 1386,1391 ----
***************
*** 1478,1490 ****
    (unless (eq (preceding-char) ?\n)
      (widget-insert "\n"))
    (message "Creating customization items ...done")
    (unless (eq custom-buffer-style 'tree)
      (mapc 'custom-magic-reset custom-options))
    (message "Creating customization setup...")
    (widget-setup)
    (buffer-enable-undo)
    (goto-char (point-min))
!   (message "Creating customization buffer...done"))
  
  ;;; The Tree Browser.
  
--- 1476,1490 ----
    (unless (eq (preceding-char) ?\n)
      (widget-insert "\n"))
    (message "Creating customization items ...done")
+   (message "Resetting customization items...")
    (unless (eq custom-buffer-style 'tree)
      (mapc 'custom-magic-reset custom-options))
+   (message "Resetting customization items...done")
    (message "Creating customization setup...")
    (widget-setup)
    (buffer-enable-undo)
    (goto-char (point-min))
!   (message "Creating customization setup...done"))
  
  ;;; The Tree Browser.
  
***************
*** 1675,1689 ****
  the value displayed for this %c is invalid and cannot be set.")
      (modified "*" custom-modified-face "\
  you have edited the value as text, but you have not set the %c." "\
! you have edited something in this group, but not set anything yet.")
      (set "+" custom-set-face "\
  you have set this %c, but not saved it for future sessions." "\
! you have set something in this group, but not saved anything yet.")
      (changed ":" custom-changed-face "\
  this %c has been changed outside the customize buffer." "\
  something in this group has been changed outside customize.")
      (saved "!" custom-saved-face "\
! You have set this %c and saved it through Customize in your init file." "\
  something in this group has been set and saved.")
      (rogue "@" custom-rogue-face "\
  this %c has not been changed with customize." "\
--- 1675,1689 ----
  the value displayed for this %c is invalid and cannot be set.")
      (modified "*" custom-modified-face "\
  you have edited the value as text, but you have not set the %c." "\
! something in this group has been edited but not set.")
      (set "+" custom-set-face "\
  you have set this %c, but not saved it for future sessions." "\
! something in this group has been set but not saved.")
      (changed ":" custom-changed-face "\
  this %c has been changed outside the customize buffer." "\
  something in this group has been changed outside customize.")
      (saved "!" custom-saved-face "\
! You've set this %c and Customize saved it in your init file." "\
  something in this group has been set and saved.")
      (rogue "@" custom-rogue-face "\
  this %c has not been changed with customize." "\
***************
*** 3285,3338 ****
  
  ;;; The `face' Widget.
  
! (define-widget 'face 'default
!   "Select and customize a face."
!   :convert-widget 'widget-value-convert-widget
!   :button-prefix 'widget-push-button-prefix
!   :button-suffix 'widget-push-button-suffix
!   :format "%{%t%}: %[select face%] %v"
!   :tag "Face"
!   :value 'default
    :value-create 'widget-face-value-create
!   :value-delete 'widget-face-value-delete
!   :value-get 'widget-value-value-get
!   :validate 'widget-children-validate
!   :action 'widget-face-action
!   :match (lambda (widget value) (symbolp value)))
  
  (defun widget-face-value-create (widget)
!   "Create a `custom-face' child."
!   (let* ((symbol (widget-value widget))
!        (custom-buffer-style 'face)
!        (child (widget-create-child-and-convert
!                widget 'custom-face
!                :custom-level nil
!                :value symbol)))
!     (custom-magic-reset child)
!     (setq custom-options (cons child custom-options))
!     (widget-put widget :children (list child))))
! 
! (defun widget-face-value-delete (widget)
!   "Remove the child from the options."
!   (let ((child (car (widget-get widget :children))))
!     (setq custom-options (delq child custom-options))
!     (widget-children-value-delete widget)))
! 
! (defvar face-history nil
!   "History of entered face names.")
! 
! (defun widget-face-action (widget &optional event)
!   "Prompt for a face."
!   (let ((answer (completing-read "Face: "
!                                (mapcar (lambda (face)
!                                          (list (symbol-name face)))
!                                        (face-list))
!                                nil nil nil
!                                'face-history)))
!     (unless (zerop (length answer))
!       (widget-value-set widget (intern answer))
!       (widget-apply widget :notify widget event)
!       (widget-setup))))
  
  ;;; The `hook' Widget.
  
--- 3285,3353 ----
  
  ;;; The `face' Widget.
  
! (defvar widget-face-prompt-value-history nil
!   "History of input to `widget-face-prompt-value'.")
! 
! (define-widget 'face 'restricted-sexp
!   "A Lisp face name."
!   :complete-function (lambda ()
!                      (interactive)
!                      (lisp-complete-symbol 'facep))
!   :prompt-value 'widget-field-prompt-value
!   :prompt-internal 'widget-symbol-prompt-internal
!   :prompt-match 'facep
!   :prompt-history 'widget-face-prompt-value-history
    :value-create 'widget-face-value-create
!   :action 'widget-field-action
!   :match-alternatives '(facep)
!   :validate (lambda (widget)
!             (unless (facep (widget-value widget))
!               (widget-put widget :error (format "Invalid face: %S"
!                                                 (widget-value widget)))
!               widget))
!   :value 'ignore
!   :tag "Function")
! 
! 
! ;;; There is a bug here: the sample doesn't get redisplayed
! ;;; in the new font when you specify one.  Does anyone know how to
! ;;; make that work?  -- rms.
  
  (defun widget-face-value-create (widget)
!   "Create an editable face name field."
!   (let ((buttons (widget-get widget :buttons))
!       (symbol (widget-get widget :value)))
!     ;; Sample.
!     (push (widget-create-child-and-convert widget 'item
!                                          :format "(%{%t%})"
!                                          :sample-face symbol
!                                          :tag "sample")
!         buttons)
!     (insert " ")
!     ;; Update buttons.
!     (widget-put widget :buttons buttons))
! 
!   (let ((size (widget-get widget :size))
!       (value (widget-get widget :value))
!       (from (point))
!       ;; This is changed to a real overlay in `widget-setup'.  We
!       ;; need the end points to behave differently until
!       ;; `widget-setup' is called.
!       (overlay (cons (make-marker) (make-marker))))
!     (widget-put widget :field-overlay overlay)
!     (insert value)
!     (and size
!        (< (length value) size)
!        (insert-char ?\  (- size (length value))))
!     (unless (memq widget widget-field-list)
!       (setq widget-field-new (cons widget widget-field-new)))
!     (move-marker (cdr overlay) (point))
!     (set-marker-insertion-type (cdr overlay) nil)
!     (when (null size)
!       (insert ?\n))
!     (move-marker (car overlay) from)
!     (set-marker-insertion-type (car overlay) t)))
! 
  
  ;;; The `hook' Widget.
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]