changeset 48622:759019dacc3f

(ispell-dict-map): Move specific dictionary selection into a submenu.
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 Dec 2002 16:20:36 +0000
parents 2cf7301b2f52
children 4347ee7b708a
files lisp/textmodes/ispell.el
diffstat 1 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/ispell.el	Mon Dec 02 16:19:52 2002 +0000
+++ b/lisp/textmodes/ispell.el	Mon Dec 02 16:20:36 2002 +0000
@@ -837,26 +837,33 @@
 (if ispell-menu-map-needed
     (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
 	  (dir (if (boundp 'ispell-library-directory) ispell-library-directory))
+	  (dict-map (make-sparse-keymap "Dictionaries"))
 	  name load-dict)
       (setq ispell-menu-map (make-sparse-keymap "Spell"))
       ;; add the dictionaries to the bottom of the list.
-      (while dicts
-	(setq name (car (car dicts))
-	      load-dict (car (cdr (member "-d" (nth 5 (car dicts)))))
-	      dicts (cdr dicts))
-	(cond ((not (stringp name))
-	       (define-key ispell-menu-map [default]
-		 '("Select Default Dict"
-		   "Dictionary for which Ispell was configured"
-		   . (lambda () (interactive)
-		       (ispell-change-dictionary "default")))))
+      (dolist (dict dicts)
+	(setq name (car dict)
+	      load-dict (car (cdr (member "-d" (nth 5 dict)))))
+	(unless (stringp name)
+	  (define-key ispell-menu-map [default]
+	    '("Select Default Dict"
+	      "Dictionary for which Ispell was configured"
+	      . (lambda () (interactive)
+		  (ispell-change-dictionary "default"))))))
+      (fset 'ispell-dict-map dict-map)
+      (define-key ispell-menu-map [dictionaries]
+	`(menu-item "Select Dict" ispell-dict-map))
+      (dolist (dict dicts)
+	(setq name (car dict)
+	      load-dict (car (cdr (member "-d" (nth 5 dict)))))
+	(cond ((not (stringp name)))
 	      ((or (not dir)		; load all if library dir not defined
 		   (file-exists-p (concat dir "/" name ".hash"))
 		   (file-exists-p (concat dir "/" name ".has"))
 		   (and load-dict
 			(or (file-exists-p (concat dir "/" load-dict ".hash"))
 			    (file-exists-p (concat dir "/" load-dict ".has")))))
-	       (define-key ispell-menu-map (vector (intern name))
+	       (define-key dict-map (vector (intern name))
 		 (cons (concat "Select " (capitalize name) " Dict")
 		       `(lambda () (interactive)
 			  (ispell-change-dictionary ,name)))))))))