emacs-devel
[Top][All Lists]
Advanced

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

Re: [BUG] widget-field-overlay becomes wrong


From: Lars Hansen
Subject: Re: [BUG] widget-field-overlay becomes wrong
Date: Wed, 14 Jul 2004 09:00:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk

Per Abrahamsen wrote:

I think the problem in the example is that the "menu-choice" widget is
not "static text".  Whenever you make a new choice, the widget rewrite
itself from scratch.
Exactly. And that goes for editable text fields too. But never the less, text generated by :format is called "static text" in the manual.
I may be a good idea to avoid the term "static text"; it is misleading.

The second part of your patch should be applied.
We need changes in the first part as well because it is incorrect as it is now.
What about the attached rewrite without the term "static text"?

*** widget-1.26.texi    Thu Apr 29 21:25:30 2004
--- /home/lh/cvsroot/emacs/man/widget.texi      Wed Jul 14 08:52:33 2004
***************
*** 213,226 ****
  
  Editable text fields are created by the @code{editable-field} widget.
  
! An editable field must be surrounded by static text on both sides, that
! is, text that does not change in the lifetime of the widget.  If the
! field extends to the end of the line, the terminating line-feed character
! will count as the necessary static text on that end, but you will have
! to provide the static text before the field yourself.  The
! @code{:format} keyword is useful for generating the static text; for
! instance, if you give it a value of @code{"Name: %v"}, the "Name: " part
! will count as the static text.
  
  The editing text fields are highlighted with the
  @code{widget-field-face} face, making them easy to find.
--- 213,228 ----
  
  Editable text fields are created by the @code{editable-field} widget.
  
! In an @code{editable-field} widget, the editable field is not allowed
! to be adjacent to a neighbouring widget, there must be some text in
! between.  This text must be part of the @code{editable-field} widget
! itself or inserted with @code{widget-insert}.  The @code{:format}
! keyword is useful for generating the necessary text; for instance, if
! you give it a value of @code{"Name: %v "}, the "Name: " part will
! provide the text before the field and the trailing space will provide
! the text after the field.  If no @code{:size} argument is given the
! field will extends to the end of the line, and then the terminating
! line-feed character will count as the necessary text after the field.
  
  The editing text fields are highlighted with the
  @code{widget-field-face} face, making them easy to find.
***************
*** 345,350 ****
--- 347,353 ----
    (widget-insert "Here is some documentation.\n\nName: ")
    (widget-create 'editable-field
                 :size 13
+                :format "%v " ; Static text after the field!
                 "My Name")
    (widget-create 'menu-choice
                 :tag "Choose"

reply via email to

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