diff options
Diffstat (limited to 'lisp/textmodes/ispell.el')
| -rw-r--r-- | lisp/textmodes/ispell.el | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 1de27265b08..afdfc951b96 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -796,19 +796,16 @@ Otherwise returns the library directory name, if that is defined." | |||
| 796 | nil t) | 796 | nil t) |
| 797 | case-fold-search case-fold-search-val) | 797 | case-fold-search case-fold-search-val) |
| 798 | (if (or (not status) ; major version mismatch | 798 | (if (or (not status) ; major version mismatch |
| 799 | (< (car (read-from-string (buffer-substring-no-properties | 799 | (< (car (read-from-string (match-string-no-properties 2))) |
| 800 | (match-beginning 2) (match-end 2)))) | ||
| 801 | (car (cdr ispell-required-version)))) ; minor version mismatch | 800 | (car (cdr ispell-required-version)))) ; minor version mismatch |
| 802 | (error "%s version 3 release %d.%d.%d or greater is required" | 801 | (error "%s version 3 release %d.%d.%d or greater is required" |
| 803 | ispell-program-name (car ispell-required-version) | 802 | ispell-program-name (car ispell-required-version) |
| 804 | (car (cdr ispell-required-version)) | 803 | (car (cdr ispell-required-version)) |
| 805 | (car (cdr (cdr ispell-required-version)))) | 804 | (car (cdr (cdr ispell-required-version)))) |
| 806 | ;; check that it is the correct version. | 805 | ;; check that it is the correct version. |
| 807 | (if (and (= (car (read-from-string (buffer-substring-no-properties | 806 | (if (and (= (car (read-from-string (match-string-no-properties 2))) |
| 808 | (match-beginning 2)(match-end 2)))) | ||
| 809 | (car (cdr ispell-required-version))) | 807 | (car (cdr ispell-required-version))) |
| 810 | (< (car (read-from-string (buffer-substring-no-properties | 808 | (< (car (read-from-string (match-string-no-properties 3))) |
| 811 | (match-beginning 3)(match-end 3)))) | ||
| 812 | (car (cdr (cdr ispell-required-version))))) | 809 | (car (cdr (cdr ispell-required-version))))) |
| 813 | (setq ispell-offset 0)) | 810 | (setq ispell-offset 0)) |
| 814 | ;; Check to see if it's really aspell. | 811 | ;; Check to see if it's really aspell. |
| @@ -945,7 +942,7 @@ The variable `ispell-library-directory' defines the library location." | |||
| 945 | '(menu-item "Automatic spell checking (Flyspell)" | 942 | '(menu-item "Automatic spell checking (Flyspell)" |
| 946 | flyspell-mode | 943 | flyspell-mode |
| 947 | :help "Check spelling while you edit the text" | 944 | :help "Check spelling while you edit the text" |
| 948 | :button (:toggle . flyspell-mode))) | 945 | :button (:toggle . (bound-and-true-p flyspell-mode)))) |
| 949 | (define-key ispell-menu-map [ispell-complete-word] | 946 | (define-key ispell-menu-map [ispell-complete-word] |
| 950 | '(menu-item "Complete Word" ispell-complete-word | 947 | '(menu-item "Complete Word" ispell-complete-word |
| 951 | :help "Complete word at cursor using dictionary")) | 948 | :help "Complete word at cursor using dictionary")) |
| @@ -2567,9 +2564,7 @@ Return nil if spell session is quit, | |||
| 2567 | (ispell-begin-skip-region-regexp) | 2564 | (ispell-begin-skip-region-regexp) |
| 2568 | ispell-region-end t)) | 2565 | ispell-region-end t)) |
| 2569 | (progn | 2566 | (progn |
| 2570 | (setq key (buffer-substring-no-properties | 2567 | (setq key (match-string-no-properties 0)) |
| 2571 | (car (match-data)) | ||
| 2572 | (car (cdr (match-data))))) | ||
| 2573 | (set-marker skip-region-start | 2568 | (set-marker skip-region-start |
| 2574 | (- (point) (length key))) | 2569 | (- (point) (length key))) |
| 2575 | (goto-char rstart)) | 2570 | (goto-char rstart)) |
| @@ -3510,8 +3505,7 @@ Includes Latex/Nroff modes and extended character mode." | |||
| 3510 | (search-forward ispell-parsing-keyword) | 3505 | (search-forward ispell-parsing-keyword) |
| 3511 | (while (re-search-forward " *\\([^ \"]+\\)" end t) | 3506 | (while (re-search-forward " *\\([^ \"]+\\)" end t) |
| 3512 | ;; space separated definitions. | 3507 | ;; space separated definitions. |
| 3513 | (setq string (downcase (buffer-substring-no-properties | 3508 | (setq string (downcase (match-string-no-properties 1))) |
| 3514 | (match-beginning 1) (match-end 1)))) | ||
| 3515 | (cond ((and (string-match "latex-mode" string) | 3509 | (cond ((and (string-match "latex-mode" string) |
| 3516 | (not (eq 'exclusive ispell-check-comments))) | 3510 | (not (eq 'exclusive ispell-check-comments))) |
| 3517 | (ispell-send-string "+\n~tex\n")) | 3511 | (ispell-send-string "+\n~tex\n")) |
| @@ -3544,8 +3538,7 @@ Both should not be used to define a buffer-local dictionary." | |||
| 3544 | (setq end (save-excursion (end-of-line) (point))) | 3538 | (setq end (save-excursion (end-of-line) (point))) |
| 3545 | (if (re-search-forward " *\\([^ \"]+\\)" end t) | 3539 | (if (re-search-forward " *\\([^ \"]+\\)" end t) |
| 3546 | (setq ispell-local-dictionary | 3540 | (setq ispell-local-dictionary |
| 3547 | (buffer-substring-no-properties (match-beginning 1) | 3541 | (match-string-no-properties 1)))))) |
| 3548 | (match-end 1))))))) | ||
| 3549 | (goto-char (point-max)) | 3542 | (goto-char (point-max)) |
| 3550 | (if (search-backward ispell-pdict-keyword nil t) | 3543 | (if (search-backward ispell-pdict-keyword nil t) |
| 3551 | (progn | 3544 | (progn |
| @@ -3553,8 +3546,7 @@ Both should not be used to define a buffer-local dictionary." | |||
| 3553 | (setq end (save-excursion (end-of-line) (point))) | 3546 | (setq end (save-excursion (end-of-line) (point))) |
| 3554 | (if (re-search-forward " *\\([^ \"]+\\)" end t) | 3547 | (if (re-search-forward " *\\([^ \"]+\\)" end t) |
| 3555 | (setq ispell-local-pdict | 3548 | (setq ispell-local-pdict |
| 3556 | (buffer-substring-no-properties (match-beginning 1) | 3549 | (match-string-no-properties 1))))))) |
| 3557 | (match-end 1)))))))) | ||
| 3558 | ;; Reload if new personal dictionary defined. | 3550 | ;; Reload if new personal dictionary defined. |
| 3559 | (if (and ispell-local-pdict | 3551 | (if (and ispell-local-pdict |
| 3560 | (not (equal ispell-local-pdict ispell-personal-dictionary))) | 3552 | (not (equal ispell-local-pdict ispell-personal-dictionary))) |
| @@ -3584,8 +3576,7 @@ Both should not be used to define a buffer-local dictionary." | |||
| 3584 | ;; buffer-local words separated by a space, and can contain | 3576 | ;; buffer-local words separated by a space, and can contain |
| 3585 | ;; any character other than a space. Not rigorous enough. | 3577 | ;; any character other than a space. Not rigorous enough. |
| 3586 | (while (re-search-forward " *\\([^ ]+\\)" end t) | 3578 | (while (re-search-forward " *\\([^ ]+\\)" end t) |
| 3587 | (setq string (buffer-substring-no-properties (match-beginning 1) | 3579 | (setq string (match-string-no-properties 1)) |
| 3588 | (match-end 1))) | ||
| 3589 | ;; This can fail when string contains a word with illegal chars. | 3580 | ;; This can fail when string contains a word with illegal chars. |
| 3590 | ;; Error handling needs to be added between ispell and emacs. | 3581 | ;; Error handling needs to be added between ispell and emacs. |
| 3591 | (if (and (< 1 (length string)) | 3582 | (if (and (< 1 (length string)) |