aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacsrc11
-rw-r--r--elisp/ellinika-dict-mode.el36
2 files changed, 45 insertions, 2 deletions
diff --git a/.emacsrc b/.emacsrc
index b00e63c..8428a3b 100644
--- a/.emacsrc
+++ b/.emacsrc
@@ -13,4 +13,15 @@
(load-file "elisp/ellinika-dict-mode.el")
+(setq ispell-program-name "aspell")
+(setq ispell-extra-args (list "--encoding=utf-8"))
+
+(require 'ispell)
+(setq ispell-dictionary-alist
+ (append '(("russian" "" "" "" nil ("-d" "russian") nil utf-8)
+ ("greek" "" "" "[---]" nil ("-B" "-d" "el") "~tex" utf-8))
+ ispell-dictionary-alist))
+
+
(setq w3-default-homepage "http://localhost/cgi-bin/dict.cgi")
+
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.