aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/textmodes/ispell.el16
1 files changed, 3 insertions, 13 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index e67e603e990..87a3b7aaa12 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1485,25 +1485,15 @@ used as key in `ispell-local-dictionary-alist' and `ispell-dictionary-alist'.")
1485 "The name of the current personal dictionary, or nil for the default. 1485 "The name of the current personal dictionary, or nil for the default.
1486This is passed to the Ispell process using the `-p' switch.") 1486This is passed to the Ispell process using the `-p' switch.")
1487 1487
1488(defun ispell-decode-string (str)
1489 "Decodes multibyte character strings."
1490 (decode-coding-string str (ispell-get-coding-system)))
1491
1492;; Return a string decoded from Nth element of the current dictionary. 1488;; Return a string decoded from Nth element of the current dictionary.
1493(defun ispell-get-decoded-string (n) 1489(defun ispell-get-decoded-string (n)
1494 "Get the decoded string in slot N of the descriptor of the current dict." 1490 "Get the decoded string in slot N of the descriptor of the current dict."
1495 (let* ((slot (or 1491 (let* ((slot (or
1496 (assoc ispell-current-dictionary ispell-local-dictionary-alist) 1492 (assoc ispell-current-dictionary ispell-local-dictionary-alist)
1497 (assoc ispell-current-dictionary ispell-dictionary-alist) 1493 (assoc ispell-current-dictionary ispell-dictionary-alist)
1498 (error "No data for dictionary \"%s\", neither in `ispell-local-dictionary-alist' nor in `ispell-dictionary-alist'" 1494 (error "No data for dictionary \"%s\" in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'"
1499 ispell-current-dictionary))) 1495 ispell-current-dictionary))))
1500 (str (nth n slot))) 1496 (decode-coding-string (nth n slot) (ispell-get-coding-system) t)))
1501 (when (and (> (length str) 0)
1502 (not (multibyte-string-p str)))
1503 (setq str (ispell-decode-string str))
1504 (or (multibyte-string-p str)
1505 (setq str (string-to-multibyte str))))
1506 str))
1507 1497
1508(defun ispell-get-casechars () 1498(defun ispell-get-casechars ()
1509 (ispell-get-decoded-string 1)) 1499 (ispell-get-decoded-string 1))