aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-02-28 11:14:00 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-02-28 11:14:00 +0200
commit073136f295468f4e2faeb89ad5a9ddb3cbe0ec34 (patch)
tree02a2406f834eb5ca3da0e51f78388257fbe4e28c
parent6a36e90424b0ed486bb8139c0305f68d924cf290 (diff)
downloaddico-073136f295468f4e2faeb89ad5a9ddb3cbe0ec34.tar.gz
dico-073136f295468f4e2faeb89ad5a9ddb3cbe0ec34.tar.bz2
Minor changes
* README: Update. * examples/numerals-cz.txt: Change initial comment. * examples/numerals-pl.ldb: Likewise. * scripts/gcider: Handle broken pipe and partial reads graciously.
-rw-r--r--README13
-rw-r--r--examples/numerals-cz.txt2
-rw-r--r--examples/numerals-pl.ldb1
-rwxr-xr-xscripts/gcider46
4 files changed, 52 insertions, 10 deletions
diff --git a/README b/README
index 33f51f7..8a3ffe4 100644
--- a/README
+++ b/README
@@ -7,11 +7,11 @@ Copyright (C) 2008-2010, 2012 Sergey Poznyakoff
This file contains brief information about configuring, testing
and running GNU Dico. It is *not* intended as a replacement
for the documentation, but is provided as a brief reference only.
-The (almost) complete documentation for Dico is available in
-doc/ subdirectory. To read it without installing the package
-run `info -f doc/dico.info'. After the package is installed
-the documentation can be accessed running `info Dico'. Invoking
-`info dico' and `info dicod' (with a lower-case `d') will show you a
+The complete documentation for Dico is available in doc/
+subdirectory. To read it without installing the package run
+`info -f doc/dico.info'. After the package is installed the
+documentation can be accessed running `info Dico'. Invoking
+`info dico' and `info dicod' (with a lower-case `d') will show you a
concise description of the command line syntax (similar to a man-page
style) of `dico' and `dicod' programs, correspondingly.
@@ -28,8 +28,7 @@ searches are performed by functions supplied in loadable modules. A
single module can handle any number of database instances.
The package includes several modules for searching in different
-dictionary databases, among them a module for dict.org databases and a
-module for databases in Emacs "outline" format.
+dictionary databases, such as dict.org, WordNet and others.
The server can be configured to handle both anonymous and authorized
access. It supports a wide variety of authentication algorithms.
diff --git a/examples/numerals-cz.txt b/examples/numerals-cz.txt
index 6d2202b..56e001f 100644
--- a/examples/numerals-cz.txt
+++ b/examples/numerals-cz.txt
@@ -1,3 +1,5 @@
+-- To handle this file use textdict.py from this directory.
+-- Format:
-- Comments begin with double-dash.
-- Empty lines are ignored.
-- There may be at most one `descr:' entry.
diff --git a/examples/numerals-pl.ldb b/examples/numerals-pl.ldb
index 91140a8..9047699 100644
--- a/examples/numerals-pl.ldb
+++ b/examples/numerals-pl.ldb
@@ -1,4 +1,5 @@
;; -*- scheme -*-
+;; To handle this file use the listdict.scm module.
(; Short info (for show db):
"Short English-Polish numerals dictionary"
; Complete info (for show info):
diff --git a/scripts/gcider b/scripts/gcider
index 92c5cc5..a969cb8 100755
--- a/scripts/gcider
+++ b/scripts/gcider
@@ -1356,7 +1356,9 @@ proc dict_trace {args} {
proc dictread {} {
global pipe
- set reply [gets $pipe]
+ if {[gets $pipe reply] == -1} {
+ error "unexpected eof while reading server reply" "gets" "BROKENPIPE"
+ }
dict_trace RECV "$reply"
return $reply
}
@@ -1424,8 +1426,32 @@ proc readdefns {} {
return 0
}
+proc docmd {cmd word} {
+ global pipe
+
+ set res [catch { $cmd $word } result opt]
+# puts "RES $res"
+ if {$res == 1} {
+ if {[dict get $opt -errorcode] == "BROKENPIPE"} {
+ set answer [tk_messageBox -title "I/O error" \
+ -icon error -type retrycancel \
+ -message "The dictionary server has gone away\nPress Retry to reconnect or Cancel to exit"]
+ if {$answer == "retry"} {
+ catch { close $pipe }
+ dict_connect gcider_error_reconf
+ return 1
+ } else {
+ exit 1
+ }
+ } else {
+ terror $result $opt [dict get $opt -errorinfo]
+ }
+ }
+ return 0
+}
+
# Define $word
-proc defineword {word} {
+proc defineword_lazy {word} {
global dbname
global input
global status
@@ -1495,6 +1521,12 @@ proc defineword {word} {
.c.article configure -state disabled
}
+proc defineword {word} {
+ if {[docmd defineword_lazy $word] == 1} {
+ .c.article delete 1.0 end
+ }
+}
+
# The "Define" button command
proc define {} {
global input
@@ -1550,7 +1582,7 @@ proc defineprev {} {
# Produce a list of matches of $headword using the currently selected
# strategy and fill the match widget with them.
-proc matchword {headword} {
+proc matchword_lazy {headword} {
global dbname
global strategy
global stratname
@@ -1593,6 +1625,14 @@ proc matchword {headword} {
}
}
+proc matchword {word} {
+ if {[docmd matchreedword_lazy $word] == 1} {
+ .c.matches configure -state normal
+ .c.matches delete 0 end
+ .c.matches configure -state disabled
+ }
+}
+
# The "Match" button handler
proc match {} {
global input

Return to:

Send suggestions and report system problems to the System administrator.