aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-14 20:54:44 +0000
committerRichard M. Stallman1994-06-14 20:54:44 +0000
commit12e53d2e65f1a042a5f9ae4c5e7e5d532ddbb2ca (patch)
tree75bab2a2c3589dbde333b8826f54338cf6d9993d /lisp/textmodes
parentd6a9be454aa51164791c1bab85f531c24887aeb9 (diff)
downloademacs-12e53d2e65f1a042a5f9ae4c5e7e5d532ddbb2ca.tar.gz
emacs-12e53d2e65f1a042a5f9ae4c5e7e5d532ddbb2ca.zip
(ispell-command-loop): C-g should be like X, not q.
(ispell-dictionary-alist): Add autoload. Split into two subvariables. (ispell-menu-map): Defvar and set up at top level. Split into parts. (ispell-menu-map-needed): New variable.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/ispell.el130
1 files changed, 74 insertions, 56 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 15e8070f040..68acd165bdc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -6,9 +6,6 @@
6;;; 6;;;
7;;; 7;;;
8;;; Authors : Ken Stevens et. al. 8;;; Authors : Ken Stevens et. al.
9;;; Last Modified By: Ken Stevens <k.stevens@ieee.org>
10;;; Last Modified On: Fri May 20 15:58:52 MDT 1994
11;;; Update Revision : 2.30
12;;; Syntax : emacs-lisp 9;;; Syntax : emacs-lisp
13;;; Status : Release with 3.1.05 ispell. 10;;; Status : Release with 3.1.05 ispell.
14;;; Version : International Ispell Version 3.1 by Geoff Kuenning. 11;;; Version : International Ispell Version 3.1 by Geoff Kuenning.
@@ -408,7 +405,8 @@ For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character
408words as correct. See also `ispell-dictionary-alist', which may be used 405words as correct. See also `ispell-dictionary-alist', which may be used
409for language-specific arguments.") 406for language-specific arguments.")
410 407
411(defvar ispell-dictionary-alist ; sk 9-Aug-1991 18:28 408;;;###autoload
409(defvar ispell-dictionary-alist-1 ; sk 9-Aug-1991 18:28
412 '((nil ; default (english.aff) 410 '((nil ; default (english.aff)
413 "[A-Za-z]" "[^A-Za-z]" "[---']" nil ("-B") nil) 411 "[A-Za-z]" "[^A-Za-z]" "[---']" nil ("-B") nil)
414 ("english" ; make english explicitly selectable 412 ("english" ; make english explicitly selectable
@@ -422,8 +420,11 @@ for language-specific arguments.")
422 ("nederlands8" ; dutch8.aff 420 ("nederlands8" ; dutch8.aff
423 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 421 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
424 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 422 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
425 "[---']" t ("-C") nil) 423 "[---']" t ("-C") nil)))
426 ("svenska" ;7 bit swedish mode 424
425;;;###autoload
426(defvar ispell-dictionary-alist-2
427 '(("svenska" ;7 bit swedish mode
427 "[A-Za-z}{|\\133\\135\\\\]" "[^A-Za-z}{|\\133\\135\\\\]" 428 "[A-Za-z}{|\\133\\135\\\\]" "[^A-Za-z}{|\\133\\135\\\\]"
428 "[---']" nil ("-C") nil) 429 "[---']" nil ("-C") nil)
429 ("svenska8" ;8 bit swedish mode 430 ("svenska8" ;8 bit swedish mode
@@ -437,7 +438,13 @@ for language-specific arguments.")
437 ("dansk" ; dansk.aff 438 ("dansk" ; dansk.aff
438 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" 439 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
439 "[---]" nil ("-C") nil) 440 "[---]" nil ("-C") nil)
440 ) 441 ))
442
443;; ispell-dictionary-alist is set up from two subvariables above
444;; to avoid having very long lines in loaddefs.el.
445;;;###autoload
446(defvar ispell-dictionary-alist
447 (append ispell-dictionary-alist-1 ispell-dictionary-alist-2)
441 "An alist of dictionaries and their associated parameters. 448 "An alist of dictionaries and their associated parameters.
442 449
443Each element of this list is also a list: 450Each element of this list is also a list:
@@ -479,7 +486,64 @@ Note that the CASECHARS and OTHERCHARS slots of the alist should
479contain the same character set as casechars and otherchars in the 486contain the same character set as casechars and otherchars in the
480language.aff file \(e.g., english.aff\).") 487language.aff file \(e.g., english.aff\).")
481 488
489;;;###autoload
490(defvar ispell-menu-map nil)
482 491
492;;; Set up the map.
493;;;###autoload
494(defconst ispell-menu-map-needed
495 ;; Verify this is not Lucid Emacs.
496 (and (not ispell-menu-map) (boundp 'system-key-alist)))
497
498;;;###autoload
499(if ispell-menu-map-needed
500 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
501 name)
502 ;; Can put in defvar when external defines are removed.
503 (setq ispell-menu-map (make-sparse-keymap "Spell"))
504 (while dicts
505 (setq name (car (car dicts))
506 dicts (cdr dicts))
507 (if (stringp name)
508 (define-key ispell-menu-map (vector (intern name))
509 (cons (concat "Select " (capitalize name))
510 (list 'lambda () '(interactive)
511 (list 'ispell-change-dictionary name))))))))
512
513;;;###autoload
514(if ispell-menu-map-needed
515 (progn
516 ;; Define commands in opposite order you want them to appear in menu.
517 (define-key ispell-menu-map [ispell-change-dictionary]
518 '("Change Dictionary" . ispell-change-dictionary))
519 (define-key ispell-menu-map [ispell-kill-ispell]
520 '("Kill Process" . ispell-kill-ispell))
521 (define-key ispell-menu-map [ispell-pdict-save]
522 '("Save Dictionary" . (lambda () (interactive) (ispell-pdict-save t))))
523 (define-key ispell-menu-map [ispell-complete-word]
524 '("Complete Word" . ispell-complete-word))
525 (define-key ispell-menu-map [ispell-complete-word-interior-frag]
526 '("Complete Word Frag" . ispell-complete-word-interior-frag))))
527
528;;;###autoload
529(if ispell-menu-map-needed
530 (progn
531 (define-key ispell-menu-map [ispell-continue]
532 '("Continue Check" . ispell-continue))
533 (define-key ispell-menu-map [ispell-region]
534 '("Check Region" . ispell-region))
535 (define-key ispell-menu-map [ispell-word]
536 '("Check Word" . ispell-word))
537 (define-key ispell-menu-map [ispell-buffer]
538 '("Check Buffer" . ispell-buffer))
539 (define-key ispell-menu-map [ispell-message]
540 '("Check Message" . ispell-message))
541 (define-key ispell-menu-map [ispell-help]
542 '("Help" . (lambda () (interactive) (describe-function 'ispell-help))))
543 (put 'ispell-region 'menu-enable 'mark-active)))
544
545;;;###autoload
546(fset 'ispell-menu-map (symbol-value 'ispell-menu-map))
483 547
484(cond 548(cond
485 ((and (string-lessp "19" emacs-version) 549 ((and (string-lessp "19" emacs-version)
@@ -514,53 +578,7 @@ language.aff file \(e.g., english.aff\).")
514 (if current-menubar 578 (if current-menubar
515 (progn 579 (progn
516 (delete-menu-item '("Edit" "Spell")) ; in case already defined 580 (delete-menu-item '("Edit" "Spell")) ; in case already defined
517 (add-menu '("Edit") "Spell" ispell-menu-lucid))))) 581 (add-menu '("Edit") "Spell" ispell-menu-lucid))))))
518
519 ;; cond-case:
520 ((and (featurep 'menu-bar)
521 (string-lessp "19" emacs-version))
522 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
523 name)
524 (defvar ispell-menu-map nil)
525 ;; Can put in defvar when external defines are removed.
526 (setq ispell-menu-map (make-sparse-keymap "Spell"))
527 (while dicts
528 (setq name (car (car dicts))
529 dicts (cdr dicts))
530 (if (stringp name)
531 (define-key ispell-menu-map (vector (intern name))
532 (cons (concat "Select " (capitalize name))
533 (list 'lambda () '(interactive)
534 (list 'ispell-change-dictionary name))))))
535 ;; Why do we need an alias here?
536 (defalias 'ispell-menu-map ispell-menu-map)
537 ;; Define commands in opposite order you want them to appear in menu.
538 (define-key ispell-menu-map [ispell-change-dictionary]
539 '("Change Dictionary" . ispell-change-dictionary))
540 (define-key ispell-menu-map [ispell-kill-ispell]
541 '("Kill Process" . ispell-kill-ispell))
542 (define-key ispell-menu-map [ispell-pdict-save]
543 '("Save Dictionary" . (lambda () (interactive) (ispell-pdict-save t))))
544 (define-key ispell-menu-map [ispell-complete-word]
545 '("Complete Word" . ispell-complete-word))
546 (define-key ispell-menu-map [ispell-complete-word-interior-frag]
547 '("Complete Word Frag" . ispell-complete-word-interior-frag))
548 (define-key ispell-menu-map [ispell-continue]
549 '("Continue Check" . ispell-continue))
550 (define-key ispell-menu-map [ispell-region]
551 '("Check Region" . ispell-region))
552 (define-key ispell-menu-map [ispell-word]
553 '("Check Word" . ispell-word))
554 (define-key ispell-menu-map [ispell-buffer]
555 '("Check Buffer" . ispell-buffer))
556 (define-key ispell-menu-map [ispell-message]
557 '("Check Message" . ispell-message))
558 (define-key ispell-menu-map [ispell-help]
559 '("Help" . (lambda () (interactive)
560 (describe-function 'ispell-help)
561 ;(x-popup-menu last-nonmenu-event(list "" ispell-help-list))
562 ))))
563 (put 'ispell-region 'menu-enable 'mark-active)))
564 582
565 583
566;;; ********************************************************************** 584;;; **********************************************************************
@@ -957,8 +975,8 @@ used."
957 (read-char-exclusive) 975 (read-char-exclusive)
958 (read-char)) 976 (read-char))
959 skipped 0) 977 skipped 0)
960 (if (or quit-flag (= char ?\C-g)) ; C-g is like typing q 978 (if (or quit-flag (= char ?\C-g)) ; C-g is like typing X
961 (setq char ?q 979 (setq char ?X
962 quit-flag nil))) 980 quit-flag nil)))
963 ;; Adjust num to array offset skipping command characters. 981 ;; Adjust num to array offset skipping command characters.
964 (let ((com-chars command-characters)) 982 (let ((com-chars command-characters))