aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorGlenn Morris2018-08-10 11:28:40 -0700
committerGlenn Morris2018-08-10 11:28:40 -0700
commitcaa4d9c4e7205cc62a9f414903e965494a703763 (patch)
treee2c7d913de302f0c5c1c497fe1e76d9f133fe0cb /lisp/textmodes
parent243b68f73ff7cbb4d89a3f4a15a1cd38cfc14fae (diff)
parent5afbf62674e741b06c01216fe37a5439e9d42307 (diff)
downloademacs-caa4d9c4e7205cc62a9f414903e965494a703763.tar.gz
emacs-caa4d9c4e7205cc62a9f414903e965494a703763.zip
Merge from origin/emacs-26
5afbf62 Fix emacsclient check for term.el buffer (Bug#21041) 5132a58 Improve documentation of 'set-fontset-font' cd90325 Improve documentation of M-? 155a885 Reinterpret Esperanto characters in iso-transl as iso-8859-3. a0ef733 Fix Flyspell mode when several languages are mixed in a buffer
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/flyspell.el37
1 files changed, 31 insertions, 6 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 69bba100922..f6a809b18ee 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1424,10 +1424,20 @@ determined by `flyspell-large-region'."
1424The list of incorrect words should be in `flyspell-external-ispell-buffer'. 1424The list of incorrect words should be in `flyspell-external-ispell-buffer'.
1425\(We finish by killing that buffer and setting the variable to nil.) 1425\(We finish by killing that buffer and setting the variable to nil.)
1426The buffer to mark them in is `flyspell-large-region-buffer'." 1426The buffer to mark them in is `flyspell-large-region-buffer'."
1427 (let (words-not-found 1427 (let* (words-not-found
1428 (ispell-otherchars (ispell-get-otherchars)) 1428 (flyspell-casechars (flyspell-get-casechars))
1429 (buffer-scan-pos flyspell-large-region-beg) 1429 (ispell-otherchars (ispell-get-otherchars))
1430 case-fold-search) 1430 (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
1431 (word-chars (concat flyspell-casechars
1432 "+\\("
1433 (if (not (string= "" ispell-otherchars))
1434 (concat ispell-otherchars "?"))
1435 flyspell-casechars
1436 "+\\)"
1437 (if ispell-many-otherchars-p
1438 "*" "?")))
1439 (buffer-scan-pos flyspell-large-region-beg)
1440 case-fold-search)
1431 (with-current-buffer flyspell-external-ispell-buffer 1441 (with-current-buffer flyspell-external-ispell-buffer
1432 (goto-char (point-min)) 1442 (goto-char (point-min))
1433 ;; Loop over incorrect words, in the order they were reported, 1443 ;; Loop over incorrect words, in the order they were reported,
@@ -1457,11 +1467,18 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
1457 ;; Move back into the match 1467 ;; Move back into the match
1458 ;; so flyspell-get-word will find it. 1468 ;; so flyspell-get-word will find it.
1459 (forward-char -1) 1469 (forward-char -1)
1460 (flyspell-get-word))) 1470 ;; Is this a word that matches the
1471 ;; current dictionary?
1472 (if (looking-at word-chars)
1473 (flyspell-get-word))))
1461 (found (car found-list)) 1474 (found (car found-list))
1462 (found-length (length found)) 1475 (found-length (length found))
1463 (misspell-length (length word))) 1476 (misspell-length (length word)))
1464 (when (or 1477 (when (or
1478 ;; Misspelled word is not from the
1479 ;; language supported by the current
1480 ;; dictionary.
1481 (null found)
1465 ;; Size matches, we really found it. 1482 ;; Size matches, we really found it.
1466 (= found-length misspell-length) 1483 (= found-length misspell-length)
1467 ;; Matches as part of a boundary-char separated 1484 ;; Matches as part of a boundary-char separated
@@ -1483,13 +1500,21 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
1483 ;; backslash) and none of the previous 1500 ;; backslash) and none of the previous
1484 ;; conditions match. 1501 ;; conditions match.
1485 (and (not ispell-really-aspell) 1502 (and (not ispell-really-aspell)
1503 (not ispell-really-hunspell)
1504 (not ispell-really-enchant)
1486 (save-excursion 1505 (save-excursion
1487 (goto-char (- (nth 1 found-list) 1)) 1506 (goto-char (- (nth 1 found-list) 1))
1488 (if (looking-at "[\\]" ) 1507 (if (looking-at "[\\]" )
1489 t 1508 t
1490 nil)))) 1509 nil))))
1491 (setq keep nil) 1510 (setq keep nil)
1492 (flyspell-word nil t) 1511 ;; Don't try spell-checking words whose
1512 ;; characters don't match CASECHARS, because
1513 ;; flyspell-word will then consider as
1514 ;; misspelling the preceding word that matches
1515 ;; CASECHARS.
1516 (or (null found)
1517 (flyspell-word nil t))
1493 ;; Search for next misspelled word will begin from 1518 ;; Search for next misspelled word will begin from
1494 ;; end of last validated match. 1519 ;; end of last validated match.
1495 (setq buffer-scan-pos (point)))) 1520 (setq buffer-scan-pos (point))))