widget 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340
  1. This is ../../info/widget, produced by makeinfo version 4.13 from
  2. widget.texi.
  3. Copyright (C) 2000-2012 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this
  5. document under the terms of the GNU Free Documentation License,
  6. Version 1.3 or any later version published by the Free Software
  7. Foundation; with no Invariant Sections, with the Front-Cover texts
  8. being "A GNU Manual", and with the Back-Cover Texts as in (a)
  9. below. A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
  12. modify this GNU manual. Buying copies from the FSF supports it in
  13. developing GNU and promoting software freedom."
  14. INFO-DIR-SECTION Emacs lisp libraries
  15. START-INFO-DIR-ENTRY
  16. * Widget: (widget). The "widget" package used by the Emacs
  17. Customization facility.
  18. END-INFO-DIR-ENTRY
  19. 
  20. File: widget, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
  21. The Emacs Widget Library
  22. ************************
  23. Copyright (C) 2000-2012 Free Software Foundation, Inc.
  24. Permission is granted to copy, distribute and/or modify this
  25. document under the terms of the GNU Free Documentation License,
  26. Version 1.3 or any later version published by the Free Software
  27. Foundation; with no Invariant Sections, with the Front-Cover texts
  28. being "A GNU Manual", and with the Back-Cover Texts as in (a)
  29. below. A copy of the license is included in the section entitled
  30. "GNU Free Documentation License".
  31. (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
  32. modify this GNU manual. Buying copies from the FSF supports it in
  33. developing GNU and promoting software freedom."
  34. * Menu:
  35. * Introduction::
  36. * User Interface::
  37. * Programming Example::
  38. * Setting Up the Buffer::
  39. * Basic Types::
  40. * Sexp Types::
  41. * Widget Properties::
  42. * Defining New Widgets::
  43. * Widget Browser::
  44. * Widget Minor Mode::
  45. * Utilities::
  46. * Widget Wishlist::
  47. * GNU Free Documentation License::
  48. * Index::
  49. 
  50. File: widget, Node: Introduction, Next: User Interface, Prev: Top, Up: Top
  51. Introduction
  52. ============
  53. Most graphical user interface toolkits provide a number of standard
  54. user interface controls (sometimes known as `widgets' or `gadgets').
  55. Emacs doesn't really support anything like this, except for an
  56. incredibly powerful text "widget." On the other hand, Emacs does
  57. provide the necessary primitives to implement many other widgets within
  58. a text buffer. The `widget' package simplifies this task.
  59. The basic widgets are:
  60. `link'
  61. Areas of text with an associated action. Intended for hypertext
  62. links embedded in text.
  63. `push-button'
  64. Like link, but intended for stand-alone buttons.
  65. `editable-field'
  66. An editable text field. It can be either variable or fixed length.
  67. `menu-choice'
  68. Allows the user to choose one of multiple options from a menu, each
  69. option is itself a widget. Only the selected option will be
  70. visible in the buffer.
  71. `radio-button-choice'
  72. Allows the user to choose one of multiple options by activating
  73. radio buttons. The options are implemented as widgets. All
  74. options will be visible in the buffer.
  75. `item'
  76. A simple constant widget intended to be used in the `menu-choice'
  77. and `radio-button-choice' widgets.
  78. `choice-item'
  79. A button item only intended for use in choices. When invoked, the
  80. user will be asked to select another option from the choice widget.
  81. `toggle'
  82. A simple `on'/`off' switch.
  83. `checkbox'
  84. A checkbox (`[ ]'/`[X]').
  85. `editable-list'
  86. Create an editable list. The user can insert or delete items in
  87. the list. Each list item is itself a widget.
  88. Now, of what possible use can support for widgets be in a text
  89. editor? I'm glad you asked. The answer is that widgets are useful for
  90. implementing forms. A "form" in Emacs is a buffer where the user is
  91. supposed to fill out a number of fields, each of which has a specific
  92. meaning. The user is not supposed to change or delete any of the text
  93. between the fields. Examples of forms in Emacs are the `forms' package
  94. (of course), the customize buffers, the mail and news compose modes,
  95. and the HTML form support in the `w3' browser.
  96. The advantages for a programmer of using the `widget' package to
  97. implement forms are:
  98. 1. More complex fields than just editable text are supported.
  99. 2. You can give the users immediate feedback if they enter invalid
  100. data in a text field, and sometimes prevent entering invalid data.
  101. 3. You can have fixed sized fields, thus allowing multiple fields to
  102. be lined up in columns.
  103. 4. It is simple to query or set the value of a field.
  104. 5. Editing happens in the buffer, not in the mini-buffer.
  105. 6. Packages using the library get a uniform look, making them easier
  106. for the user to learn.
  107. 7. As support for embedded graphics improve, the widget library will
  108. be extended to use the GUI features. This means that your code
  109. using the widget library will also use the new graphic features
  110. automatically.
  111. 
  112. File: widget, Node: User Interface, Next: Programming Example, Prev: Introduction, Up: Top
  113. User Interface
  114. ==============
  115. A form consists of read only text for documentation and some fields,
  116. where each field contains two parts, a tag and a value. The tags are
  117. used to identify the fields, so the documentation can refer to the `foo
  118. field', meaning the field tagged with `Foo'. Here is an example form:
  119. Here is some documentation.
  120. Name: My Name *Choose*: This option
  121. Address: Some Place
  122. In some City
  123. Some country.
  124. See also _other work_ for more information.
  125. Numbers: count to three below
  126. [INS] [DEL] One
  127. [INS] [DEL] Eh, two?
  128. [INS] [DEL] Five!
  129. [INS]
  130. Select multiple:
  131. [X] This
  132. [ ] That
  133. [X] Thus
  134. Select one:
  135. (*) One
  136. ( ) Another One.
  137. ( ) A Final One.
  138. [Apply Form] [Reset Form]
  139. The top level widgets in this example are tagged `Name', `Choose',
  140. `Address', `_other work_', `Numbers', `Select multiple', `Select one',
  141. `[Apply Form]', and `[Reset Form]'. There are basically two things the
  142. user can do within a form, namely editing the editable text fields and
  143. activating the buttons.
  144. Editable Text Fields
  145. --------------------
  146. In the example, the value for the `Name' is most likely displayed in an
  147. editable text field, and so are values for each of the members of the
  148. `Numbers' list. All the normal Emacs editing operations are available
  149. for editing these fields. The only restriction is that each change you
  150. make must be contained within a single editable text field. For
  151. example, capitalizing all text from the middle of one field to the
  152. middle of another field is prohibited.
  153. Editable text fields are created by the `editable-field' widget.
  154. *Warning:* In an `editable-field' widget, the editable field must
  155. not be adjacent to another widget--that won't work. You must put some
  156. text in between. Either make this text part of the `editable-field'
  157. widget itself, or insert it with `widget-insert'.
  158. The `:format' keyword is useful for generating the necessary text;
  159. for instance, if you give it a value of `"Name: %v "', the `Name: '
  160. part will provide the necessary separating text before the field and
  161. the trailing space will provide the separating text after the field.
  162. If you don't include the `:size' keyword, the field will extend to the
  163. end of the line, and the terminating newline will provide separation
  164. after.
  165. *Warning:* In an `editable-field' widget, the `%v' escape must be
  166. preceded by some other text in the `:format' string (if specified).
  167. The editing text fields are highlighted with the `widget-field-face'
  168. face, making them easy to find.
  169. -- Face: widget-field-face
  170. Face used for other editing fields.
  171. Buttons
  172. -------
  173. Some portions of the buffer have an associated "action", which can be
  174. "invoked" by a standard key or mouse command. These portions are
  175. called "buttons". The default commands for activating a button are:
  176. `<RET>'
  177. -- Command: widget-button-press POS &optional EVENT
  178. Invoke the button at POS, defaulting to point. If point is
  179. not located on a button, invoke the binding in
  180. `widget-global-map' (by default the global map).
  181. `Mouse-2'
  182. -- Command: widget-button-click EVENT
  183. Invoke the button at the location of the mouse pointer. If
  184. the mouse pointer is located in an editable text field,
  185. invoke the binding in `widget-global-map' (by default the
  186. global map).
  187. There are several different kind of buttons, all of which are
  188. present in the example:
  189. _The Option Field Tags_
  190. When you invoke one of these buttons, you will be asked to choose
  191. between a number of different options. This is how you edit an
  192. option field. Option fields are created by the `menu-choice'
  193. widget. In the example, `Choose' is an option field tag.
  194. _The `[INS]' and `[DEL]' buttons_
  195. Activating these will insert or delete elements from an editable
  196. list. The list is created by the `editable-list' widget.
  197. _Embedded Buttons_
  198. The `_other work_' is an example of an embedded button. Embedded
  199. buttons are not associated with any fields, but can serve any
  200. purpose, such as implementing hypertext references. They are
  201. usually created by the `link' widget.
  202. _The `[ ]' and `[X]' buttons_
  203. Activating one of these will convert it to the other. This is
  204. useful for implementing multiple-choice fields. You can create
  205. them with the `checkbox' widget.
  206. _The `( )' and `(*)' buttons_
  207. Only one radio button in a `radio-button-choice' widget can be
  208. selected at any time. When you invoke one of the unselected radio
  209. buttons, it will be selected and the previous selected radio
  210. button will become unselected.
  211. _The `[Apply Form]' and `[Reset Form]' buttons_
  212. These are explicit buttons made with the `push-button' widget. The
  213. main difference from the `link' widget is that the buttons will be
  214. displayed as GUI buttons when possible.
  215. To make them easier to locate, buttons are emphasized in the buffer.
  216. -- Face: widget-button-face
  217. Face used for buttons.
  218. -- User Option: widget-mouse-face
  219. Face used for highlighting a button when the mouse pointer moves
  220. across it.
  221. Navigation
  222. ----------
  223. You can use all the normal Emacs commands to move around in a form
  224. buffer, plus you will have these additional commands:
  225. `<TAB>'
  226. -- Command: widget-forward &optional count
  227. Move point COUNT buttons or editing fields forward.
  228. `M-<TAB>'
  229. `S-<TAB>'
  230. -- Command: widget-backward &optional count
  231. Move point COUNT buttons or editing fields backward.
  232. 
  233. File: widget, Node: Programming Example, Next: Setting Up the Buffer, Prev: User Interface, Up: Top
  234. Programming Example
  235. ===================
  236. Here is the code to implement the user interface example (*note User
  237. Interface::).
  238. (require 'widget)
  239. (eval-when-compile
  240. (require 'wid-edit))
  241. (defvar widget-example-repeat)
  242. (defun widget-example ()
  243. "Create the widgets from the Widget manual."
  244. (interactive)
  245. (switch-to-buffer "*Widget Example*")
  246. (kill-all-local-variables)
  247. (make-local-variable 'widget-example-repeat)
  248. (let ((inhibit-read-only t))
  249. (erase-buffer))
  250. (remove-overlays)
  251. (widget-insert "Here is some documentation.\n\n")
  252. (widget-create 'editable-field
  253. :size 13
  254. :format "Name: %v " ; Text after the field!
  255. "My Name")
  256. (widget-create 'menu-choice
  257. :tag "Choose"
  258. :value "This"
  259. :help-echo "Choose me, please!"
  260. :notify (lambda (widget &rest ignore)
  261. (message "%s is a good choice!"
  262. (widget-value widget)))
  263. '(item :tag "This option" :value "This")
  264. '(choice-item "That option")
  265. '(editable-field :menu-tag "No option" "Thus option"))
  266. (widget-create 'editable-field
  267. :format "Address: %v"
  268. "Some Place\nIn some City\nSome country.")
  269. (widget-insert "\nSee also ")
  270. (widget-create 'link
  271. :notify (lambda (&rest ignore)
  272. (widget-value-set widget-example-repeat
  273. '("En" "To" "Tre"))
  274. (widget-setup))
  275. "other work")
  276. (widget-insert
  277. " for more information.\n\nNumbers: count to three below\n")
  278. (setq widget-example-repeat
  279. (widget-create 'editable-list
  280. :entry-format "%i %d %v"
  281. :notify (lambda (widget &rest ignore)
  282. (let ((old (widget-get widget
  283. ':example-length))
  284. (new (length (widget-value widget))))
  285. (unless (eq old new)
  286. (widget-put widget ':example-length new)
  287. (message "You can count to %d." new))))
  288. :value '("One" "Eh, two?" "Five!")
  289. '(editable-field :value "three")))
  290. (widget-insert "\n\nSelect multiple:\n\n")
  291. (widget-create 'checkbox t)
  292. (widget-insert " This\n")
  293. (widget-create 'checkbox nil)
  294. (widget-insert " That\n")
  295. (widget-create 'checkbox
  296. :notify (lambda (&rest ignore) (message "Tickle"))
  297. t)
  298. (widget-insert " Thus\n\nSelect one:\n\n")
  299. (widget-create 'radio-button-choice
  300. :value "One"
  301. :notify (lambda (widget &rest ignore)
  302. (message "You selected %s"
  303. (widget-value widget)))
  304. '(item "One") '(item "Another One.") '(item "A Final One."))
  305. (widget-insert "\n")
  306. (widget-create 'push-button
  307. :notify (lambda (&rest ignore)
  308. (if (= (length (widget-value widget-example-repeat))
  309. 3)
  310. (message "Congratulation!")
  311. (error "Three was the count!")))
  312. "Apply Form")
  313. (widget-insert " ")
  314. (widget-create 'push-button
  315. :notify (lambda (&rest ignore)
  316. (widget-example))
  317. "Reset Form")
  318. (widget-insert "\n")
  319. (use-local-map widget-keymap)
  320. (widget-setup))
  321. 
  322. File: widget, Node: Setting Up the Buffer, Next: Basic Types, Prev: Programming Example, Up: Top
  323. Setting Up the Buffer
  324. =====================
  325. Widgets are created with `widget-create', which returns a "widget"
  326. object. This object can be queried and manipulated by other widget
  327. functions, until it is deleted with `widget-delete'. After the widgets
  328. have been created, `widget-setup' must be called to enable them.
  329. -- Function: widget-create type [ keyword argument ]...
  330. Create and return a widget of type TYPE. The syntax for the TYPE
  331. argument is described in *note Basic Types::.
  332. The keyword arguments can be used to overwrite the keyword
  333. arguments that are part of TYPE.
  334. -- Function: widget-delete widget
  335. Delete WIDGET and remove it from the buffer.
  336. -- Function: widget-setup
  337. Set up a buffer to support widgets.
  338. This should be called after creating all the widgets and before
  339. allowing the user to edit them.
  340. If you want to insert text outside the widgets in the form, the
  341. recommended way to do that is with `widget-insert'.
  342. -- Function: widget-insert
  343. Insert the arguments, either strings or characters, at point. The
  344. inserted text will be read-only.
  345. There is a standard widget keymap which you might find useful.
  346. -- Const: widget-keymap
  347. <TAB> and `C-<TAB>' are bound to `widget-forward' and
  348. `widget-backward', respectively. <RET> and `Mouse-2' are bound to
  349. `widget-button-press' and `widget-button-click'.
  350. -- Variable: widget-global-map
  351. Keymap used by `widget-button-press' and `widget-button-click'
  352. when not on a button. By default this is `global-map'.
  353. 
  354. File: widget, Node: Basic Types, Next: Sexp Types, Prev: Setting Up the Buffer, Up: Top
  355. Basic Types
  356. ===========
  357. This is the general syntax of a type specification:
  358. NAME ::= (NAME [KEYWORD ARGUMENT]... ARGS)
  359. | NAME
  360. Where, NAME is a widget name, KEYWORD is the name of a property,
  361. ARGUMENT is the value of the property, and ARGS are interpreted in a
  362. widget specific way.
  363. The following keyword arguments apply to all widgets:
  364. `:value'
  365. The initial value for widgets of this type.
  366. `:format'
  367. This string will be inserted in the buffer when you create a
  368. widget. The following `%' escapes are available:
  369. `%['
  370. `%]'
  371. The text inside will be marked as a button.
  372. By default, the text will be shown in `widget-button-face',
  373. and surrounded by brackets.
  374. -- User Option: widget-button-prefix
  375. String to prefix buttons.
  376. -- User Option: widget-button-suffix
  377. String to suffix buttons.
  378. `%{'
  379. `%}'
  380. The text inside will be displayed with the face specified by
  381. `:sample-face'.
  382. `%v'
  383. This will be replaced with the buffer representation of the
  384. widget's value. What this is depends on the widget type.
  385. *Warning:* In an `editable-field' widget, the `%v' escape
  386. must be preceded by some other text in the format string (if
  387. specified).
  388. `%d'
  389. Insert the string specified by `:doc' here.
  390. `%h'
  391. Like `%d', with the following modifications: If the
  392. documentation string is more than one line, it will add a
  393. button which will toggle between showing only the first line,
  394. and showing the full text. Furthermore, if there is no
  395. `:doc' property in the widget, it will instead examine the
  396. `:documentation-property' property. If it is a lambda
  397. expression, it will be called with the widget's value as an
  398. argument, and the result will be used as the documentation
  399. text.
  400. `%t'
  401. Insert the string specified by `:tag' here, or the `princ'
  402. representation of the value if there is no tag.
  403. `%%'
  404. Insert a literal `%'.
  405. `:button-face'
  406. Face used to highlight text inside %[ %] in the format.
  407. `:button-prefix'
  408. `:button-suffix'
  409. Text around %[ %] in the format.
  410. These can be
  411. _nil_
  412. No text is inserted.
  413. _a string_
  414. The string is inserted literally.
  415. _a symbol_
  416. The value of the symbol is expanded according to this table.
  417. `:doc'
  418. The string inserted by the `%d' escape in the format string.
  419. `:tag'
  420. The string inserted by the `%t' escape in the format string.
  421. `:tag-glyph'
  422. Name of image to use instead of the string specified by `:tag' on
  423. Emacsen that supports it.
  424. `:help-echo'
  425. Specifies how to display a message whenever you move to the widget
  426. with either `widget-forward' or `widget-backward' or move the mouse
  427. over it (using the standard `help-echo' mechanism). The argument
  428. is either a string to display, a function of one argument, the
  429. widget, which should return a string to display, or a form that
  430. evaluates to such a string.
  431. `:follow-link'
  432. Specifies how to interpret a <mouse-1> click on the widget. *Note
  433. Defining Clickable Text: (elisp)Clickable Text.
  434. `:indent'
  435. An integer indicating the absolute number of spaces to indent
  436. children of this widget.
  437. `:offset'
  438. An integer indicating how many extra spaces to add to the widget's
  439. grandchildren compared to this widget.
  440. `:extra-offset'
  441. An integer indicating how many extra spaces to add to the widget's
  442. children compared to this widget.
  443. `:notify'
  444. A function called each time the widget or a nested widget is
  445. changed. The function is called with two or three arguments. The
  446. first argument is the widget itself, the second argument is the
  447. widget that was changed, and the third argument is the event
  448. leading to the change, if any.
  449. `:menu-tag'
  450. Tag used in the menu when the widget is used as an option in a
  451. `menu-choice' widget.
  452. `:menu-tag-get'
  453. Function used for finding the tag when the widget is used as an
  454. option in a `menu-choice' widget. By default, the tag used will
  455. be either the `:menu-tag' or `:tag' property if present, or the
  456. `princ' representation of the `:value' property if not.
  457. `:match'
  458. Should be a function called with two arguments, the widget and a
  459. value, and returning non-`nil' if the widget can represent the
  460. specified value.
  461. `:validate'
  462. A function which takes a widget as an argument, and returns `nil'
  463. if the widget's current value is valid for the widget. Otherwise
  464. it should return the widget containing the invalid data, and set
  465. that widget's `:error' property to a string explaining the error.
  466. The following predefined function can be used:
  467. -- Function: widget-children-validate widget
  468. All the `:children' of WIDGET must be valid.
  469. `:tab-order'
  470. Specify the order in which widgets are traversed with
  471. `widget-forward' or `widget-backward'. This is only partially
  472. implemented.
  473. a. Widgets with tabbing order `-1' are ignored.
  474. b. (Unimplemented) When on a widget with tabbing order N, go to
  475. the next widget in the buffer with tabbing order N+1 or `nil',
  476. whichever comes first.
  477. c. When on a widget with no tabbing order specified, go to the
  478. next widget in the buffer with a positive tabbing order, or
  479. `nil'
  480. `:parent'
  481. The parent of a nested widget (e.g. a `menu-choice' item or an
  482. element of a `editable-list' widget).
  483. `:sibling-args'
  484. This keyword is only used for members of a `radio-button-choice' or
  485. `checklist'. The value should be a list of extra keyword
  486. arguments, which will be used when creating the `radio-button' or
  487. `checkbox' associated with this item.
  488. -- User Option: widget-glyph-directory
  489. Directory where glyphs are found. Widget will look here for a
  490. file with the same name as specified for the image, with either a
  491. `.xpm' (if supported) or `.xbm' extension.
  492. -- User Option: widget-glyph-enable
  493. If non-`nil', allow glyphs to appear on displays where they are
  494. supported.
  495. * Menu:
  496. * link::
  497. * url-link::
  498. * info-link::
  499. * push-button::
  500. * editable-field::
  501. * text::
  502. * menu-choice::
  503. * radio-button-choice::
  504. * item::
  505. * choice-item::
  506. * toggle::
  507. * checkbox::
  508. * checklist::
  509. * editable-list::
  510. * group::
  511. 
  512. File: widget, Node: link, Next: url-link, Prev: Basic Types, Up: Basic Types
  513. The `link' Widget
  514. -----------------
  515. Syntax:
  516. TYPE ::= (link [KEYWORD ARGUMENT]... [ VALUE ])
  517. The VALUE, if present, is used to initialize the `:value' property.
  518. The value should be a string, which will be inserted in the buffer.
  519. By default the link will be shown in brackets.
  520. -- User Option: widget-link-prefix
  521. String to prefix links.
  522. -- User Option: widget-link-suffix
  523. String to suffix links.
  524. 
  525. File: widget, Node: url-link, Next: info-link, Prev: link, Up: Basic Types
  526. The `url-link' Widget
  527. ---------------------
  528. Syntax:
  529. TYPE ::= (url-link [KEYWORD ARGUMENT]... URL)
  530. When this link is invoked, the WWW browser specified by
  531. `browse-url-browser-function' will be called with URL.
  532. 
  533. File: widget, Node: info-link, Next: push-button, Prev: url-link, Up: Basic Types
  534. The `info-link' Widget
  535. ----------------------
  536. Syntax:
  537. TYPE ::= (info-link [KEYWORD ARGUMENT]... ADDRESS)
  538. When this link is invoked, the built-in Info reader is started on
  539. ADDRESS.
  540. 
  541. File: widget, Node: push-button, Next: editable-field, Prev: info-link, Up: Basic Types
  542. The `push-button' Widget
  543. ------------------------
  544. Syntax:
  545. TYPE ::= (push-button [KEYWORD ARGUMENT]... [ VALUE ])
  546. The VALUE, if present, is used to initialize the `:value' property.
  547. The value should be a string, which will be inserted in the buffer.
  548. By default the tag will be shown in brackets.
  549. -- User Option: widget-push-button-prefix
  550. String to prefix push buttons.
  551. -- User Option: widget-push-button-suffix
  552. String to suffix push buttons.
  553. 
  554. File: widget, Node: editable-field, Next: text, Prev: push-button, Up: Basic Types
  555. The `editable-field' Widget
  556. ---------------------------
  557. Syntax:
  558. TYPE ::= (editable-field [KEYWORD ARGUMENT]... [ VALUE ])
  559. The VALUE, if present, is used to initialize the `:value' property.
  560. The value should be a string, which will be inserted in the field.
  561. This widget will match all string values.
  562. The following extra properties are recognized:
  563. `:size'
  564. The width of the editable field.
  565. By default the field will reach to the end of the line.
  566. `:value-face'
  567. Face used for highlighting the editable field. Default is
  568. `widget-field-face', see *note User Interface::.
  569. `:secret'
  570. Character used to display the value. You can set this to e.g. `?*'
  571. if the field contains a password or other secret information. By
  572. default, this is `nil', and the value is not secret.
  573. `:valid-regexp'
  574. By default the `:validate' function will match the content of the
  575. field with the value of this attribute. The default value is `""'
  576. which matches everything.
  577. `:keymap'
  578. Keymap used in the editable field. The default value is
  579. `widget-field-keymap', which allows you to use all the normal
  580. editing commands, even if the buffer's major mode suppresses some
  581. of them. Pressing <RET> invokes the function specified by
  582. `:action'.
  583. 
  584. File: widget, Node: text, Next: menu-choice, Prev: editable-field, Up: Basic Types
  585. The `text' Widget
  586. -----------------
  587. This is just like `editable-field', but intended for multiline text
  588. fields. The default `:keymap' is `widget-text-keymap', which does not
  589. rebind the <RET> key.
  590. 
  591. File: widget, Node: menu-choice, Next: radio-button-choice, Prev: text, Up: Basic Types
  592. The `menu-choice' Widget
  593. ------------------------
  594. Syntax:
  595. TYPE ::= (menu-choice [KEYWORD ARGUMENT]... TYPE ... )
  596. The TYPE argument represents each possible choice. The widget's
  597. value will be that of the chosen TYPE argument. This widget will match
  598. any value matching at least one of the specified TYPE arguments.
  599. `:void'
  600. Widget type used as a fallback when the value does not match any
  601. of the specified TYPE arguments.
  602. `:case-fold'
  603. Set this to `nil' if you don't want to ignore case when prompting
  604. for a choice through the minibuffer.
  605. `:children'
  606. A list whose CAR is the widget representing the currently chosen
  607. type in the buffer.
  608. `:choice'
  609. The current chosen type.
  610. `:args'
  611. The list of types.
  612. 
  613. File: widget, Node: radio-button-choice, Next: item, Prev: menu-choice, Up: Basic Types
  614. The `radio-button-choice' Widget
  615. --------------------------------
  616. Syntax:
  617. TYPE ::= (radio-button-choice [KEYWORD ARGUMENT]... TYPE ... )
  618. The component types specify the choices, with one radio button for
  619. each. The widget's value will be that of the chosen TYPE argument.
  620. This widget matches any value that matches at least one of the
  621. specified TYPE arguments.
  622. The following extra properties are recognized.
  623. `:entry-format'
  624. This string will be inserted for each entry in the list. The
  625. following `%' escapes are available:
  626. `%v'
  627. Replace with the buffer representation of the TYPE widget.
  628. `%b'
  629. Replace with the radio button.
  630. `%%'
  631. Insert a literal `%'.
  632. `:button-args'
  633. A list of keywords to pass to the radio buttons. Useful for
  634. setting e.g. the `:help-echo' for each button.
  635. `:buttons'
  636. The widgets representing the radio buttons.
  637. `:children'
  638. The widgets representing each type.
  639. `:choice'
  640. The current chosen type
  641. `:args'
  642. The list of types.
  643. You can add extra radio button items to a `radio-button-choice'
  644. widget after it has been created with the function
  645. `widget-radio-add-item'.
  646. -- Function: widget-radio-add-item widget type
  647. Add to `radio-button-choice' widget WIDGET a new radio button item
  648. of type TYPE.
  649. Please note that such items added after the `radio-button-choice'
  650. widget has been created will *not* be properly destructed when you call
  651. `widget-delete'.
  652. 
  653. File: widget, Node: item, Next: choice-item, Prev: radio-button-choice, Up: Basic Types
  654. The `item' Widget
  655. -----------------
  656. Syntax:
  657. ITEM ::= (item [KEYWORD ARGUMENT]... VALUE)
  658. The VALUE, if present, is used to initialize the `:value' property.
  659. The value should be a string, which will be inserted in the buffer.
  660. This widget will only match the specified value.
  661. 
  662. File: widget, Node: choice-item, Next: toggle, Prev: item, Up: Basic Types
  663. The `choice-item' Widget
  664. ------------------------
  665. Syntax:
  666. ITEM ::= (choice-item [KEYWORD ARGUMENT]... VALUE)
  667. The VALUE, if present, is used to initialize the `:value' property.
  668. The value should be a string, which will be inserted in the buffer as a
  669. button. Activating the button of a `choice-item' is equivalent to
  670. activating the parent widget. This widget will only match the
  671. specified value.
  672. 
  673. File: widget, Node: toggle, Next: checkbox, Prev: choice-item, Up: Basic Types
  674. The `toggle' Widget
  675. -------------------
  676. Syntax:
  677. TYPE ::= (toggle [KEYWORD ARGUMENT]...)
  678. The widget has two possible states, `on' and `off', which correspond
  679. to a `t' or `nil' value, respectively.
  680. The following extra properties are recognized:
  681. `:on'
  682. A string representing the `on' state. By default the string `on'.
  683. `:off'
  684. A string representing the `off' state. By default the string
  685. `off'.
  686. `:on-glyph'
  687. Name of a glyph to be used instead of the `:on' text string, on
  688. emacsen that supports this.
  689. `:off-glyph'
  690. Name of a glyph to be used instead of the `:off' text string, on
  691. emacsen that supports this.
  692. 
  693. File: widget, Node: checkbox, Next: checklist, Prev: toggle, Up: Basic Types
  694. The `checkbox' Widget
  695. ---------------------
  696. This widget has two possible states, `selected' and `unselected', which
  697. corresponds to a `t' or `nil' value.
  698. Syntax:
  699. TYPE ::= (checkbox [KEYWORD ARGUMENT]...)
  700. 
  701. File: widget, Node: checklist, Next: editable-list, Prev: checkbox, Up: Basic Types
  702. The `checklist' Widget
  703. ----------------------
  704. Syntax:
  705. TYPE ::= (checklist [KEYWORD ARGUMENT]... TYPE ... )
  706. The TYPE arguments represent each checklist item. The widget's
  707. value will be a list containing the values of all checked TYPE
  708. arguments. The checklist widget will match a list whose elements all
  709. match at least one of the specified TYPE arguments.
  710. The following extra properties are recognized:
  711. `:entry-format'
  712. This string will be inserted for each entry in the list. The
  713. following `%' escapes are available:
  714. `%v'
  715. Replaced with the buffer representation of the TYPE widget.
  716. `%b'
  717. Replace with the checkbox.
  718. `%%'
  719. Insert a literal `%'.
  720. `:greedy'
  721. Usually a checklist will only match if the items are in the exact
  722. sequence given in the specification. By setting `:greedy' to
  723. non-`nil', it will allow the items to come in any sequence.
  724. However, if you extract the value they will be in the sequence
  725. given in the checklist, i.e. the original sequence is forgotten.
  726. `:button-args'
  727. A list of keywords to pass to the checkboxes. Useful for setting
  728. e.g. the `:help-echo' for each checkbox.
  729. `:buttons'
  730. The widgets representing the checkboxes.
  731. `:children'
  732. The widgets representing each type.
  733. `:args'
  734. The list of types.
  735. 
  736. File: widget, Node: editable-list, Next: group, Prev: checklist, Up: Basic Types
  737. The `editable-list' Widget
  738. --------------------------
  739. Syntax:
  740. TYPE ::= (editable-list [KEYWORD ARGUMENT]... TYPE)
  741. The value is a list, where each member represents one widget of type
  742. TYPE.
  743. The following extra properties are recognized:
  744. `:entry-format'
  745. This string will be inserted for each entry in the list. The
  746. following `%' escapes are available:
  747. `%v'
  748. This will be replaced with the buffer representation of the
  749. TYPE widget.
  750. `%i'
  751. Insert the [INS] button.
  752. `%d'
  753. Insert the [DEL] button.
  754. `%%'
  755. Insert a literal `%'.
  756. `:insert-button-args'
  757. A list of keyword arguments to pass to the insert buttons.
  758. `:delete-button-args'
  759. A list of keyword arguments to pass to the delete buttons.
  760. `:append-button-args'
  761. A list of keyword arguments to pass to the trailing insert button.
  762. `:buttons'
  763. The widgets representing the insert and delete buttons.
  764. `:children'
  765. The widgets representing the elements of the list.
  766. `:args'
  767. List whose CAR is the type of the list elements.
  768. 
  769. File: widget, Node: group, Prev: editable-list, Up: Basic Types
  770. The `group' Widget
  771. ------------------
  772. This widget simply group other widgets together.
  773. Syntax:
  774. TYPE ::= (group [KEYWORD ARGUMENT]... TYPE...)
  775. The value is a list, with one member for each TYPE.
  776. 
  777. File: widget, Node: Sexp Types, Next: Widget Properties, Prev: Basic Types, Up: Top
  778. Sexp Types
  779. ==========
  780. A number of widgets for editing "s-expressions" (Lisp types), sexp for
  781. short, are also available. These basically fall in several categories
  782. described in this section.
  783. * Menu:
  784. * constants::
  785. * generic::
  786. * atoms::
  787. * composite::
  788. 
  789. File: widget, Node: constants, Next: generic, Prev: Sexp Types, Up: Sexp Types
  790. The Constant Widgets
  791. --------------------
  792. The `const' widget can contain any Lisp expression, but the user is
  793. prohibited from editing it, which is mainly useful as a component of one
  794. of the composite widgets.
  795. The syntax for the `const' widget is:
  796. TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ])
  797. The VALUE, if present, is used to initialize the `:value' property
  798. and can be any s-expression.
  799. -- Widget: const
  800. This will display any valid s-expression in an immutable part of
  801. the buffer.
  802. There are two variations of the `const' widget, namely
  803. `variable-item' and `function-item'. These should contain a symbol
  804. with a variable or function binding. The major difference from the
  805. `const' widget is that they will allow the user to see the variable or
  806. function documentation for the symbol.
  807. -- Widget: variable-item
  808. An immutable symbol that is bound as a variable.
  809. -- Widget: function-item
  810. An immutable symbol that is bound as a function.
  811. 
  812. File: widget, Node: generic, Next: atoms, Prev: constants, Up: Sexp Types
  813. Generic Sexp Widget
  814. -------------------
  815. The `sexp' widget can contain any Lisp expression, and allows the user
  816. to edit it inline in the buffer.
  817. The syntax for the `sexp' widget is:
  818. TYPE ::= (sexp [KEYWORD ARGUMENT]... [ VALUE ])
  819. -- Widget: sexp
  820. This will allow you to edit any valid s-expression in an editable
  821. buffer field.
  822. The `sexp' widget takes the same keyword arguments as the
  823. `editable-field' widget. *Note editable-field::.
  824. 
  825. File: widget, Node: atoms, Next: composite, Prev: generic, Up: Sexp Types
  826. Atomic Sexp Widgets
  827. -------------------
  828. The atoms are s-expressions that do not consist of other s-expressions.
  829. For example, a string, a file name, or a symbol are atoms, while a list
  830. is a composite type. You can edit the value of an atom with the
  831. following widgets.
  832. The syntax for all the atoms are:
  833. TYPE ::= (CONSTRUCT [KEYWORD ARGUMENT]... [ VALUE ])
  834. The VALUE, if present, is used to initialize the `:value' property
  835. and must be an expression of the same type as the widget. That is, the
  836. string widget can only be initialized with a string.
  837. All the atom widgets take the same keyword arguments as the
  838. `editable-field' widget. *Note editable-field::.
  839. -- Widget: string
  840. Allows you to edit a string in an editable field.
  841. -- Widget: regexp
  842. Allows you to edit a regular expression in an editable field.
  843. -- Widget: character
  844. Allows you to enter a character in an editable field.
  845. -- Widget: file
  846. Allows you to edit a file name in an editable field.
  847. Keywords:
  848. `:must-match'
  849. If this is set to non-`nil', only existing file names will be
  850. allowed in the minibuffer.
  851. -- Widget: directory
  852. Allows you to edit a directory name in an editable field. Similar
  853. to the `file' widget.
  854. -- Widget: symbol
  855. Allows you to edit a Lisp symbol in an editable field.
  856. -- Widget: function
  857. Allows you to edit a lambda expression, or a function name with
  858. completion.
  859. -- Widget: variable
  860. Allows you to edit a variable name, with completion.
  861. -- Widget: integer
  862. Allows you to edit an integer in an editable field.
  863. -- Widget: number
  864. Allows you to edit a number in an editable field.
  865. -- Widget: boolean
  866. Allows you to edit a boolean. In Lisp this means a variable which
  867. is either `nil' meaning false, or non-`nil' meaning true.
  868. 
  869. File: widget, Node: composite, Prev: atoms, Up: Sexp Types
  870. Composite Sexp Widgets
  871. ----------------------
  872. The syntax for the composite widget construct is:
  873. TYPE ::= (CONSTRUCT [KEYWORD ARGUMENT]... COMPONENT...)
  874. where each COMPONENT must be a widget type. Each component widget will
  875. be displayed in the buffer, and will be editable by the user.
  876. -- Widget: cons
  877. The value of a `cons' widget must be a cons-cell whose CAR and CDR
  878. have two specified types. It uses this syntax:
  879. TYPE ::= (cons [KEYWORD ARGUMENT]... CAR-TYPE CDR-TYPE)
  880. -- Widget: choice
  881. The value matched by a `choice' widget must have one of a fixed
  882. set of types. The widget's syntax is as follows:
  883. TYPE ::= (choice [KEYWORD ARGUMENT]... TYPE ... )
  884. The value of a `choice' widget can be anything that matches any of
  885. the TYPES.
  886. -- Widget: list
  887. The value of a `list' widget must be a list whose element types
  888. match the specified component types:
  889. TYPE ::= (list [KEYWORD ARGUMENT]... COMPONENT-TYPE...)
  890. Thus, `(list string number)' matches lists of two elements, the
  891. first being a string and the second being a number.
  892. -- Widget: vector
  893. The `vector' widget is like the `list' widget but matches vectors
  894. instead of lists. Thus, `(vector string number)' matches vectors
  895. of two elements, the first being a string and the second being a
  896. number.
  897. The above suffice for specifying fixed size lists and vectors. To
  898. get variable length lists and vectors, you can use a `choice', `set',
  899. or `repeat' widget together with the `:inline' keyword. If any
  900. component of a composite widget has the `:inline' keyword set, its
  901. value must be a list which will then be spliced into the composite.
  902. For example, to specify a list whose first element must be a file name,
  903. and whose remaining elements should either be the symbol `t' or two
  904. strings (file names), you can use the following widget specification:
  905. (list file
  906. (choice (const t)
  907. (list :inline t
  908. :value ("foo" "bar")
  909. string string)))
  910. The value of a widget of this type will either have the form `(file
  911. t)' or `(file STRING STRING)'.
  912. This concept of `:inline' may be hard to understand. It was
  913. certainly hard to implement, so instead of confusing you more by trying
  914. to explain it here, I'll just suggest you meditate over it for a while.
  915. -- Widget: set
  916. Specifies a type whose values are the lists whose elements all
  917. belong to a given set. The order of elements of the list is not
  918. significant. Here's the syntax:
  919. TYPE ::= (set [KEYWORD ARGUMENT]... PERMITTED-ELEMENT ... )
  920. Use `const' to specify each permitted element, like this: `(set
  921. (const a) (const b))'.
  922. -- Widget: repeat
  923. Specifies a list of any number of elements that fit a certain type.
  924. TYPE ::= (repeat [KEYWORD ARGUMENT]... TYPE)
  925. 
  926. File: widget, Node: Widget Properties, Next: Defining New Widgets, Prev: Sexp Types, Up: Top
  927. Properties
  928. ==========
  929. You can examine or set the value of a widget by using the widget object
  930. that was returned by `widget-create'.
  931. -- Function: widget-value widget
  932. Return the current value contained in WIDGET. It is an error to
  933. call this function on an uninitialized widget.
  934. -- Function: widget-value-set widget value
  935. Set the value contained in WIDGET to VALUE. It is an error to
  936. call this function with an invalid VALUE.
  937. *Important:* You _must_ call `widget-setup' after modifying the
  938. value of a widget before the user is allowed to edit the widget again.
  939. It is enough to call `widget-setup' once if you modify multiple
  940. widgets. This is currently only necessary if the widget contains an
  941. editing field, but may be necessary for other widgets in the future.
  942. If your application needs to associate some information with the
  943. widget objects, for example a reference to the item being edited, it
  944. can be done with `widget-put' and `widget-get'. The property names
  945. must begin with a `:'.
  946. -- Function: widget-put widget property value
  947. In WIDGET set PROPERTY to VALUE. PROPERTY should be a symbol,
  948. while VALUE can be anything.
  949. -- Function: widget-get widget property
  950. In WIDGET return the value for PROPERTY. PROPERTY should be a
  951. symbol, the value is what was last set by `widget-put' for
  952. PROPERTY.
  953. -- Function: widget-member widget property
  954. Non-`nil' if WIDGET has a value (even `nil') for property PROPERTY.
  955. Occasionally it can be useful to know which kind of widget you have,
  956. i.e. the name of the widget type you gave when the widget was created.
  957. -- Function: widget-type widget
  958. Return the name of WIDGET, a symbol.
  959. Widgets can be in two states: active, which means they are
  960. modifiable by the user, or inactive, which means they cannot be
  961. modified by the user. You can query or set the state with the
  962. following code:
  963. ;; Examine if WIDGET is active or not.
  964. (if (widget-apply WIDGET :active)
  965. (message "Widget is active.")
  966. (message "Widget is inactive.")
  967. ;; Make WIDGET inactive.
  968. (widget-apply WIDGET :deactivate)
  969. ;; Make WIDGET active.
  970. (widget-apply WIDGET :activate)
  971. A widget is inactive if it, or any of its ancestors (found by
  972. following the `:parent' link), have been deactivated. To make sure a
  973. widget is really active, you must therefore activate both it and all
  974. its ancestors.
  975. (while widget
  976. (widget-apply widget :activate)
  977. (setq widget (widget-get widget :parent)))
  978. You can check if a widget has been made inactive by examining the
  979. value of the `:inactive' keyword. If this is non-`nil', the widget
  980. itself has been deactivated. This is different from using the `:active'
  981. keyword, in that the latter tells you if the widget *or* any of its
  982. ancestors have been deactivated. Do not attempt to set the `:inactive'
  983. keyword directly. Use the `:activate' `:deactivate' keywords instead.
  984. 
  985. File: widget, Node: Defining New Widgets, Next: Widget Browser, Prev: Widget Properties, Up: Top
  986. Defining New Widgets
  987. ====================
  988. You can define specialized widgets with `define-widget'. It allows you
  989. to create a shorthand for more complex widgets, including specifying
  990. component widgets and new default values for the keyword arguments.
  991. -- Function: define-widget name class doc &rest args
  992. Define a new widget type named NAME from `class'.
  993. NAME and class should both be symbols, `class' should be one of
  994. the existing widget types.
  995. The third argument DOC is a documentation string for the widget.
  996. After the new widget has been defined, the following two calls will
  997. create identical widgets:
  998. * (widget-create NAME)
  999. * (apply widget-create CLASS ARGS)
  1000. Using `define-widget' just stores the definition of the widget type
  1001. in the `widget-type' property of NAME, which is what `widget-create'
  1002. uses.
  1003. If you only want to specify defaults for keywords with no complex
  1004. conversions, you can use `identity' as your conversion function.
  1005. The following additional keyword arguments are useful when defining
  1006. new widgets:
  1007. `:convert-widget'
  1008. Function to convert a widget type before creating a widget of that
  1009. type. It takes a widget type as an argument, and returns the
  1010. converted widget type. When a widget is created, this function is
  1011. called for the widget type and all the widget's parent types, most
  1012. derived first.
  1013. The following predefined functions can be used here:
  1014. -- Function: widget-types-convert-widget widget
  1015. Convert `:args' as widget types in WIDGET.
  1016. -- Function: widget-value-convert-widget widget
  1017. Initialize `:value' from `:args' in WIDGET.
  1018. `:copy'
  1019. Function to deep copy a widget type. It takes a shallow copy of
  1020. the widget type as an argument (made by `copy-sequence'), and
  1021. returns a deep copy. The purpose of this is to avoid having
  1022. different instances of combined widgets share nested attributes.
  1023. The following predefined functions can be used here:
  1024. -- Function: widget-types-copy widget
  1025. Copy `:args' as widget types in WIDGET.
  1026. `:value-to-internal'
  1027. Function to convert the value to the internal format. The function
  1028. takes two arguments, a widget and an external value, and returns
  1029. the internal value. The function is called on the present `:value'
  1030. when the widget is created, and on any value set later with
  1031. `widget-value-set'.
  1032. `:value-to-external'
  1033. Function to convert the value to the external format. The function
  1034. takes two arguments, a widget and an internal value, and returns
  1035. the external value. The function is called on the present `:value'
  1036. when the widget is created, and on any value set later with
  1037. `widget-value-set'.
  1038. `:create'
  1039. Function to create a widget from scratch. The function takes one
  1040. argument, a widget type, and creates a widget of that type,
  1041. inserts it in the buffer, and returns a widget object.
  1042. `:delete'
  1043. Function to delete a widget. The function takes one argument, a
  1044. widget, and should remove all traces of the widget from the buffer.
  1045. The default value is:
  1046. -- Function: widget-default-delete widget
  1047. Remove WIDGET from the buffer. Delete all `:children' and
  1048. `:buttons' in WIDGET.
  1049. In most cases you should not change this value, but instead use
  1050. `:value-delete' to make any additional cleanup.
  1051. `:value-create'
  1052. Function to expand the `%v' escape in the format string. It will
  1053. be called with the widget as its argument and should insert a
  1054. representation of the widget's value in the buffer.
  1055. Nested widgets should be listed in `:children' or `:buttons' to
  1056. make sure they are automatically deleted.
  1057. `:value-delete'
  1058. Should remove the representation of the widget's value from the
  1059. buffer. It will be called with the widget as its argument. It
  1060. doesn't have to remove the text, but it should release markers and
  1061. delete nested widgets if these are not listed in `:children' or
  1062. `:buttons'.
  1063. `:value-get'
  1064. Function to extract the value of a widget, as it is displayed in
  1065. the buffer.
  1066. The following predefined function can be used here:
  1067. -- Function: widget-value-value-get widget
  1068. Return the `:value' property of WIDGET.
  1069. `:format-handler'
  1070. Function to handle unknown `%' escapes in the format string. It
  1071. will be called with the widget and the character that follows the
  1072. `%' as arguments. You can set this to allow your widget to handle
  1073. non-standard escapes.
  1074. You should end up calling `widget-default-format-handler' to handle
  1075. unknown escape sequences, which will handle the `%h' and any future
  1076. escape sequences, as well as give an error for unknown escapes.
  1077. `:action'
  1078. Function to handle user initiated events. By default, `:notify'
  1079. the parent.
  1080. The following predefined function can be used here:
  1081. -- Function: widget-parent-action widget &optional event
  1082. Tell `:parent' of WIDGET to handle the `:action'. Optional
  1083. EVENT is the event that triggered the action.
  1084. `:prompt-value'
  1085. Function to prompt for a value in the minibuffer. The function
  1086. should take four arguments, WIDGET, PROMPT, VALUE, and UNBOUND and
  1087. should return a value for widget entered by the user. PROMPT is
  1088. the prompt to use. VALUE is the default value to use, unless
  1089. UNBOUND is non-`nil', in which case there is no default value.
  1090. The function should read the value using the method most natural
  1091. for this widget, and does not have to check that it matches.
  1092. If you want to define a new widget from scratch, use the `default'
  1093. widget as its base.
  1094. -- Widget: default
  1095. Widget used as a base for other widgets.
  1096. It provides most of the functionality that is referred to as "by
  1097. default" in this text.
  1098. 
  1099. File: widget, Node: Widget Browser, Next: Widget Minor Mode, Prev: Defining New Widgets, Up: Top
  1100. Widget Browser
  1101. ==============
  1102. There is a separate package to browse widgets. This is intended to help
  1103. programmers who want to examine the content of a widget. The browser
  1104. shows the value of each keyword, but uses links for certain keywords
  1105. such as `:parent', which avoids printing cyclic structures.
  1106. -- Command: widget-browse WIDGET
  1107. Create a widget browser for WIDGET. When called interactively,
  1108. prompt for WIDGET.
  1109. -- Command: widget-browse-other-window WIDGET
  1110. Create a widget browser for WIDGET and show it in another window.
  1111. When called interactively, prompt for WIDGET.
  1112. -- Command: widget-browse-at POS
  1113. Create a widget browser for the widget at POS. When called
  1114. interactively, use the position of point.
  1115. 
  1116. File: widget, Node: Widget Minor Mode, Next: Utilities, Prev: Widget Browser, Up: Top
  1117. Widget Minor Mode
  1118. =================
  1119. There is a minor mode for manipulating widgets in major modes that
  1120. don't provide any support for widgets themselves. This is mostly
  1121. intended to be useful for programmers doing experiments.
  1122. -- Command: widget-minor-mode
  1123. Toggle minor mode for traversing widgets. With arg, turn widget
  1124. mode on if and only if arg is positive.
  1125. -- Variable: widget-minor-mode-keymap
  1126. Keymap used in `widget-minor-mode'.
  1127. 
  1128. File: widget, Node: Utilities, Next: Widget Wishlist, Prev: Widget Minor Mode, Up: Top
  1129. Utilities.
  1130. ==========
  1131. -- Function: widget-prompt-value widget prompt [ value unbound ]
  1132. Prompt for a value matching WIDGET, using PROMPT. The current
  1133. value is assumed to be VALUE, unless UNBOUND is non-`nil'.
  1134. -- Function: widget-get-sibling widget
  1135. Get the item which WIDGET is assumed to toggle. This is only
  1136. meaningful for radio buttons or checkboxes in a list.
  1137. 
  1138. File: widget, Node: Widget Wishlist, Next: GNU Free Documentation License, Prev: Utilities, Up: Top
  1139. Wishlist
  1140. ========
  1141. * It should be possible to add or remove items from a list with `C-k'
  1142. and `C-o' (suggested by RMS).
  1143. * The `[INS]' and `[DEL]' buttons should be replaced by a single
  1144. dash (`-'). The dash should be a button that, when invoked, asks
  1145. whether you want to add or delete an item (RMS wanted to git rid of
  1146. the ugly buttons, the dash is my idea).
  1147. * The `menu-choice' tag should be prettier, something like the
  1148. abbreviated menus in Open Look.
  1149. * Finish `:tab-order'.
  1150. * Make indentation work with glyphs and proportional fonts.
  1151. * Add commands to show overview of object and class hierarchies to
  1152. the browser.
  1153. * Find a way to disable mouse highlight for inactive widgets.
  1154. * Find a way to make glyphs look inactive.
  1155. * Add `property-list' widget.
  1156. * Add `association-list' widget.
  1157. * Add `key-binding' widget.
  1158. * Add `widget' widget for editing widget specifications.
  1159. * Find clean way to implement variable length list. See
  1160. `TeX-printer-list' for an explanation.
  1161. * `C-h' in `widget-prompt-value' should give type specific help.
  1162. * Add a `mailto' widget.
  1163. 
  1164. File: widget, Node: GNU Free Documentation License, Next: Index, Prev: Widget Wishlist, Up: Top
  1165. Appendix A GNU Free Documentation License
  1166. *****************************************
  1167. Version 1.3, 3 November 2008
  1168. Copyright (C) 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
  1169. `http://fsf.org/'
  1170. Everyone is permitted to copy and distribute verbatim copies
  1171. of this license document, but changing it is not allowed.
  1172. 0. PREAMBLE
  1173. The purpose of this License is to make a manual, textbook, or other
  1174. functional and useful document "free" in the sense of freedom: to
  1175. assure everyone the effective freedom to copy and redistribute it,
  1176. with or without modifying it, either commercially or
  1177. noncommercially. Secondarily, this License preserves for the
  1178. author and publisher a way to get credit for their work, while not
  1179. being considered responsible for modifications made by others.
  1180. This License is a kind of "copyleft", which means that derivative
  1181. works of the document must themselves be free in the same sense.
  1182. It complements the GNU General Public License, which is a copyleft
  1183. license designed for free software.
  1184. We have designed this License in order to use it for manuals for
  1185. free software, because free software needs free documentation: a
  1186. free program should come with manuals providing the same freedoms
  1187. that the software does. But this License is not limited to
  1188. software manuals; it can be used for any textual work, regardless
  1189. of subject matter or whether it is published as a printed book.
  1190. We recommend this License principally for works whose purpose is
  1191. instruction or reference.
  1192. 1. APPLICABILITY AND DEFINITIONS
  1193. This License applies to any manual or other work, in any medium,
  1194. that contains a notice placed by the copyright holder saying it
  1195. can be distributed under the terms of this License. Such a notice
  1196. grants a world-wide, royalty-free license, unlimited in duration,
  1197. to use that work under the conditions stated herein. The
  1198. "Document", below, refers to any such manual or work. Any member
  1199. of the public is a licensee, and is addressed as "you". You
  1200. accept the license if you copy, modify or distribute the work in a
  1201. way requiring permission under copyright law.
  1202. A "Modified Version" of the Document means any work containing the
  1203. Document or a portion of it, either copied verbatim, or with
  1204. modifications and/or translated into another language.
  1205. A "Secondary Section" is a named appendix or a front-matter section
  1206. of the Document that deals exclusively with the relationship of the
  1207. publishers or authors of the Document to the Document's overall
  1208. subject (or to related matters) and contains nothing that could
  1209. fall directly within that overall subject. (Thus, if the Document
  1210. is in part a textbook of mathematics, a Secondary Section may not
  1211. explain any mathematics.) The relationship could be a matter of
  1212. historical connection with the subject or with related matters, or
  1213. of legal, commercial, philosophical, ethical or political position
  1214. regarding them.
  1215. The "Invariant Sections" are certain Secondary Sections whose
  1216. titles are designated, as being those of Invariant Sections, in
  1217. the notice that says that the Document is released under this
  1218. License. If a section does not fit the above definition of
  1219. Secondary then it is not allowed to be designated as Invariant.
  1220. The Document may contain zero Invariant Sections. If the Document
  1221. does not identify any Invariant Sections then there are none.
  1222. The "Cover Texts" are certain short passages of text that are
  1223. listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  1224. that says that the Document is released under this License. A
  1225. Front-Cover Text may be at most 5 words, and a Back-Cover Text may
  1226. be at most 25 words.
  1227. A "Transparent" copy of the Document means a machine-readable copy,
  1228. represented in a format whose specification is available to the
  1229. general public, that is suitable for revising the document
  1230. straightforwardly with generic text editors or (for images
  1231. composed of pixels) generic paint programs or (for drawings) some
  1232. widely available drawing editor, and that is suitable for input to
  1233. text formatters or for automatic translation to a variety of
  1234. formats suitable for input to text formatters. A copy made in an
  1235. otherwise Transparent file format whose markup, or absence of
  1236. markup, has been arranged to thwart or discourage subsequent
  1237. modification by readers is not Transparent. An image format is
  1238. not Transparent if used for any substantial amount of text. A
  1239. copy that is not "Transparent" is called "Opaque".
  1240. Examples of suitable formats for Transparent copies include plain
  1241. ASCII without markup, Texinfo input format, LaTeX input format,
  1242. SGML or XML using a publicly available DTD, and
  1243. standard-conforming simple HTML, PostScript or PDF designed for
  1244. human modification. Examples of transparent image formats include
  1245. PNG, XCF and JPG. Opaque formats include proprietary formats that
  1246. can be read and edited only by proprietary word processors, SGML or
  1247. XML for which the DTD and/or processing tools are not generally
  1248. available, and the machine-generated HTML, PostScript or PDF
  1249. produced by some word processors for output purposes only.
  1250. The "Title Page" means, for a printed book, the title page itself,
  1251. plus such following pages as are needed to hold, legibly, the
  1252. material this License requires to appear in the title page. For
  1253. works in formats which do not have any title page as such, "Title
  1254. Page" means the text near the most prominent appearance of the
  1255. work's title, preceding the beginning of the body of the text.
  1256. The "publisher" means any person or entity that distributes copies
  1257. of the Document to the public.
  1258. A section "Entitled XYZ" means a named subunit of the Document
  1259. whose title either is precisely XYZ or contains XYZ in parentheses
  1260. following text that translates XYZ in another language. (Here XYZ
  1261. stands for a specific section name mentioned below, such as
  1262. "Acknowledgements", "Dedications", "Endorsements", or "History".)
  1263. To "Preserve the Title" of such a section when you modify the
  1264. Document means that it remains a section "Entitled XYZ" according
  1265. to this definition.
  1266. The Document may include Warranty Disclaimers next to the notice
  1267. which states that this License applies to the Document. These
  1268. Warranty Disclaimers are considered to be included by reference in
  1269. this License, but only as regards disclaiming warranties: any other
  1270. implication that these Warranty Disclaimers may have is void and
  1271. has no effect on the meaning of this License.
  1272. 2. VERBATIM COPYING
  1273. You may copy and distribute the Document in any medium, either
  1274. commercially or noncommercially, provided that this License, the
  1275. copyright notices, and the license notice saying this License
  1276. applies to the Document are reproduced in all copies, and that you
  1277. add no other conditions whatsoever to those of this License. You
  1278. may not use technical measures to obstruct or control the reading
  1279. or further copying of the copies you make or distribute. However,
  1280. you may accept compensation in exchange for copies. If you
  1281. distribute a large enough number of copies you must also follow
  1282. the conditions in section 3.
  1283. You may also lend copies, under the same conditions stated above,
  1284. and you may publicly display copies.
  1285. 3. COPYING IN QUANTITY
  1286. If you publish printed copies (or copies in media that commonly
  1287. have printed covers) of the Document, numbering more than 100, and
  1288. the Document's license notice requires Cover Texts, you must
  1289. enclose the copies in covers that carry, clearly and legibly, all
  1290. these Cover Texts: Front-Cover Texts on the front cover, and
  1291. Back-Cover Texts on the back cover. Both covers must also clearly
  1292. and legibly identify you as the publisher of these copies. The
  1293. front cover must present the full title with all words of the
  1294. title equally prominent and visible. You may add other material
  1295. on the covers in addition. Copying with changes limited to the
  1296. covers, as long as they preserve the title of the Document and
  1297. satisfy these conditions, can be treated as verbatim copying in
  1298. other respects.
  1299. If the required texts for either cover are too voluminous to fit
  1300. legibly, you should put the first ones listed (as many as fit
  1301. reasonably) on the actual cover, and continue the rest onto
  1302. adjacent pages.
  1303. If you publish or distribute Opaque copies of the Document
  1304. numbering more than 100, you must either include a
  1305. machine-readable Transparent copy along with each Opaque copy, or
  1306. state in or with each Opaque copy a computer-network location from
  1307. which the general network-using public has access to download
  1308. using public-standard network protocols a complete Transparent
  1309. copy of the Document, free of added material. If you use the
  1310. latter option, you must take reasonably prudent steps, when you
  1311. begin distribution of Opaque copies in quantity, to ensure that
  1312. this Transparent copy will remain thus accessible at the stated
  1313. location until at least one year after the last time you
  1314. distribute an Opaque copy (directly or through your agents or
  1315. retailers) of that edition to the public.
  1316. It is requested, but not required, that you contact the authors of
  1317. the Document well before redistributing any large number of
  1318. copies, to give them a chance to provide you with an updated
  1319. version of the Document.
  1320. 4. MODIFICATIONS
  1321. You may copy and distribute a Modified Version of the Document
  1322. under the conditions of sections 2 and 3 above, provided that you
  1323. release the Modified Version under precisely this License, with
  1324. the Modified Version filling the role of the Document, thus
  1325. licensing distribution and modification of the Modified Version to
  1326. whoever possesses a copy of it. In addition, you must do these
  1327. things in the Modified Version:
  1328. A. Use in the Title Page (and on the covers, if any) a title
  1329. distinct from that of the Document, and from those of
  1330. previous versions (which should, if there were any, be listed
  1331. in the History section of the Document). You may use the
  1332. same title as a previous version if the original publisher of
  1333. that version gives permission.
  1334. B. List on the Title Page, as authors, one or more persons or
  1335. entities responsible for authorship of the modifications in
  1336. the Modified Version, together with at least five of the
  1337. principal authors of the Document (all of its principal
  1338. authors, if it has fewer than five), unless they release you
  1339. from this requirement.
  1340. C. State on the Title page the name of the publisher of the
  1341. Modified Version, as the publisher.
  1342. D. Preserve all the copyright notices of the Document.
  1343. E. Add an appropriate copyright notice for your modifications
  1344. adjacent to the other copyright notices.
  1345. F. Include, immediately after the copyright notices, a license
  1346. notice giving the public permission to use the Modified
  1347. Version under the terms of this License, in the form shown in
  1348. the Addendum below.
  1349. G. Preserve in that license notice the full lists of Invariant
  1350. Sections and required Cover Texts given in the Document's
  1351. license notice.
  1352. H. Include an unaltered copy of this License.
  1353. I. Preserve the section Entitled "History", Preserve its Title,
  1354. and add to it an item stating at least the title, year, new
  1355. authors, and publisher of the Modified Version as given on
  1356. the Title Page. If there is no section Entitled "History" in
  1357. the Document, create one stating the title, year, authors,
  1358. and publisher of the Document as given on its Title Page,
  1359. then add an item describing the Modified Version as stated in
  1360. the previous sentence.
  1361. J. Preserve the network location, if any, given in the Document
  1362. for public access to a Transparent copy of the Document, and
  1363. likewise the network locations given in the Document for
  1364. previous versions it was based on. These may be placed in
  1365. the "History" section. You may omit a network location for a
  1366. work that was published at least four years before the
  1367. Document itself, or if the original publisher of the version
  1368. it refers to gives permission.
  1369. K. For any section Entitled "Acknowledgements" or "Dedications",
  1370. Preserve the Title of the section, and preserve in the
  1371. section all the substance and tone of each of the contributor
  1372. acknowledgements and/or dedications given therein.
  1373. L. Preserve all the Invariant Sections of the Document,
  1374. unaltered in their text and in their titles. Section numbers
  1375. or the equivalent are not considered part of the section
  1376. titles.
  1377. M. Delete any section Entitled "Endorsements". Such a section
  1378. may not be included in the Modified Version.
  1379. N. Do not retitle any existing section to be Entitled
  1380. "Endorsements" or to conflict in title with any Invariant
  1381. Section.
  1382. O. Preserve any Warranty Disclaimers.
  1383. If the Modified Version includes new front-matter sections or
  1384. appendices that qualify as Secondary Sections and contain no
  1385. material copied from the Document, you may at your option
  1386. designate some or all of these sections as invariant. To do this,
  1387. add their titles to the list of Invariant Sections in the Modified
  1388. Version's license notice. These titles must be distinct from any
  1389. other section titles.
  1390. You may add a section Entitled "Endorsements", provided it contains
  1391. nothing but endorsements of your Modified Version by various
  1392. parties--for example, statements of peer review or that the text
  1393. has been approved by an organization as the authoritative
  1394. definition of a standard.
  1395. You may add a passage of up to five words as a Front-Cover Text,
  1396. and a passage of up to 25 words as a Back-Cover Text, to the end
  1397. of the list of Cover Texts in the Modified Version. Only one
  1398. passage of Front-Cover Text and one of Back-Cover Text may be
  1399. added by (or through arrangements made by) any one entity. If the
  1400. Document already includes a cover text for the same cover,
  1401. previously added by you or by arrangement made by the same entity
  1402. you are acting on behalf of, you may not add another; but you may
  1403. replace the old one, on explicit permission from the previous
  1404. publisher that added the old one.
  1405. The author(s) and publisher(s) of the Document do not by this
  1406. License give permission to use their names for publicity for or to
  1407. assert or imply endorsement of any Modified Version.
  1408. 5. COMBINING DOCUMENTS
  1409. You may combine the Document with other documents released under
  1410. this License, under the terms defined in section 4 above for
  1411. modified versions, provided that you include in the combination
  1412. all of the Invariant Sections of all of the original documents,
  1413. unmodified, and list them all as Invariant Sections of your
  1414. combined work in its license notice, and that you preserve all
  1415. their Warranty Disclaimers.
  1416. The combined work need only contain one copy of this License, and
  1417. multiple identical Invariant Sections may be replaced with a single
  1418. copy. If there are multiple Invariant Sections with the same name
  1419. but different contents, make the title of each such section unique
  1420. by adding at the end of it, in parentheses, the name of the
  1421. original author or publisher of that section if known, or else a
  1422. unique number. Make the same adjustment to the section titles in
  1423. the list of Invariant Sections in the license notice of the
  1424. combined work.
  1425. In the combination, you must combine any sections Entitled
  1426. "History" in the various original documents, forming one section
  1427. Entitled "History"; likewise combine any sections Entitled
  1428. "Acknowledgements", and any sections Entitled "Dedications". You
  1429. must delete all sections Entitled "Endorsements."
  1430. 6. COLLECTIONS OF DOCUMENTS
  1431. You may make a collection consisting of the Document and other
  1432. documents released under this License, and replace the individual
  1433. copies of this License in the various documents with a single copy
  1434. that is included in the collection, provided that you follow the
  1435. rules of this License for verbatim copying of each of the
  1436. documents in all other respects.
  1437. You may extract a single document from such a collection, and
  1438. distribute it individually under this License, provided you insert
  1439. a copy of this License into the extracted document, and follow
  1440. this License in all other respects regarding verbatim copying of
  1441. that document.
  1442. 7. AGGREGATION WITH INDEPENDENT WORKS
  1443. A compilation of the Document or its derivatives with other
  1444. separate and independent documents or works, in or on a volume of
  1445. a storage or distribution medium, is called an "aggregate" if the
  1446. copyright resulting from the compilation is not used to limit the
  1447. legal rights of the compilation's users beyond what the individual
  1448. works permit. When the Document is included in an aggregate, this
  1449. License does not apply to the other works in the aggregate which
  1450. are not themselves derivative works of the Document.
  1451. If the Cover Text requirement of section 3 is applicable to these
  1452. copies of the Document, then if the Document is less than one half
  1453. of the entire aggregate, the Document's Cover Texts may be placed
  1454. on covers that bracket the Document within the aggregate, or the
  1455. electronic equivalent of covers if the Document is in electronic
  1456. form. Otherwise they must appear on printed covers that bracket
  1457. the whole aggregate.
  1458. 8. TRANSLATION
  1459. Translation is considered a kind of modification, so you may
  1460. distribute translations of the Document under the terms of section
  1461. 4. Replacing Invariant Sections with translations requires special
  1462. permission from their copyright holders, but you may include
  1463. translations of some or all Invariant Sections in addition to the
  1464. original versions of these Invariant Sections. You may include a
  1465. translation of this License, and all the license notices in the
  1466. Document, and any Warranty Disclaimers, provided that you also
  1467. include the original English version of this License and the
  1468. original versions of those notices and disclaimers. In case of a
  1469. disagreement between the translation and the original version of
  1470. this License or a notice or disclaimer, the original version will
  1471. prevail.
  1472. If a section in the Document is Entitled "Acknowledgements",
  1473. "Dedications", or "History", the requirement (section 4) to
  1474. Preserve its Title (section 1) will typically require changing the
  1475. actual title.
  1476. 9. TERMINATION
  1477. You may not copy, modify, sublicense, or distribute the Document
  1478. except as expressly provided under this License. Any attempt
  1479. otherwise to copy, modify, sublicense, or distribute it is void,
  1480. and will automatically terminate your rights under this License.
  1481. However, if you cease all violation of this License, then your
  1482. license from a particular copyright holder is reinstated (a)
  1483. provisionally, unless and until the copyright holder explicitly
  1484. and finally terminates your license, and (b) permanently, if the
  1485. copyright holder fails to notify you of the violation by some
  1486. reasonable means prior to 60 days after the cessation.
  1487. Moreover, your license from a particular copyright holder is
  1488. reinstated permanently if the copyright holder notifies you of the
  1489. violation by some reasonable means, this is the first time you have
  1490. received notice of violation of this License (for any work) from
  1491. that copyright holder, and you cure the violation prior to 30 days
  1492. after your receipt of the notice.
  1493. Termination of your rights under this section does not terminate
  1494. the licenses of parties who have received copies or rights from
  1495. you under this License. If your rights have been terminated and
  1496. not permanently reinstated, receipt of a copy of some or all of
  1497. the same material does not give you any rights to use it.
  1498. 10. FUTURE REVISIONS OF THIS LICENSE
  1499. The Free Software Foundation may publish new, revised versions of
  1500. the GNU Free Documentation License from time to time. Such new
  1501. versions will be similar in spirit to the present version, but may
  1502. differ in detail to address new problems or concerns. See
  1503. `http://www.gnu.org/copyleft/'.
  1504. Each version of the License is given a distinguishing version
  1505. number. If the Document specifies that a particular numbered
  1506. version of this License "or any later version" applies to it, you
  1507. have the option of following the terms and conditions either of
  1508. that specified version or of any later version that has been
  1509. published (not as a draft) by the Free Software Foundation. If
  1510. the Document does not specify a version number of this License,
  1511. you may choose any version ever published (not as a draft) by the
  1512. Free Software Foundation. If the Document specifies that a proxy
  1513. can decide which future versions of this License can be used, that
  1514. proxy's public statement of acceptance of a version permanently
  1515. authorizes you to choose that version for the Document.
  1516. 11. RELICENSING
  1517. "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
  1518. World Wide Web server that publishes copyrightable works and also
  1519. provides prominent facilities for anybody to edit those works. A
  1520. public wiki that anybody can edit is an example of such a server.
  1521. A "Massive Multiauthor Collaboration" (or "MMC") contained in the
  1522. site means any set of copyrightable works thus published on the MMC
  1523. site.
  1524. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
  1525. license published by Creative Commons Corporation, a not-for-profit
  1526. corporation with a principal place of business in San Francisco,
  1527. California, as well as future copyleft versions of that license
  1528. published by that same organization.
  1529. "Incorporate" means to publish or republish a Document, in whole or
  1530. in part, as part of another Document.
  1531. An MMC is "eligible for relicensing" if it is licensed under this
  1532. License, and if all works that were first published under this
  1533. License somewhere other than this MMC, and subsequently
  1534. incorporated in whole or in part into the MMC, (1) had no cover
  1535. texts or invariant sections, and (2) were thus incorporated prior
  1536. to November 1, 2008.
  1537. The operator of an MMC Site may republish an MMC contained in the
  1538. site under CC-BY-SA on the same site at any time before August 1,
  1539. 2009, provided the MMC is eligible for relicensing.
  1540. ADDENDUM: How to use this License for your documents
  1541. ====================================================
  1542. To use this License in a document you have written, include a copy of
  1543. the License in the document and put the following copyright and license
  1544. notices just after the title page:
  1545. Copyright (C) YEAR YOUR NAME.
  1546. Permission is granted to copy, distribute and/or modify this document
  1547. under the terms of the GNU Free Documentation License, Version 1.3
  1548. or any later version published by the Free Software Foundation;
  1549. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  1550. Texts. A copy of the license is included in the section entitled ``GNU
  1551. Free Documentation License''.
  1552. If you have Invariant Sections, Front-Cover Texts and Back-Cover
  1553. Texts, replace the "with...Texts." line with this:
  1554. with the Invariant Sections being LIST THEIR TITLES, with
  1555. the Front-Cover Texts being LIST, and with the Back-Cover Texts
  1556. being LIST.
  1557. If you have Invariant Sections without Cover Texts, or some other
  1558. combination of the three, merge those two alternatives to suit the
  1559. situation.
  1560. If your document contains nontrivial examples of program code, we
  1561. recommend releasing these examples in parallel under your choice of
  1562. free software license, such as the GNU General Public License, to
  1563. permit their use in free software.
  1564. 
  1565. File: widget, Node: Index, Prev: GNU Free Documentation License, Up: Top
  1566. Index
  1567. *****
  1568. This is an alphabetical listing of all concepts, functions, commands,
  1569. variables, and widgets described in this manual.
  1570. [index]
  1571. * Menu:
  1572. * action keyword: Defining New Widgets.
  1573. (line 127)
  1574. * activate a widget: Widget Properties. (line 46)
  1575. * active widget: Widget Properties. (line 46)
  1576. * append-button-args keyword: editable-list. (line 37)
  1577. * args keyword <1>: editable-list. (line 46)
  1578. * args keyword <2>: checklist. (line 46)
  1579. * args keyword <3>: radio-button-choice. (line 42)
  1580. * args keyword: menu-choice. (line 29)
  1581. * atomic sexp widget: atoms. (line 6)
  1582. * basic widgets: Introduction. (line 13)
  1583. * boolean: atoms. (line 60)
  1584. * browse-url-browser-function, and url-link widget: url-link. (line 10)
  1585. * button widgets: User Interface. (line 84)
  1586. * button-args keyword <1>: checklist. (line 36)
  1587. * button-args keyword: radio-button-choice. (line 29)
  1588. * button-face keyword: Basic Types. (line 71)
  1589. * button-prefix keyword: Basic Types. (line 74)
  1590. * button-suffix keyword: Basic Types. (line 74)
  1591. * buttons keyword <1>: editable-list. (line 40)
  1592. * buttons keyword <2>: checklist. (line 40)
  1593. * buttons keyword: radio-button-choice. (line 33)
  1594. * case-fold keyword: menu-choice. (line 18)
  1595. * character: atoms. (line 29)
  1596. * checkbox widget: checkbox. (line 6)
  1597. * checklist widget: checklist. (line 6)
  1598. * children keyword <1>: editable-list. (line 43)
  1599. * children keyword <2>: checklist. (line 43)
  1600. * children keyword <3>: radio-button-choice. (line 36)
  1601. * children keyword: menu-choice. (line 22)
  1602. * choice: composite. (line 20)
  1603. * choice keyword <1>: radio-button-choice. (line 39)
  1604. * choice keyword: menu-choice. (line 26)
  1605. * choice-item widget: choice-item. (line 6)
  1606. * composite sexp widgets: composite. (line 6)
  1607. * cons: composite. (line 14)
  1608. * const: constants. (line 18)
  1609. * constant widgets: constants. (line 6)
  1610. * convert-widget keyword: Defining New Widgets.
  1611. (line 35)
  1612. * copy keyword: Defining New Widgets.
  1613. (line 50)
  1614. * create keyword: Defining New Widgets.
  1615. (line 75)
  1616. * deactivate a widget: Widget Properties. (line 46)
  1617. * default: Defining New Widgets.
  1618. (line 150)
  1619. * define-widget: Defining New Widgets.
  1620. (line 11)
  1621. * defining new widgets: Defining New Widgets.
  1622. (line 6)
  1623. * delete keyword: Defining New Widgets.
  1624. (line 80)
  1625. * delete-button-args keyword: editable-list. (line 34)
  1626. * directory: atoms. (line 40)
  1627. * doc keyword: Basic Types. (line 88)
  1628. * editable-field widget: editable-field. (line 6)
  1629. * editable-list widget: editable-list. (line 6)
  1630. * embedded buttons: User Interface. (line 112)
  1631. * entry-format keyword <1>: editable-list. (line 15)
  1632. * entry-format keyword <2>: checklist. (line 17)
  1633. * entry-format keyword: radio-button-choice. (line 17)
  1634. * example of using widgets: Programming Example. (line 6)
  1635. * extra-offset keyword: Basic Types. (line 118)
  1636. * file: atoms. (line 32)
  1637. * follow-link keyword: Basic Types. (line 106)
  1638. * format keyword: Basic Types. (line 20)
  1639. * format-handler keyword: Defining New Widgets.
  1640. (line 117)
  1641. * function: atoms. (line 47)
  1642. * function-item: constants. (line 31)
  1643. * generic sexp widget: generic. (line 6)
  1644. * greedy keyword: checklist. (line 29)
  1645. * group widget: group. (line 6)
  1646. * help-echo keyword: Basic Types. (line 98)
  1647. * inactive widget: Widget Properties. (line 46)
  1648. * indent keyword: Basic Types. (line 110)
  1649. * info-link widget: info-link. (line 6)
  1650. * insert-button-args keyword: editable-list. (line 31)
  1651. * integer: atoms. (line 54)
  1652. * item widget: item. (line 6)
  1653. * keymap keyword: editable-field. (line 34)
  1654. * keyword arguments: Basic Types. (line 15)
  1655. * link widget: link. (line 6)
  1656. * list: composite. (line 29)
  1657. * match keyword: Basic Types. (line 139)
  1658. * menu-choice widget: menu-choice. (line 6)
  1659. * menu-tag keyword: Basic Types. (line 129)
  1660. * menu-tag-get keyword: Basic Types. (line 133)
  1661. * Mouse-2 (on button widgets): User Interface. (line 94)
  1662. * must-match keyword: atoms. (line 35)
  1663. * new widgets: Defining New Widgets.
  1664. (line 6)
  1665. * notify keyword: Basic Types. (line 122)
  1666. * number: atoms. (line 57)
  1667. * off-glyph keyword: toggle. (line 24)
  1668. * offset keyword: Basic Types. (line 114)
  1669. * on-glyph keyword: toggle. (line 20)
  1670. * option field tag: User Interface. (line 104)
  1671. * parent keyword: Basic Types. (line 170)
  1672. * prompt-value keyword: Defining New Widgets.
  1673. (line 137)
  1674. * properties of widgets: Widget Properties. (line 6)
  1675. * push-button widget: push-button. (line 6)
  1676. * radio-button-choice widget: radio-button-choice. (line 6)
  1677. * regexp: atoms. (line 26)
  1678. * repeat: composite. (line 76)
  1679. * secret keyword: editable-field. (line 24)
  1680. * set: composite. (line 66)
  1681. * sexp: generic. (line 14)
  1682. * sexp types: Sexp Types. (line 6)
  1683. * sibling-args keyword: Basic Types. (line 174)
  1684. * size keyword: editable-field. (line 16)
  1685. * string: atoms. (line 23)
  1686. * symbol: atoms. (line 44)
  1687. * tab-order keyword: Basic Types. (line 155)
  1688. * tag keyword: Basic Types. (line 91)
  1689. * tag-glyph keyword: Basic Types. (line 94)
  1690. * text widget: text. (line 6)
  1691. * todo: Widget Wishlist. (line 6)
  1692. * toggle widget: toggle. (line 6)
  1693. * url-link widget: url-link. (line 6)
  1694. * utility functions for widgets: Utilities. (line 6)
  1695. * valid-regexp keyword: editable-field. (line 29)
  1696. * validate keyword: Basic Types. (line 144)
  1697. * value keyword: Basic Types. (line 17)
  1698. * value-create keyword: Defining New Widgets.
  1699. (line 93)
  1700. * value-delete keyword: Defining New Widgets.
  1701. (line 101)
  1702. * value-face keyword: editable-field. (line 20)
  1703. * value-get keyword: Defining New Widgets.
  1704. (line 108)
  1705. * value-to-external keyword: Defining New Widgets.
  1706. (line 68)
  1707. * value-to-internal keyword: Defining New Widgets.
  1708. (line 61)
  1709. * variable: atoms. (line 51)
  1710. * variable-item: constants. (line 28)
  1711. * vector: composite. (line 38)
  1712. * void keyword: menu-choice. (line 14)
  1713. * widget browser: Widget Browser. (line 6)
  1714. * widget buttons: User Interface. (line 84)
  1715. * widget library, why use it: Introduction. (line 62)
  1716. * widget minor mode: Widget Minor Mode. (line 6)
  1717. * widget properties: Widget Properties. (line 6)
  1718. * widget-backward: User Interface. (line 158)
  1719. * widget-browse: Widget Browser. (line 12)
  1720. * widget-browse-at: Widget Browser. (line 20)
  1721. * widget-browse-other-window: Widget Browser. (line 16)
  1722. * widget-button-click <1>: Setting Up the Buffer.
  1723. (line 37)
  1724. * widget-button-click: User Interface. (line 96)
  1725. * widget-button-face: User Interface. (line 139)
  1726. * widget-button-prefix: Basic Types. (line 32)
  1727. * widget-button-press <1>: Setting Up the Buffer.
  1728. (line 37)
  1729. * widget-button-press: User Interface. (line 90)
  1730. * widget-button-suffix: Basic Types. (line 35)
  1731. * widget-children-validate: Basic Types. (line 153)
  1732. * widget-create: Setting Up the Buffer.
  1733. (line 12)
  1734. * widget-default-delete: Defining New Widgets.
  1735. (line 87)
  1736. * widget-default-format-handler: Defining New Widgets.
  1737. (line 123)
  1738. * widget-delete: Setting Up the Buffer.
  1739. (line 19)
  1740. * widget-field-face: User Interface. (line 79)
  1741. * widget-field-keymap: editable-field. (line 34)
  1742. * widget-forward: User Interface. (line 153)
  1743. * widget-get: Widget Properties. (line 33)
  1744. * widget-get-sibling: Utilities. (line 11)
  1745. * widget-global-map: Setting Up the Buffer.
  1746. (line 43)
  1747. * widget-glyph-directory: Basic Types. (line 182)
  1748. * widget-glyph-enable: Basic Types. (line 187)
  1749. * widget-insert: Setting Up the Buffer.
  1750. (line 32)
  1751. * widget-keymap: Setting Up the Buffer.
  1752. (line 38)
  1753. * widget-link-prefix: link. (line 16)
  1754. * widget-link-suffix: link. (line 19)
  1755. * widget-member: Widget Properties. (line 38)
  1756. * widget-minor-mode: Widget Minor Mode. (line 11)
  1757. * widget-minor-mode-keymap: Widget Minor Mode. (line 15)
  1758. * widget-mouse-face: User Interface. (line 142)
  1759. * widget-parent-action: Defining New Widgets.
  1760. (line 134)
  1761. * widget-prompt-value: Utilities. (line 7)
  1762. * widget-push-button-prefix: push-button. (line 16)
  1763. * widget-push-button-suffix: push-button. (line 19)
  1764. * widget-put: Widget Properties. (line 29)
  1765. * widget-radio-add-item: radio-button-choice. (line 50)
  1766. * widget-setup: Setting Up the Buffer.
  1767. (line 22)
  1768. * widget-text-keymap: text. (line 6)
  1769. * widget-type: Widget Properties. (line 44)
  1770. * widget-types-convert-widget: Defining New Widgets.
  1771. (line 45)
  1772. * widget-types-copy: Defining New Widgets.
  1773. (line 59)
  1774. * widget-value: Widget Properties. (line 10)
  1775. * widget-value-convert-widget: Defining New Widgets.
  1776. (line 48)
  1777. * widget-value-set: Widget Properties. (line 14)
  1778. * widget-value-value-get: Defining New Widgets.
  1779. (line 115)
  1780. * widgets, basic types: Introduction. (line 13)
  1781. * widgets, programming example: Programming Example. (line 6)
  1782. 
  1783. Tag Table:
  1784. Node: Top998
  1785. Node: Introduction2128
  1786. Node: User Interface5199
  1787. Node: Programming Example10920
  1788. Node: Setting Up the Buffer15127
  1789. Node: Basic Types16794
  1790. Node: link23418
  1791. Node: url-link23926
  1792. Node: info-link24230
  1793. Node: push-button24512
  1794. Node: editable-field25079
  1795. Node: text26467
  1796. Node: menu-choice26756
  1797. Node: radio-button-choice27604
  1798. Node: item29186
  1799. Node: choice-item29566
  1800. Node: toggle30056
  1801. Node: checkbox30803
  1802. Node: checklist31102
  1803. Node: editable-list32537
  1804. Node: group33711
  1805. Node: Sexp Types33991
  1806. Node: constants34335
  1807. Node: generic35403
  1808. Node: atoms35953
  1809. Node: composite37874
  1810. Node: Widget Properties40854
  1811. Node: Defining New Widgets43907
  1812. Node: Widget Browser49935
  1813. Node: Widget Minor Mode50788
  1814. Node: Utilities51337
  1815. Node: Widget Wishlist51820
  1816. Node: GNU Free Documentation License53077
  1817. Node: Index78247
  1818. 
  1819. End Tag Table