Skip to content

Commit 9bf94fc

Browse files
authored
Merging devel to master (#3)
* Create .travis.yml * Add development dependencies * Remove enable-maintainer-mode * Fix include path detection Use the TCL_INCLUDE_SPEC variable from tclConfig.sh to find tcl.h * Save after every history addition. (#2) * Save after every history addition. * Make autosave optional and off by default. * Document autosave in the sample tclshrc * Be nicer to the end user and accept anything boolean looking for autosave
1 parent 8592eeb commit 9bf94fc

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: c
2+
3+
sudo: true
4+
5+
os:
6+
- linux
7+
- osx
8+
9+
before_install:
10+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
11+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install tcl-tk; fi
12+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --force --overwrite tcl-tk; fi
13+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install readline; fi
14+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y tcl8.6-dev; fi
15+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y lib64readline6-dev; fi
16+
17+
script:
18+
- autoreconf -vi
19+
- if [ -f /usr/local/lib/tclConfig.sh ]; then ./configure --with-readline-includes=/usr/local/Cellar/readline/7.0.3_1/include --with-readline-library=/usr/local/Cellar/readline/7.0.3_1/lib --with-tcl=/usr/local/lib; else ./configure; fi
20+
- make
21+
- sudo make install

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ AC_ARG_WITH(tcl-includes,
107107

108108
AC_MSG_CHECKING([where to look for tcl.h])
109109
TCL_INCLUDE_DIR=""
110-
for dir in $tcl_includes $prefix/include/ /usr/include; do
110+
for dir in $tcl_includes $prefix/include/ ${TCL_INCLUDE_SPEC#-I} /usr/include; do
111111
if test -r $dir/tcl.h; then
112112
TCL_INCLUDE_DIR=$dir
113113
break

sample.tclshrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ if {$tcl_interactive} {
5858
#
5959
# ::tclreadline::readline customcompleter ""
6060

61+
# automatically save the history after every
62+
# command (instead of when cleanly exiting)
63+
set tclreadline::autosave 1
64+
6165
# go to tclrealdine's main loop.
6266
#
6367
tclreadline::Loop

tclreadlineSetup.tcl.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ namespace eval tclreadline {
289289
if {[string length $::tclreadline::LINE]
290290
&& [history event 0] != $::tclreadline::LINE} {
291291
history add $::tclreadline::LINE
292+
if {[info exists ::tclreadline::autosave] && \
293+
[string is true -strict $::tclreadline::autosave] && \
294+
[catch {::tclreadline::readline write [::tclreadline::HistoryFileGet]} \
295+
::tclreadline::errorMsg]} {
296+
puts stderr $::tclreadline::errorMsg
297+
}
292298
}
293299

294300
if {[catch {

0 commit comments

Comments
 (0)