comparison lisp/wid-edit.el @ 18089:bb0e09c8ada3

Synched with 1.9904
author Per Abrahamsen <abraham@dina.kvl.dk>
date Sun, 01 Jun 1997 11:58:17 +0000
parents 05c70aa62552
children 2983683a278b
comparison
equal deleted inserted replaced
18088:be8a62ae8d21 18089:bb0e09c8ada3
2 ;; 2 ;;
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 ;; 4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: extensions 6 ;; Keywords: extensions
7 ;; Version: 1.9903 7 ;; Version: 1.9904
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ 8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
276 (add-text-properties from to (list 'read-only t 276 (add-text-properties from to (list 'read-only t
277 ;; Emacs is sticky. 277 ;; Emacs is sticky.
278 'front-sticky t 278 'front-sticky t
279 'rear-nonsticky nil 279 'rear-nonsticky nil
280 ;; XEmacs is non-sticky. 280 ;; XEmacs is non-sticky.
281 'start-open nil 281 'start-open t
282 'end-open nil 282 'end-open t
283 ;; This is because `insert' 283 ;; This is because `insert'
284 ;; inherit sticky text properties 284 ;; inherit sticky text properties
285 ;; in XEmacs but not in Emacs. 285 ;; in XEmacs but not in Emacs.
286 ))) 286 )))
287 287
332 (secret (widget-get widget :secret)) 332 (secret (widget-get widget :secret))
333 (secret-to to) 333 (secret-to to)
334 (size (widget-get widget :size)) 334 (size (widget-get widget :size))
335 (face (or (widget-get widget :value-face) 335 (face (or (widget-get widget :value-face)
336 'widget-field-face)) 336 'widget-field-face))
337 (help-echo (widget-get widget :help-echo)) 337 (help-echo (widget-get widget :help-echo)))
338 (help-property (if (featurep 'balloon-help)
339 'balloon-help
340 'help-echo)))
341 (unless (or (stringp help-echo) (null help-echo)) 338 (unless (or (stringp help-echo) (null help-echo))
342 (setq help-echo 'widget-mouse-help)) 339 (setq help-echo 'widget-mouse-help))
343 340
344 (when secret 341 (when secret
345 (while (and size 342 (while (and size
358 355
359 (set-text-properties from to (list 'field widget 356 (set-text-properties from to (list 'field widget
360 'read-only nil 357 'read-only nil
361 'keymap map 358 'keymap map
362 'local-map map 359 'local-map map
363 help-property help-echo 360 'balloon-help help-echo
361 'help-echo help-echo
364 'face face)) 362 'face face))
365 363
366 (when secret 364 (when secret
367 (save-excursion 365 (save-excursion
368 (goto-char from) 366 (goto-char from)
372 (put-text-property (point) (1+ (point)) 'secret old)) 370 (put-text-property (point) (1+ (point)) 'secret old))
373 (forward-char)))) 371 (forward-char))))
374 372
375 (unless (widget-get widget :size) 373 (unless (widget-get widget :size)
376 (add-text-properties to (1+ to) (list 'field widget 374 (add-text-properties to (1+ to) (list 'field widget
377 help-property help-echo 375 'balloon-help help-echo
376 'help-echo help-echo
378 'face face))) 377 'face face)))
379 (add-text-properties to (1+ to) (list 'local-map map 378 (add-text-properties to (1+ to) (list 'local-map map
380 'keymap map)))) 379 'keymap map))))
381 (defun widget-specify-button (widget from to) 380 (defun widget-specify-button (widget from to)
382 ;; Specify button for WIDGET between FROM and TO. 381 ;; Specify button for WIDGET between FROM and TO.
1367 1366
1368 (defun widget-default-delete (widget) 1367 (defun widget-default-delete (widget)
1369 ;; Remove widget from the buffer. 1368 ;; Remove widget from the buffer.
1370 (let ((from (widget-get widget :from)) 1369 (let ((from (widget-get widget :from))
1371 (to (widget-get widget :to)) 1370 (to (widget-get widget :to))
1371 (inactive-overlay (widget-get widget :inactive))
1372 (button-overlay (widget-get widget :button-overlay))
1372 (inhibit-read-only t) 1373 (inhibit-read-only t)
1373 after-change-functions) 1374 after-change-functions)
1374 (widget-apply widget :value-delete) 1375 (widget-apply widget :value-delete)
1376 (when inactive-overlay
1377 (delete-overlay inactive-overlay))
1378 (when button-overlay
1379 (delete-overlay button-overlay))
1375 (when (< from to) 1380 (when (< from to)
1376 ;; Kludge: this doesn't need to be true for empty formats. 1381 ;; Kludge: this doesn't need to be true for empty formats.
1377 (delete-region from to)) 1382 (delete-region from to))
1378 (set-marker from nil) 1383 (set-marker from nil)
1379 (set-marker to nil)) 1384 (set-marker to nil))
1663 (setq widget-field-list (delq widget widget-field-list)) 1668 (setq widget-field-list (delq widget widget-field-list))
1664 ;; These are nil if the :format string doesn't contain `%v'. 1669 ;; These are nil if the :format string doesn't contain `%v'.
1665 (when (widget-get widget :value-from) 1670 (when (widget-get widget :value-from)
1666 (set-marker (widget-get widget :value-from) nil)) 1671 (set-marker (widget-get widget :value-from) nil))
1667 (when (widget-get widget :value-from) 1672 (when (widget-get widget :value-from)
1668 (set-marker (widget-get widget :value-to) nil))) 1673 (set-marker (widget-get widget :value-to) nil))
1674 (when (widget-get widget :field-overlay)
1675 (delete-overlay (widget-get widget :field-overlay))))
1669 1676
1670 (defun widget-field-value-get (widget) 1677 (defun widget-field-value-get (widget)
1671 ;; Return current text in editing field. 1678 ;; Return current text in editing field.
1672 (let ((from (widget-get widget :value-from)) 1679 (let ((from (widget-get widget :value-from))
1673 (to (widget-get widget :value-to)) 1680 (to (widget-get widget :value-to))
2511 "An indicator and manipulator for hidden items." 2518 "An indicator and manipulator for hidden items."
2512 :format "%[%v%]" 2519 :format "%[%v%]"
2513 :button-prefix "" 2520 :button-prefix ""
2514 :button-suffix "" 2521 :button-suffix ""
2515 :on "hide" 2522 :on "hide"
2516 :off "more" 2523 :off "show"
2517 :value-create 'widget-visibility-value-create 2524 :value-create 'widget-visibility-value-create
2518 :action 'widget-toggle-action 2525 :action 'widget-toggle-action
2519 :match (lambda (widget value) t)) 2526 :match (lambda (widget value) t))
2520 2527
2521 (defun widget-visibility-value-create (widget) 2528 (defun widget-visibility-value-create (widget)