aboutsummaryrefslogtreecommitdiff
path: root/elisp/ellinika-dict-mode.el
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-10-15 13:43:31 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-10-15 13:43:31 +0000
commita3c48b7d015bb5900acc2c1a2ec9d9c176ea983b (patch)
treeeebfb969593b415ba1c057f20ec773891f029af2 /elisp/ellinika-dict-mode.el
parent368a37d640f2430df6c78e512dfa84d2911069b5 (diff)
downloadellinika-a3c48b7d015bb5900acc2c1a2ec9d9c176ea983b.tar.gz
ellinika-a3c48b7d015bb5900acc2c1a2ec9d9c176ea983b.tar.bz2
Set up for spell checking
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@247 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'elisp/ellinika-dict-mode.el')
-rw-r--r--elisp/ellinika-dict-mode.el36
1 files changed, 34 insertions, 2 deletions
diff --git a/elisp/ellinika-dict-mode.el b/elisp/ellinika-dict-mode.el
index f7fb043..ae851d9 100644
--- a/elisp/ellinika-dict-mode.el
+++ b/elisp/ellinika-dict-mode.el
@@ -251,6 +251,35 @@
(backward-char 4)
(inactivate-input-method))
+(defcustom alternative-input-method nil
+ "Defines input-method for non-greek text in this buffer.")
+
+(defcustom alternative-dictionary nil
+ "Defines alternative (non-greek) spell-checking dictionary for this buffer.")
+
+(defun ellinika-run-ispell (dict)
+ (let ((ispell-skip-html t)
+ (ispell-local-dictionary dict))
+ (ispell)))
+
+(defun ellinika-ispell-greek (arg)
+ (interactive "p")
+ (ellinika-run-ispell "greek"))
+
+(defun ellinika-ispell-alt (arg)
+ (interactive "p")
+ (ellinika-run-ispell (if alternative-dictionary
+ alternative-dictionary
+ (error "Alternative dictionary not defined"))))
+
+(defun ellinika-ispell (arg)
+ (interactive "p")
+ (ellinika-run-ispell (if (> arg 0)
+ "greek"
+ (if alternative-dictionary
+ alternative-dictionary
+ (error "Alternative dictionary not defined")))))
+
;;;###autoload
(define-derived-mode ellinika-dict-mode sgml-mode "Ellinika-Dict"
"Major mode for editing Ellinika dictionary sources.
@@ -259,7 +288,8 @@
\\{ellinika-dict-mode-map}"
(make-variable-buffer-local 'alternative-input-method)
-
+ (make-variable-buffer-local 'alternative-dictionary)
+
(define-key ellinika-dict-mode-map "\C-c\C-b" 'ellinika-begin-node)
(define-key ellinika-dict-mode-map "\C-c\C-m" 'ellinika-begin-article)
(define-key ellinika-dict-mode-map "\C-c\C-k" 'ellinika-begin-key)
@@ -271,7 +301,9 @@
(define-key ellinika-dict-mode-map "\C-c\C-c" 'ellinika-begin-comment)
(define-key ellinika-dict-mode-map "\C-c\C-e" 'ellinika-begin-expl)
(define-key ellinika-dict-mode-map "\C-c\C-i" 'ellinika-insert-include)
-
+ (define-key ellinika-dict-mode-map "\C-c\C-g" 'ellinika-ispell-greek)
+ (define-key ellinika-dict-mode-map "\C-c\C-s" 'ellinika-ispell-alt)
+
(define-key ellinika-dict-mode-map "\M-g" 'greek-input)
(define-key ellinika-dict-mode-map "\M-r" 'alt-input)
(define-key ellinika-dict-mode-map "\C-c>" 'ellinika-close-tag)

Return to:

Send suggestions and report system problems to the System administrator.