unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Visual cleanup for customize buffers
@ 2006-01-12 21:58 Kim F. Storm
  2006-01-12 23:45 ` Luc Teirlinck
                   ` (3 more replies)
  0 siblings, 4 replies; 57+ messages in thread
From: Kim F. Storm @ 2006-01-12 21:58 UTC (permalink / raw)



Here are some trivial patches to cleanup some of the visual clutter in
customize buffers:

- Don't show the "Hide value" button for trivial values which
  fit on one line initially.  I don't see ANY reason why a
  user would click on that button to, say, hide a boolean
  or numeric value.

- For choice values, replace the old [Value Menu] Value
  by the more common [Value v] (where v is a "pull down" icon)
  
  To see some good examples of this, try M-x customize-group cua
  and look at the variables "cua prefix override inhibit delay"
  and "Cua normal cursor color".

- Remove the empty line between the [STATE] line and the documentation.


*** wid-edit.el	04 Jan 2006 17:15:51 +0100	1.160
--- wid-edit.el	12 Jan 2006 22:42:11 +0100	
***************
*** 1416,1421 ****
--- 1416,1423 ----
    (call-interactively (or (widget-get widget :complete-function)
  			  widget-complete-field)))
  
+ (defvar widget-choice-menu-image nil)
+ 
  (defun widget-default-create (widget)
    "Create WIDGET at point in the current buffer."
    (widget-specify-insert
***************
*** 1423,1429 ****
  	 button-begin button-end
  	 sample-begin sample-end
  	 doc-begin doc-end
! 	 value-pos)
       (insert (widget-get widget :format))
       (goto-char from)
       ;; Parse escapes in format.
--- 1425,1431 ----
  	 button-begin button-end
  	 sample-begin sample-end
  	 doc-begin doc-end
! 	 value-pos value-choice-button)
       (insert (widget-get widget :format))
       (goto-char from)
       ;; Parse escapes in format.
***************
*** 1436,1443 ****
  		(setq button-begin (point))
  		(insert (widget-get-indirect widget :button-prefix)))
  	       ((eq escape ?\])
! 		(insert (widget-get-indirect widget :button-suffix))
! 		(setq button-end (point)))
  	       ((eq escape ?\{)
  		(setq sample-begin (point)))
  	       ((eq escape ?\})
--- 1438,1471 ----
  		(setq button-begin (point))
  		(insert (widget-get-indirect widget :button-prefix)))
  	       ((eq escape ?\])
