aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2002-12-02 16:20:36 +0000
committerRichard M. Stallman2002-12-02 16:20:36 +0000
commitec17ee786413224c97788a2fb8b23e89d524082b (patch)
treefaa222041690b0168d2f48a7e97e22004e9a2a18 /lisp
parentf601aaf8f8a8d8a1a6899e526a5b4814c4e70335 (diff)
downloademacs-ec17ee786413224c97788a2fb8b23e89d524082b.tar.gz
emacs-ec17ee786413224c97788a2fb8b23e89d524082b.zip
(ispell-dict-map): Move specific dictionary selection into a submenu.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/ispell.el29
1 files changed, 18 insertions, 11 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c7a8ac9fc4e..9efe8c9ee33 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -837,26 +837,33 @@ and added as a submenu of the \"Edit\" menu.")
837(if ispell-menu-map-needed 837(if ispell-menu-map-needed
838 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist))) 838 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
839 (dir (if (boundp 'ispell-library-directory) ispell-library-directory)) 839 (dir (if (boundp 'ispell-library-directory) ispell-library-directory))
840 (dict-map (make-sparse-keymap "Dictionaries"))
840 name load-dict) 841 name load-dict)
841 (setq ispell-menu-map (make-sparse-keymap "Spell")) 842 (setq ispell-menu-map (make-sparse-keymap "Spell"))
842 ;; add the dictionaries to the bottom of the list. 843 ;; add the dictionaries to the bottom of the list.
843 (while dicts 844 (dolist (dict dicts)
844 (setq name (car (car dicts)) 845 (setq name (car dict)
845 load-dict (car (cdr (member "-d" (nth 5 (car dicts))))) 846 load-dict (car (cdr (member "-d" (nth 5 dict)))))
846 dicts (cdr dicts)) 847 (unless (stringp name)
847 (cond ((not (stringp name)) 848 (define-key ispell-menu-map [default]
848 (define-key ispell-menu-map [default] 849 '("Select Default Dict"
849 '("Select Default Dict" 850 "Dictionary for which Ispell was configured"
850 "Dictionary for which Ispell was configured" 851 . (lambda () (interactive)
851 . (lambda () (interactive) 852 (ispell-change-dictionary "default"))))))
852 (ispell-change-dictionary "default"))))) 853 (fset 'ispell-dict-map dict-map)
854 (define-key ispell-menu-map [dictionaries]
855 `(menu-item "Select Dict" ispell-dict-map))
856 (dolist (dict dicts)
857 (setq name (car dict)
858 load-dict (car (cdr (member "-d" (nth 5 dict)))))
859 (cond ((not (stringp name)))
853 ((or (not dir) ; load all if library dir not defined 860 ((or (not dir) ; load all if library dir not defined
854 (file-exists-p (concat dir "/" name ".hash")) 861 (file-exists-p (concat dir "/" name ".hash"))
855 (file-exists-p (concat dir "/" name ".has")) 862 (file-exists-p (concat dir "/" name ".has"))
856 (and load-dict 863 (and load-dict
857 (or (file-exists-p (concat dir "/" load-dict ".hash")) 864 (or (file-exists-p (concat dir "/" load-dict ".hash"))
858 (file-exists-p (concat dir "/" load-dict ".has"))))) 865 (file-exists-p (concat dir "/" load-dict ".has")))))
859 (define-key ispell-menu-map (vector (intern name)) 866 (define-key dict-map (vector (intern name))
860 (cons (concat "Select " (capitalize name) " Dict") 867 (cons (concat "Select " (capitalize name) " Dict")
861 `(lambda () (interactive) 868 `(lambda () (interactive)
862 (ispell-change-dictionary ,name))))))))) 869 (ispell-change-dictionary ,name)))))))))