aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Hilbrich <torsten.hilbrich@gmx.net>2011-08-27 21:08:49 +0200
committerTorsten Hilbrich <torsten.hilbrich@gmx.net>2011-08-27 21:08:49 +0200
commit7fe2dbbfd6e2a73ea082e739a7729cd9c24aad91 (patch)
tree3c55720992c4c2e4ed1cd60f6a4b4e7f11bbb162
parent0e744319215aaf1c03f7d88819d5ebdd79b1a57f (diff)
Use read-string with default value
The use of initial value is deprecated and less user-friendly. Fix taken from Debian package.
-rwxr-xr-xdictionary.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/dictionary.el b/dictionary.el
index 72e633d..fb0c2e1 100755
--- a/dictionary.el
+++ b/dictionary.el
@@ -1045,9 +1045,16 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
"Search the `word' in `dictionary' if given or in all if nil.
It presents the word at point as default input and allows editing it."
(interactive
- (list (read-string "Search word: " (current-word))
+ (list (let ((default (current-word t)))
+ (read-string (if default
+ (format "Search word (%s): " default)
+ "Search word: ")
+ nil nil default))
(if current-prefix-arg
- (read-string "Dictionary: " dictionary-default-dictionary)
+ (read-string (if dictionary-default-dictionary
+ (format "Dictionary (%s): " dictionary-default-dictionary)
+ "Dictionary: ")
+ nil nil dictionary-default-dictionary)
dictionary-default-dictionary)))
;; if called by pressing the button