emacs-devel
[Top][All Lists]
Advanced

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

Re: fancy-splash-screen customize group...


From: Lennart Borgman
Subject: Re: fancy-splash-screen customize group...
Date: Thu, 08 Dec 2005 01:39:47 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Peter Whaite wrote:

Lennart Borgman <address@hidden> wrote:
Thanks, but are there really state buttons that are not next to options? Is
not both yours and mine sentence wrong then? Or can you give an example,
please?

At the top of every customize group page there is a global state button
that can be used to set or save all the options that have been changed
in the page, e.g.

/- Emacs group: ---------------------------------------------------------\
     State: visible group members are all at standard settings.
  Customization of the One True Editor.
  See also Manual.

No big deal, though I don't think its necessary to say 'next to' as the
association between the State button and the option is obvious enough.
Based on the feed back I made a new patch. I added the mouse over face (requires a small change to wid-edit.el - I think Per A hinted about that earlier) and rewrote the header text little. There is now also an explanation of what a button is in case there are no "custom-raised-buttons".

I kept the 'next to' this time, I am not convinced yet ;-)
Index: cus-edit.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/cus-edit.el,v
retrieving revision 1.243
diff -c -r1.243 cus-edit.el
*** cus-edit.el 4 Dec 2005 02:39:24 -0000       1.243
--- cus-edit.el 8 Dec 2005 00:31:47 -0000
***************
*** 1412,1417 ****
--- 1412,1424 ----
                   'custom-button-pressed
                 'custom-button-pressed-unraised))))
  
+ (defface custom-link-face
+   `((((class color) (background light)) (:foreground "blue" :underline t))
+     (((class color) (background dark)) (:foreground "cyan" :underline t)))
+   "Face used to highlight attributes that are links."
+   :group 'custom-faces)
+ 
+ 
  (defun custom-buffer-create-internal (options &optional description)
    (custom-mode)
    (if custom-buffer-verbose-help
***************
*** 1419,1445 ****
        (widget-insert "This is a customization buffer")
        (if description
            (widget-insert description))
!       (widget-insert (format ".
! %s show active fields; type RET or click mouse-1
! on an active field to invoke its action.  Editing an option value
! changes only the text in the buffer.  Invoke the State button to set or
! save the option value.  Saving an option normally edits your init file.
! Invoke "
!                              (if custom-raised-buttons
!                                  "`Raised' buttons"
!                                "Square brackets")))
        (widget-create 'info-link
!                      :tag "Custom file"
                       "(emacs)Saving Customizations")
        (widget-insert
!        " for information on how to save in a different file.
! Invoke ")
        (widget-create 'info-link
!                      :tag "Help"
                       :help-echo "Read the online help."
                       "(emacs)Easy Customization")
!       (widget-insert " for general information.\n\n")
!       (widget-insert "Operate on everything in this buffer:\n "))
      (widget-insert " "))
    (widget-create 'push-button
                 :tag "Set for Current Session"
--- 1426,1461 ----
        (widget-insert "This is a customization buffer")
        (if description
            (widget-insert description))
!       (widget-insert ".
! 
! Editing an option value changes only the text in the buffer.  The
! State button next to the option can be used to set or save the
! value.
! 
! Saving an option normally edits your init file. See ")
        (widget-create 'info-link
!                        :button-face 'custom-link-face
!                        :button-prefix ""
!                        :button-suffix ""
!                        :mouse-face 'highlight
!                      :tag "custom file"
                       "(emacs)Saving Customizations")
        (widget-insert
!        "\nfor information on how to save in a different file.\n\nSee ")
! 
        (widget-create 'info-link
!                        :button-face 'custom-link-face
!                        :button-prefix ""
!                        :button-suffix ""
!                        :mouse-face 'highlight
!                      :tag "help"
                       :help-echo "Read the online help."
                       "(emacs)Easy Customization")
!       (widget-insert " for more information.\n\n")
!         (unless custom-raised-buttons
!           (widget-insert
!            "Note: On your display type 'buttons' are represented with 
square\nbrackets.\n\n"))
!       (widget-insert "Operate on all options in this buffer:\n "))
      (widget-insert " "))
    (widget-create 'push-button
                 :tag "Set for Current Session"
***************
*** 2149,2154 ****
--- 2165,2174 ----
                  (insert " ")
                  (push (widget-create-child-and-convert
                         widget 'custom-group-link
+                          :button-face 'custom-link-face
+                          :button-prefix ""
+                          :button-suffix ""
+                          :mouse-face 'highlight
                         :tag (custom-unlispify-tag-name symbol)
                         symbol)
                        buttons)
***************
*** 2160,2166 ****
             (when links
               (insert "\nParent documentation: ")
               (while links
!                (push (widget-create-child-and-convert widget (car links))
                       buttons)
                 (setq links (cdr links))
                 (cond ((null links)
--- 2180,2192 ----
             (when links
               (insert "\nParent documentation: ")
               (while links
!                (push (widget-create-child-and-convert
!                       widget (car links)
!                       :button-face 'custom-link-face
!                       :button-prefix ""
!                       :button-suffix ""
!                       :mouse-face 'highlight
!                       )
                       buttons)
                 (setq links (cdr links))
                 (cond ((null links)
Index: wid-edit.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.155
diff -c -r1.155 wid-edit.el
*** wid-edit.el 16 Nov 2005 22:15:59 -0000      1.155
--- wid-edit.el 8 Dec 2005 00:21:50 -0000
***************
*** 403,409 ****
      ;; We want to avoid the face with image buttons.
      (unless (widget-get widget :suppress-face)
        (overlay-put overlay 'face (widget-apply widget :button-face-get))
!       (overlay-put overlay 'mouse-face widget-mouse-face))
      (overlay-put overlay 'pointer 'hand)
      (overlay-put overlay 'follow-link follow-link)
      (overlay-put overlay 'help-echo help-echo)))
--- 403,410 ----
      ;; We want to avoid the face with image buttons.
      (unless (widget-get widget :suppress-face)
        (overlay-put overlay 'face (widget-apply widget :button-face-get))
!       ;;(overlay-put overlay 'mouse-face widget-mouse-face))
!       (overlay-put overlay 'mouse-face (widget-apply widget :mouse-face-get)))
      (overlay-put overlay 'pointer 'hand)
      (overlay-put overlay 'follow-link follow-link)
      (overlay-put overlay 'help-echo help-echo)))
***************
*** 1390,1395 ****
--- 1391,1397 ----
    :offset 0
    :format-handler 'widget-default-format-handler
    :button-face-get 'widget-default-button-face-get
+   :mouse-face-get 'widget-default-mouse-face-get
    :sample-face-get 'widget-default-sample-face-get
    :delete 'widget-default-delete
    :copy 'identity
***************
*** 1533,1538 ****
--- 1535,1548 ----
        (if parent
            (widget-apply parent :button-face-get)
          widget-button-face))))
+ 
+ (defun widget-default-mouse-face-get (widget)
+   ;; Use :mouse-face or widget-mouse-face
+   (or (widget-get widget :mouse-face)
+       (let ((parent (widget-get widget :parent)))
+       (if parent
+           (widget-apply parent :mouse-face-get)
+         widget-mouse-face))))
  
  (defun widget-default-sample-face-get (widget)
    ;; Use :sample-face.

reply via email to

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