Skip to content

Commit

Permalink
Merging devel to master (#3)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
snoe925 authored Feb 20, 2018
1 parent 8592eeb commit 9bf94fc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: c

sudo: true

os:
- linux
- osx

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install tcl-tk; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --force --overwrite tcl-tk; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install readline; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y tcl8.6-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y lib64readline6-dev; fi

script:
- autoreconf -vi
- 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
- make
- sudo make install
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ AC_ARG_WITH(tcl-includes,

AC_MSG_CHECKING([where to look for tcl.h])
TCL_INCLUDE_DIR=""
for dir in $tcl_includes $prefix/include/ /usr/include; do
for dir in $tcl_includes $prefix/include/ ${TCL_INCLUDE_SPEC#-I} /usr/include; do
if test -r $dir/tcl.h; then
TCL_INCLUDE_DIR=$dir
break
Expand Down
4 changes: 4 additions & 0 deletions sample.tclshrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ if {$tcl_interactive} {
#
# ::tclreadline::readline customcompleter ""

# automatically save the history after every
# command (instead of when cleanly exiting)
set tclreadline::autosave 1

# go to tclrealdine's main loop.
#
tclreadline::Loop
Expand Down
6 changes: 6 additions & 0 deletions tclreadlineSetup.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ namespace eval tclreadline {
if {[string length $::tclreadline::LINE]
&& [history event 0] != $::tclreadline::LINE} {
history add $::tclreadline::LINE
if {[info exists ::tclreadline::autosave] && \
[string is true -strict $::tclreadline::autosave] && \
[catch {::tclreadline::readline write [::tclreadline::HistoryFileGet]} \
::tclreadline::errorMsg]} {
puts stderr $::tclreadline::errorMsg
}
}

if {[catch {
Expand Down

0 comments on commit 9bf94fc

Please sign in to comment.