! 		(save-excursion
! 		  (setq button-end (point))
! 		  (when value-choice-button
! 		    (goto-char button-begin)
! 		    (when (search-forward ":" button-end t)
! 		      (setq button-end (1- (point))))
! 		    (goto-char button-end)
! 		    (when (eq (preceding-char) ?\n)
! 		      (backward-char 1))
! 		    (insert " ")
! 		    (if (display-graphic-p)
! 			(insert-image
! 			 (or widget-choice-menu-image
! 			     (setq widget-choice-menu-image
! 				   (create-image "\377\176\176\074\074\030\030\377"
! 						 'xbm t :width 8 :height 8
! 						 :foreground
! 						 (if (facep 'custom-button)
! 						     (face-foreground 'custom-button)
! 						   "black")
! 						 :background
! 						 (if (facep 'custom-button)
! 						     (face-background 'custom-button)
! 						   "lightgrey")
! 						 :ascent 'center))) ">")
! 		      (insert (propertize "?>" ))
! 		    (setq button-end (point)))
! 		  (insert (widget-get-indirect widget :button-suffix))))
  	       ((eq escape ?\{)
  		(setq sample-begin (point)))
  	       ((eq escape ?\})
***************
*** 1469,1474 ****
--- 1497,1505 ----
  		(if (and button-begin (not button-end))
  		    (widget-apply widget :value-create)
  		  (setq value-pos (point))))
+ 	       ((eq escape ?V)
+ 		(widget-apply widget :value-create)
+ 		(setq value-choice-button t))
  	       (t
  		(widget-apply widget :format-handler escape)))))
       ;; Specify button, sample, and doc, and insert value.
***************
*** 3560,3566 ****
  (define-widget 'choice 'menu-choice
    "A union of several sexp types."
    :tag "Choice"
!   :format "%{%t%}: %[Value Menu%] %v"
    :button-prefix 'widget-push-button-prefix
    :button-suffix 'widget-push-button-suffix
    :prompt-value 'widget-choice-prompt-value)
--- 3591,3597 ----
  (define-widget 'choice 'menu-choice
    "A union of several sexp types."
    :tag "Choice"
!   :format "%{%t%}: %[%V%]"
    :button-prefix 'widget-push-button-prefix
    :button-suffix 'widget-push-button-suffix
    :prompt-value 'widget-choice-prompt-value)
***************
*** 3629,3635 ****
    :prompt-value 'widget-boolean-prompt-value
    :button-prefix 'widget-push-button-prefix
    :button-suffix 'widget-push-button-suffix
!   :format "%{%t%}: %[Toggle%]  %v\n"
    :on "on (non-nil)"
    :off "off (nil)")
  
--- 3660,3666 ----
    :prompt-value 'widget-boolean-prompt-value
    :button-prefix 'widget-push-button-prefix
    :button-suffix 'widget-push-button-suffix
!   :format "%{%t%}: %v  %[Toggle%]\n"
    :on "on (non-nil)"
    :off "off (nil)")
  
*** cus-edit.el	12 Jan 2006 09:13:27 +0100	1.275
--- cus-edit.el	12 Jan 2006 22:11:35 +0100	
***************
*** 2513,2526 ****
  		    tag)
  		   buttons)
  	     (insert " ")
! 	     (push (widget-create-child-and-convert
! 		    widget 'visibility
! 		    :help-echo "Hide the value of this option."
! 		    :on "Hide Value"
! 		    :off "Show Value"
! 		    :action 'custom-toggle-parent
! 		    t)
! 		   buttons)
  	     (push (widget-create-child-and-convert
  		    widget type
  		    :format value-format
--- 2513,2527 ----
  		    tag)
  		   buttons)
  	     (insert " ")
! 	     (unless (atom value)
! 	       (push (widget-create-child-and-convert
! 		      widget 'visibility
! 		      :help-echo "Hide the value of this option."
! 		      :on "Hide Value"
! 		      :off "Show Value"
! 		      :action 'custom-toggle-parent
! 		      t)
! 		     buttons))
  	     (push (widget-create-child-and-convert
  		    widget type
  		    :format value-format
***************
*** 2540,2546 ****
        ;; 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)
  
--- 2541,2548 ----
        ;; this anyway. The doc string widget should be added like the others.
        ;; --dv
        (widget-put widget :buttons buttons)
!       (unless (eq (preceding-char) ?\n)
! 	(insert "\n"))
        ;; Insert documentation.
        (widget-default-format-handler widget ?h)
  

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2006-02-06 17:35 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-12 21:58 Visual cleanup for customize buffers Kim F. Storm
2006-01-12 23:45 ` Luc Teirlinck
2006-01-13 12:37   ` Kim F. Storm
2006-01-13 14:18     ` Luc Teirlinck
2006-01-13 15:16       ` Kim F. Storm
2006-01-13 19:05         ` Drew Adams
2006-01-13 19:16         ` David Kastrup
2006-01-13 23:28         ` Luc Teirlinck
2006-01-13 23:34           ` Luc Teirlinck
2006-01-14 16:14           ` Richard M. Stallman
2006-01-14  0:08         ` Luc Teirlinck
2006-01-14  0:44         ` Luc Teirlinck
2006-01-14  1:56           ` Kim F. Storm
2006-01-14  2:58             ` Chong Yidong
2006-01-14  6:10             ` Drew Adams
2006-01-14 16:14           ` Richard M. Stallman
2006-01-14 16:14         ` Richard M. Stallman
2006-01-14 20:50           ` Lennart Borgman
2006-01-14 21:32             ` Luc Teirlinck
2006-01-14 21:47               ` Lennart Borgman
2006-01-15 18:09                 ` Luc Teirlinck
2006-01-15 18:41                 ` Kim F. Storm
2006-01-15 19:59                   ` Luc Teirlinck
2006-01-14 21:58           ` Drew Adams
2006-01-14 22:17             ` Drew Adams
2006-01-15  1:40           ` Luc Teirlinck
2006-01-15 23:08             ` Richard M. Stallman
2006-01-16  4:19               ` Luc Teirlinck
2006-01-19 17:44                 ` Richard M. Stallman
2006-01-17  4:20               ` Luc Teirlinck
2006-01-17 20:00                 ` Richard M. Stallman
2006-01-20  0:18                   ` Luc Teirlinck
2006-01-13 16:40     ` Stefan Monnier
2006-01-13 19:04   ` Bill Wohler
2006-01-14  1:28     ` Luc Teirlinck
2006-01-14  1:46       ` Bill Wohler
2006-01-14  5:49   ` Richard M. Stallman
2006-01-14 15:28     ` Luc Teirlinck
2006-01-13  0:08 ` Luc Teirlinck
2006-01-13 15:24   ` Kim F. Storm
2006-01-13 19:33     ` martin rudalics
2006-01-13  0:24 ` Luc Teirlinck
2006-01-14  5:48   ` Richard M. Stallman
2006-01-14  5:49 ` Richard M. Stallman
2006-01-14 15:07   ` Luc Teirlinck
2006-01-14 23:05   ` Luc Teirlinck
2006-01-15  4:40     ` Luc Teirlinck
2006-02-05  0:07     ` Kim F. Storm
2006-02-06  2:07       ` Richard M. Stallman
2006-02-06  4:30       ` Luc Teirlinck
2006-02-06  7:21         ` Eli Zaretskii
2006-02-06 17:35           ` Luc Teirlinck
2006-01-14 23:27   ` Luc Teirlinck
2006-01-14 23:45     ` Drew Adams
2006-01-15 18:59     ` Kim F. Storm
2006-01-15  4:17   ` Luc Teirlinck
2006-01-15 23:08     ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).