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,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el,v
Date: Thu, 14 Jun 2007 23:08:20 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/06/14 23:08:20

Index: cus-edit.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/cus-edit.el,v
retrieving revision 1.320
retrieving revision 1.321
diff -u -b -r1.320 -r1.321
--- cus-edit.el 14 Jun 2007 09:59:49 -0000      1.320
+++ cus-edit.el 14 Jun 2007 23:08:20 -0000      1.321
@@ -501,17 +501,12 @@
 
 (defun custom-split-regexp-maybe (regexp)
   "If REGEXP is a string, split it to a list at `\\|'.
-You can get the original back with from the result with:
+You can get the original back from the result with:
   (mapconcat 'identity result \"\\|\")
 
 IF REGEXP is not a string, return it unchanged."
   (if (stringp regexp)
-      (let ((start 0)
-           all)
-       (while (string-match "\\\\|" regexp start)
-         (setq all (cons (substring regexp start (match-beginning 0)) all)
-               start (match-end 0)))
-       (nreverse (cons (substring regexp start) all)))
+      (split-string regexp "\\\\|")
     regexp))
 
 (defun custom-variable-prompt ()
@@ -1559,18 +1554,15 @@
                                 "Square brackets indicate")))
        (if init-file-user
            (widget-insert "
-Use the setting's State button to set it or save changes in it.
-Saving a change normally works by editing your Emacs init file.")
+Use the Save or Set buttons to set apply your changes.
+Saving a change normally works by editing your Emacs ")
            (widget-insert "
-\nSince you started Emacs with `-q', which inhibits use of the
-Emacs init file, you cannot save settings into the Emacs init file."))
-       (widget-insert "\nSee ")
+\nSince you started Emacs with `-q', you cannot save settings into
+the Emacs "))
        (widget-create 'custom-manual
-                      :tag "Custom file"
+                      :tag "init file"
                       "(emacs)Saving Customizations")
-       (widget-insert
-        " for information on how to save in a different file.\n
-See ")
+       (widget-insert ".\nSee ")
        (widget-create 'custom-manual
                       :tag "Help"
                       :help-echo "Read the online help."
@@ -2439,13 +2431,13 @@
 (defface custom-variable-tag
   `((((class color)
       (background dark))
-     (:foreground "light blue" :weight bold :height 1.2 :inherit 
variable-pitch))
+     (:foreground "light blue" :weight bold :inherit variable-pitch))
     (((min-colors 88) (class color)
       (background light))
-     (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
+     (:foreground "blue1" :weight bold :inherit variable-pitch))
     (((class color)
       (background light))
-     (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))
+     (:foreground "blue" :weight bold :inherit variable-pitch))
     (t (:weight bold)))
   "Face used for unpushable variable tags."
   :group 'custom-faces)
@@ -2636,15 +2628,11 @@
                    widget 'custom-magic nil)))
        (widget-put widget :custom-magic magic)
        (push magic buttons))
-      ;; ### NOTE: this is ugly!!!! I need to 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.
-      ;; --dv
       (widget-put widget :buttons buttons)
       (insert "\n")
       ;; Insert documentation.
-      (widget-default-format-handler widget ?h)
+      (widget-add-documentation-string-button
+       widget :visibility-widget 'custom-visibility)
 
       ;; The comment field
       (unless (eq state 'hidden)
@@ -2984,6 +2972,21 @@
     ;; This call will possibly make the comment invisible
     (custom-redraw widget)))
 
+;;; The `custom-visibility' Widget
+
+(define-widget 'custom-visibility 'visibility
+  "Show or hide a documentation string."
+  :button-face 'custom-visibility
+  :pressed-face 'custom-visibility
+  :mouse-face 'highlight
+  :pressed-face 'highlight)
+
+(defface custom-visibility
+  '((t :height 0.8 :inherit link))
+  "Face for the `custom-visibility' widget."
+  :version "23.1"
+  :group 'custom-faces)
+
 ;;; The `custom-face-edit' Widget.
 
 (define-widget 'custom-face-edit 'checklist
@@ -3355,7 +3358,9 @@
           ;; Update buttons.
           (widget-put widget :buttons buttons)
           ;; Insert documentation.
-          (widget-default-format-handler widget ?h)
+          (widget-add-documentation-string-button
+           widget :visibility-widget 'custom-visibility)
+
           ;; The comment field
           (unless (eq state 'hidden)
             (let* ((comment (get symbol 'face-comment))
@@ -3927,7 +3932,9 @@
           ;; Insert documentation.
           (if (and (eq custom-buffer-style 'links) (> level 1))
               (widget-put widget :documentation-indent 0))
-          (widget-default-format-handler widget ?h))
+          (widget-add-documentation-string-button
+           widget :visibility-widget 'custom-visibility))
+
          ;; Nested style.
          (t                            ;Visible.
           ;; Add parent groups references above the group.
@@ -3935,7 +3942,7 @@
                    ;;; was made to display a group.
               (when (eq level 1)
                 (if (custom-add-parent-links widget
-                                             "Go to parent group:")
+                                             "Parent group:")
                     (insert "\n"))))
           ;; Create level indicator.
           (insert-char ?\  (* custom-buffer-indent (1- level)))
@@ -3971,7 +3978,9 @@
           ;; Update buttons.
           (widget-put widget :buttons buttons)
           ;; Insert documentation.
-          (widget-default-format-handler widget ?h)
+          (widget-add-documentation-string-button
+           widget :visibility-widget 'custom-visibility)
+
           ;; Parent groups.
           (if nil  ;;; This should test that the buffer
                    ;;; was not made to display a group.




reply via email to

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