In case of parsing error do not display IPA headline.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 11 Dec 2016 02:12:46 +0200
changeset 711 d6040290ee78
parent 710 59bfd8195afa
child 712 f543ce84794f
In case of parsing error do not display IPA headline.
contrib/gadict.el
--- a/contrib/gadict.el	Sun Dec 11 02:02:27 2016 +0200
+++ b/contrib/gadict.el	Sun Dec 11 02:12:46 2016 +0200
@@ -282,6 +282,7 @@
 
 (defvar gadict-espeak-program "espeak")
 (defvar gadict-espeak-program-ipa-args "-q --ipa=2")
+;; "en" "en-gb" "en-us" "en-sc"
 (defvar gadict-espeak-voices-list '("en-gb" "en-us")
   "What voices to show. Look to 'espeak --voices' for full list.")
 
@@ -309,7 +310,7 @@
 
 (defun gadict-espeak-ipa-display ()
   (when (eq major-mode 'gadict-mode)
-    (let ( (headword (gadict-nearest-headword)) )
+    (let ( (headword (condition-case nil (gadict-nearest-headword) (error nil))) )
       (unless (eq headword gadict-espeak-ipa-headword)
         (setq gadict-espeak-ipa-headword headword)
         (setq header-line-format (if headword (gadict-espeak-ipa-line headword) nil))