Overview
Comment: | share/vim/functions/tcleval.vim src/tclreadline/README src/tclreadline/configure.in src/tclreadline/tclreadline.c src/tclreadline/tclreadline.n.in src/tclreadline/tclreadlineCompleter.tcl src/tclreadline/tclreadlineSetup.tcl.in |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a7cb82dbde9350c31ae885487afe64f7 |
User & Date: | johannes@zellner.org on 1999-09-19 21:18:23 |
Other Links: | manifest | tags |
Context
1999-09-19
| ||
23:17 | src/tclreadline/Makefile.in src/tclreadline/README src/tclreadline/configure.in check-in: 80e099e981 user: johannes@zellner.org tags: trunk | |
21:18 | share/vim/functions/tcleval.vim src/tclreadline/README src/tclreadline/configure.in src/tclreadline/tclreadline.c src/tclreadline/tclreadline.n.in src/tclreadline/tclreadlineCompleter.tcl src/tclreadline/tclreadlineSetup.tcl.in check-in: a7cb82dbde user: johannes@zellner.org tags: trunk | |
10:48 | share/vim/ft/tcl_ft.vim src/tclreadline/tclreadlineCompleter.tcl check-in: f06e7a16c7 user: johannes@zellner.org tags: trunk | |
Changes
Modified README from [526d06c650] to [f6e3ce53eb].
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | FILE: "/home/joze/src/tclreadline/README" |
︙ | |||
73 74 75 76 77 78 79 80 81 82 83 84 85 86 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + + + + + + | start your favorite interpreter. The tclreadlineSetup.tcl script does the rest. 4. History and Changes. ----------------------- tclreadline-1.0.0: (Sep 1999) note: - the script completer procs are written. this is `sort of a first usable release'. tclreadline-0.9.3: (Sep 1999) changes: - tk completion. - multiple fallback completion routines for unknown commands. |
︙ |
Modified configure.in from [19e43b3702] to [0c9810d5e7].
1 | 1 2 3 4 5 6 7 8 9 10 | - - + + | # -*- autoconf -*- |
︙ | |||
32 33 34 35 36 37 38 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - - - + + + | dnl to configure the system for the local environment. AC_REVISION($Revision$) AC_INIT(tclreadline.c) AC_CONFIG_HEADER(config.h) |
︙ | |||
341 342 343 344 345 346 347 | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + | else AC_MSG_RESULT(${READLINE_LIB_DIR}/libreadline${SHLIB_SUFFIX}${READLINE_VERSION_SUFFIX}) fi # --- |
︙ |
Modified tclreadline.c from [035d2f38c0] to [825d7708d3].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | /* ================================================================== FILE: "/home/joze/src/tclreadline/tclreadline.c" |
︙ | |||
374 375 376 377 378 379 380 | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | + + + + + + - + | case TCLRL_RESET_TERMINAL: /* TODO: add this to the completer */ if (argc > 3) { Tcl_WrongNumArgs(interp, 2, objv, "?terminal-name?"); return TCL_ERROR; } else if (3 == argc) { /* * - tcl8.0 doesn't have Tcl_GetString() * - rl_reset_terminal() might be defined * to take no arguments. This might produce * a compiler warning. */ |
︙ |
Modified tclreadline.n.in from [72c7fb52c1] to [d2e40c4100].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 | - - + + | .TH tclreadline n "@TCLREADLINE_VERSION@.@TCLREADLINE_PATCHLEVEL@" "Johannes Zellner" .\" (C) 1999 by Johannes Zellner |
︙ | |||
298 299 300 301 302 303 304 | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | - + | "\\C-xp": "puts $env(PATH)" $endif .CE For further documentation please refer to the gnu readline documentation. .SH "BUGS" |
︙ |
Modified tclreadlineCompleter.tcl from [d353429a4a] to [577a853e5f].
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | # -*- tclsh -*- # FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl" |
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # TODO: # # - tcltest is missing # - better completion for CompleteListFromList: # RemoveUsedOptions ... # - namespace eval fred {... <-- continue with a # substitution in fred. |
︙ | |||
319 320 321 322 323 324 325 | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | - | # @param cmd # @return list of options for cmd # @date Sep-14-1999 # proc TrySubCmds {text cmd} { set trystring ---- |
︙ | |||
451 452 453 454 455 456 457 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | + - + - + + + + - + + - + - + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - + + - + + - - - + + + + + + + + + + + + + - - + + + + + | } return [llength ${option_table}] } #** # try to complete a `cmd configure|cget ..' from the command's options. # @param text start line cmd, standard tclreadlineCompleter arguments. # @return -- a flag indicating, if (cget|configure) was found. |
︙ | |||
623 624 625 626 627 628 629 | 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | - | return ${expr_pos} } proc RemoveUsedOptions {line opts {terminate {}}} { if {[llength ${terminate}]} { if {[regexp -- ${terminate} ${line}]} { return "" |
︙ | |||
903 904 905 906 907 908 909 | 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 | - - - + + + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + | # save `lindex'. works also for non-complete lines # with opening parentheses or quotes. # usage as `lindex'. # Eventually returns the Rest of an incomplete line, # if the index is `end' or == [Llength $line]. # proc Lindex {line pos} { |
︙ | |||
1394 1395 1396 1397 1398 1399 1400 | 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 | - + - - + + | return [DisplayHints <$arg>] } } } # check if the command is an object of known class. # |
︙ | |||
3579 3580 3581 3582 3583 3584 3585 | 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - | return [list . {}] } else { return [DisplayHints ${fallback}] } } # TODO |
︙ | |||
3623 3624 3625 3626 3627 3628 3629 | 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 | + - + + + + - + + + - + + + - + + + + - + - - - - - - - + + - + + + + + + + - + + + + + + + - + + + + + | -insertborderwidth - -insertwidth - -selectborderwidth - -highlightthickness - -padx - -pady - -wraplength { if ${always} { |
︙ | |||
3709 3710 3711 3712 3713 3714 3715 | 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 | + - - + + + + + | } -variable { return [VarCompletion ${text} #0] } default { # if ${always} { |
︙ | |||
4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 | 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return [PackConfig ${text} ${line} ${prev}] } } } } return "" } proc PlaceConfig {text line prev} { set opts { -in -x -relx -y -rely -anchor -width -relwidth -height -relheight -bordermode } switch -- ${prev} { -in { return [CompleteFromList ${text} [WidgetChildren ${text}]] } -x - -relx - -y - -rely { return [DisplayHints <location>] } -anchor { return [CompleteAnchor ${text}] } -width - -relwidth - -height - -relheight { return [DisplayHints <size>] } -bordermode { return [CompleteFromList ${text} {ignore inside outside}] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} ${opts}]] } } } proc complete(place) {text start end line pos mod} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] switch -- ${pos} { 1 { return [CompleteFromList ${text} \ [concat [WidgetChildren ${text}] { configure forget info slaves }]] } 2 { switch -- ${sub} { configure - forget - info - slaves { return [CompleteFromList ${text} [WidgetChildren ${text}]] } default { return [PlaceConfig ${text} ${line} ${prev}] } } } default { switch -- ${sub} { configure { return [PlaceConfig ${text} ${line} ${prev}] } forget {} info {} slaves {} default { return [PlaceConfig ${text} ${line} ${prev}] } } } } return "" } proc complete(radiobutton) {text start end line pos mod} { switch -- ${pos} { 1 { return [EventuallyInsertLeadingDot ${text} <pathName>] } default { return [CompleteWidgetConfigurations ${text} ${start} ${line} { -activebackground -activeforeground -anchor -background |
︙ | |||
4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 | 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + | -takefocus -troughcolor -activerelief -command -elementborderwidth -width }] } } return "" } proc SelectionOpts {text start end line pos mod lst} { set prev [PreviousWord ${start} ${line}] if {-1 == [lsearch ${lst} ${prev}]} { set prev "" ;# force the default arm } switch -- ${prev} { -displayof { return [CompleteFromList ${text} \ [WidgetChildren ${text}]] } -selection { variable selection-selections return [CompleteFromList ${text} ${selection-selections}] } -type { variable selection-types return [CompleteFromList ${text} ${selection-types}] } -command { return [BraceOrCommand ${text} \ ${start} ${end} ${line} ${pos} ${mod}] } -format { variable selection-formats return [CompleteFromList ${text} ${selection-formats}] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} ${lst}]] } } } proc complete(selection) {text start end line pos mod} { switch -- ${pos} { 1 { return [TrySubCmds ${text} [Lindex ${line} 0]] } default { set sub [Lindex ${line} 1] set widgets [WidgetChildren ${text}] switch -- ${sub} { clear { return [SelectionOpts \ ${text} ${start} ${end} ${line} ${pos} ${mod} { -displayof -selection }] } get { return [SelectionOpts \ ${text} ${start} ${end} ${line} ${pos} ${mod} { -displayof -selection -type }] } handle { return [SelectionOpts \ ${text} ${start} ${end} ${line} ${pos} ${mod} \ [concat {-selection -type -format} ${widgets}]] } own { return [SelectionOpts \ ${text} ${start} ${end} ${line} ${pos} ${mod} \ [concat {-command -selection} ${widgets}]] } } } } } proc complete(send) {text start end line pos mod} { set prev [PreviousWord ${start} ${line}] if {"-displayof" == ${prev}} { return [TryFromList ${text} [WidgetChildren ${text}]] } set cmds [RemoveUsedOptions ${line} { -async -displayof -- } {--}] if {[llength ${cmds}]} { return [string trim [CompleteFromList ${text} \ [concat ${cmds} <app>]]] } else { if {[regexp -- --$ ${line}]} { return [list {--}]; # append a blank } else { # TODO make this better! return [DisplayHints [list {<app cmd ?arg ...?>}]] } } return "" } proc complete(text) {text start end line pos mod} { switch -- ${pos} { 1 { return [EventuallyInsertLeadingDot ${text} <pathName>] } default { return [CompleteWidgetConfigurations ${text} ${start} ${line} { -background -borderwidth -cursor -exportselection -font -foreground -highlightbackground -highlightcolor -highlightthickness -insertbackground -insertborderwidth -insertofftime -insertontime -insertwidth -padx -pady -relief -selectbackground -selectborderwidth -selectforeground -setgrid -takefocus -xscrollcommand -yscrollcommand -height -spacing1 -spacing2 -spacing3 -state -tabs -width -wrap }] } } return "" } proc complete(tk) {text start end line pos mod} { switch -- ${pos} { 1 { return [TrySubCmds ${text} [Lindex ${line} 0]] } default { switch -- [Lindex ${line} 1] { appname { return [DisplayHints ?newName?] } scaling { switch -- [PreviousWord ${start} ${line}] { -displayof { return [TryFromList ${text} \ [WidgetChildren ${text}]] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} {-displayof ?number?}]] } } } } } } } # proc complete(tk_bisque) {text start end line pos mod} { # } proc complete(tk_chooseColor) {text start end line pos mod} { switch -- [PreviousWord ${start} ${line}] { -initialcolor { return [CompleteColor ${text}] } -parent { return [TryFromList ${text} [WidgetChildren ${text}]] } -title { return [DisplayHints <string>] } default { return [TryFromList ${text} \ [RemoveUsedOptions ${line} {-initialcolor -parent -title}]] } } } proc complete(tk_dialog) {text start end line pos mod} { switch -- ${pos} { 1 { return [CompleteFromList ${text} [ToplevelWindows]] } 2 { return [DisplayHints <title>] } 3 { return [DisplayHints <text>] } 4 { return [CompleteFromBitmaps ${text}] } 5 { return [DisplayHints <defaultIndex>] } default { return [DisplayHints ?buttonName?] } } } proc complete(tk_focusNext) {text start end line pos mod} { switch -- ${pos} { 1 { return [CompleteFromList ${text} [WidgetChildren ${text}]] } } } proc complete(tk_focusPrev) {text start end line pos mod} { switch -- ${pos} { 1 { return [CompleteFromList ${text} [WidgetChildren ${text}]] } } } # proc complete(tk_focusFollowsMouse) {text start end line pos mod} { # } proc GetOpenSaveFile {text start end line pos mod {add ""}} { # enable filename completion for the first four switches. switch -- [PreviousWord ${start} ${line}] { -defaultextension {} -filetypes {} -initialdir {} -initialfile {} -parent { return [CompleteFromList ${text} [WidgetChildren ${text}]] } -title { return [DisplayHints <titleString>] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} [concat { -defaultextension -filetypes -initialdir -parent -title } ${add}]]] } } } proc complete(tk_getOpenFile) {text start end line pos mod} { return [GetOpenSaveFile \ ${text} ${start} ${end} ${line} ${pos} ${mod}] } proc complete(tk_getSaveFile) {text start end line pos mod} { return [GetOpenSaveFile \ ${text} ${start} ${end} ${line} ${pos} ${mod} -initialfile] } proc complete(tk_messageBox) {text start end line pos mod} { switch -- [PreviousWord ${start} ${line}] { -default { return [CompleteFromList ${text} { abort cancel ignore no ok retry yes }] } -icon { return [CompleteFromList ${text} { error info question warning }] } -message { return [DisplayHints <string>] } -parent { return [CompleteFromList ${text} [WidgetChildren ${text}]] } -title { return [DisplayHints <titleString>] } -type { return [CompleteFromList ${text} { abortretryignore ok okcancel retrycancel yesno yesnocancel }] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} { -default -icon -message -parent -title -type }]] } } } proc complete(tk_optionMenu) {text start end line pos mod} { switch -- ${pos} { 1 { return [EventuallyInsertLeadingDot ${text} <pathName>] } 2 { return [VarCompletion ${text} #0] } 3 { return [DisplayHints <value>] } default { return [DisplayHints ?value?] } } } proc complete(tk_popup) {text start end line pos mod} { switch -- ${pos} { 1 { # display only menu widgets # set widgets [WidgetChildren ${text}] set menu_widgets "" foreach widget ${widgets} { if {"Menu" == [winfo class ${widget}]} { lappend menu_widgets ${widget} } } if {[llength ${menu_widgets}]} { return [TryFromList ${text} ${menu_widgets}] } else { return [DisplayHints <menu>] } } 2 { return [DisplayHints <x>] } 3 { return [DisplayHints <y>] } 4 { return [DisplayHints ?entryIndex?] } } } # TODO: the name - value construct didn't work in my wish. # proc complete(tk_setPalette) {text start end line pos mod} { set database { activeBackground foreground selectColor activeForeground highlightBackground selectBackground background highlightColor selectForeground disabledForeground insertBackground troughColor } switch -- ${pos} { 1 { return [CompleteColor ${text} ${database}] } default { switch [expr ${pos} % 2] { 1 { return [CompleteFromList ${text} ${database}] } 0 { return [CompleteColor ${text}] } } } } } proc complete(tkwait) {text start end line pos mod} { switch -- ${pos} { 1 { return [CompleteFromList ${text} { variable visibility window }] } 2 { switch [Lindex ${line} 1] { variable { return [VarCompletion ${text} #0] } visibility - window { return [TryFromList ${text} [WidgetChildren ${text}]] } } } } } proc complete(toplevel) {text start end line pos mod} { switch -- ${pos} { 1 { return [EventuallyInsertLeadingDot ${text} <pathName>] } default { return [CompleteWidgetConfigurations ${text} ${start} ${line} { -borderwidth -cursor -highlightbackground -highlightcolor -highlightthickness -relief -takefocus -background -class -colormap -container -height -menu -screen -use -visual -width }] } } return "" } proc complete(winfo) {text start end line pos mod} { |
︙ | |||
4956 4957 4958 4959 4960 4961 4962 | 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 | - - - - + - - - - | }]] } } } image { switch -- ${prev} { -anchor { return [CompleteAnchor ${text}] } |
︙ | |||
5143 5144 5145 5146 5147 5148 5149 | 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 | - + | } } proc CanvasObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] if {1 == $pos} { |
︙ | |||
5241 5242 5243 5244 5245 5246 5247 | 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 | - + + + + + + | dtag { switch -- ${pos} { 2 { return [DisplayHints <tagOrId>] } 3 { return [DisplayHints ?tagToDelete?] } } } find { |
︙ | |||
5424 5425 5426 5427 5428 5429 5430 | 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 | - + - - + + + | }] } proc EntryObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] if {1 == $pos} { |
︙ | |||
5483 5484 5485 5486 5487 5488 5489 | 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 | - + | # the fallback routines do the job pretty well. # } proc ListboxObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] if {1 == $pos} { |
︙ | |||
5607 5608 5609 5610 5611 5612 5613 | 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 | - + - - - - - - - | if {[string length ${names}]} { return [CompleteFromList ${text} ${names}] } else { return [DisplayHints <fontname>] } } -image - |
︙ | |||
5660 5661 5662 5663 5664 5665 5666 | 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 | - + | } } proc MenuObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] if {1 == $pos} { |
︙ | |||
5726 5727 5728 5729 5730 5731 5732 5733 5734 | 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | 3 { return [DisplayHints <y>] } } } # ??? XXX unpost {} } } proc PhotoObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] set copy_opts { -from -to -shrink -zoom -subsample } set read_opts { -from -to -shrink -format } set write_opts { -from -format } switch -- ${pos} { 1 { return [CompleteFromList ${text} { blank cget configure copy get put read redither write }] } 2 { switch -- ${sub} { blank {} cget {} configure {} redither {} copy { return [CompleteFromImages ${text}] } get { return [DisplayHints <x>] } put { return [DisplayHints <data>] } read {} write {} } } 3 { switch -- ${sub} { blank {} cget {} configure {} redither {} copy { return [CompleteFromList ${text} ${copy_opts}] } get { return [DisplayHints <y>] } put { return [CompleteFromList ${text} -to] } read { return [CompleteFromList ${text} ${read_opts}] } write { return [CompleteFromList ${text} ${write_opts}] } } } default { switch -- ${sub} { blank {} cget {} configure {} redither {} get {} copy { switch -- ${prev} { -from - -to { return [DisplayHints [list <x1 y1 x2 y2>]] } -zoom - -subsample { return [DisplayHints [list <x y>]] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} ${copy_opts}]] } } } put { switch -- ${prev} { -to { return [DisplayHints [list <x1 y1 x2 y2>]] } } } read { switch -- ${prev} { -from { return [DisplayHints [list <x1 y1 x2 y2>]] } -to { return [DisplayHints [list <x y>]] } -format { return [DisplayHints <formatName>] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} ${read_opts}]] } } } write { switch -- ${prev} { -from { return [DisplayHints [list <x1 y1 x2 y2>]] } -format { return [DisplayHints <formatName>] } default { return [CompleteFromList ${text} \ [RemoveUsedOptions ${line} ${write_opts}]] } } } } } } } # proc RadiobuttonObj {text start end line pos} { # the fallback routines do the job pretty well. # } proc ScaleObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] switch -- ${pos} { 1 { return [TrySubCmds ${text} [Lindex ${line} 0]] } 2 { switch -- ${sub} { coords { return [DisplayHints ?value?] } get { return [DisplayHints ?x?] } identify { return [DisplayHints <x>] } set { return [DisplayHints <value>] } } } 3 { switch -- ${sub} { get { return [DisplayHints ?y?] } identify { return [DisplayHints <y>] } } } } } proc ScrollbarObj {text start end line pos} { set sub [Lindex ${line} 1] set prev [PreviousWord ${start} ${line}] # note that the `prefix moveto|scroll' # construct is hard to complete. # switch -- ${pos} { 1 { return [TrySubCmds ${text} [Lindex ${line} 0]] } 2 { switch -- ${sub} { activate { return [CompleteFromList ${text} { arrow1 slider arrow2 }] } fraction - identify { return [DisplayHints <x>] } delta { return [DisplayHints <deltaX>] } set { return [DisplayHints <first>] } } } 3 { switch -- ${sub} { fraction - identify { return [DisplayHints <y>] } delta { return [DisplayHints <deltaY>] } set { return [DisplayHints <last>] } } } } } proc TextObj {text start end line pos} { # TODO ... return [CompleteFromOptionsOrSubCmds \ ${text} ${start} ${end} ${line} ${pos}] } }; # namespace tclreadline |
Modified tclreadlineSetup.tcl.in from [d62d0c5c0c] to [3563bc89b4].
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | #!/usr/locanl/bin/tclsh # FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in" |
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + - | # # johannes@zellner.org # http://www.zellner.org/tclreadline/ # # ================================================================== |
︙ |