diff --git a/src/pextlib1.0/readline.c b/src/pextlib1.0/readline.c
index e955f8e7..ed9a6b50 100644
a
|
b
|
int ReadlineCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_ |
267 | 267 | add line |
268 | 268 | read filename |
269 | 269 | write filename |
| 270 | append filename |
270 | 271 | stifle max |
271 | 272 | unstifle |
272 | 273 | */ |
… |
… |
int RLHistoryCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl |
309 | 310 | } |
310 | 311 | s = Tcl_GetString(objv[2]); |
311 | 312 | write_history(s); |
| 313 | } else if (0 == strcmp("append", action)) { |
| 314 | if (objc != 3) { |
| 315 | Tcl_WrongNumArgs(interp, 1, objv, "append filename"); |
| 316 | return TCL_ERROR; |
| 317 | } |
| 318 | s = Tcl_GetString(objv[2]); |
| 319 | |
| 320 | /* FYI: `append_history' _could_ write more than 1 item at a time here, |
| 321 | * but that is not necessary for our present usage in src/port/port.tcl. |
| 322 | * It would also require some different handling of the arg count in |
| 323 | * this function. */ |
| 324 | |
| 325 | append_history(1, s); |
312 | 326 | } else if (0 == strcmp("stifle", action)) { |
313 | 327 | if (objc != 3) { |
314 | 328 | Tcl_WrongNumArgs(interp, 1, objv, "stifle maxlines"); |
diff --git a/src/port/port.tcl b/src/port/port.tcl
old mode 100644
new mode 100755
index a71f2cbe..7fb8170a
a
|
b
|
proc get_next_cmdline { in out use_readline prompt linename } { |
4844 | 4844 | set line [string trim $line] |
4845 | 4845 | |
4846 | 4846 | if { $use_readline && $line ne "" } { |
| 4847 | # Create macports user directory if it does not exist yet |
| 4848 | if {![file isdirectory $macports::macports_user_dir]} { |
| 4849 | file mkdir $macports::macports_user_dir |
| 4850 | } |
| 4851 | |
| 4852 | # Add history item to memory... |
4847 | 4853 | rl_history add $line |
| 4854 | # ... and then append that item to the history file |
| 4855 | rl_history append $history_file |
| 4856 | puts "history is supposed to be written here" |
4848 | 4857 | } |
4849 | 4858 | } |
4850 | 4859 | |
… |
… |
proc process_command_file { in } { |
4864 | 4873 | if {$use_readline && [file isdirectory $macports::macports_user_dir]} { |
4865 | 4874 | rl_history read $history_file |
4866 | 4875 | rl_history stifle 100 |
| 4876 | puts "history is supposed to be read here" |
4867 | 4877 | } |
4868 | 4878 | |
4869 | 4879 | # Be noisy, if appropriate |
… |
… |
proc process_command_file { in } { |
4873 | 4883 | puts "Entering shell mode... (\"help\" for help, \"quit\" to quit)" |
4874 | 4884 | } |
4875 | 4885 | |
| 4886 | if {$use_readline} { |
| 4887 | puts "this ought to be printed" |
| 4888 | } |
| 4889 | |
4876 | 4890 | # Main command loop |
4877 | 4891 | set exit_status 0 |
4878 | 4892 | while { $exit_status == 0 || $isstdin || [macports::ui_isset ports_processall] } { |
… |
… |
proc process_command_file { in } { |
4901 | 4915 | } |
4902 | 4916 | } |
4903 | 4917 | |
4904 | | # Create macports user directory if it does not exist yet |
4905 | | if {$use_readline && ![file isdirectory $macports::macports_user_dir]} { |
4906 | | file mkdir $macports::macports_user_dir |
4907 | | } |
4908 | | # Save readine history |
4909 | | if {$use_readline && [file isdirectory $macports::macports_user_dir]} { |
4910 | | rl_history write $history_file |
4911 | | } |
4912 | | |
4913 | 4918 | # Say goodbye |
4914 | 4919 | if { $noisy } { |
4915 | 4920 | puts "Goodbye" |