diff options
| author | Eli Zaretskii | 2017-01-07 13:02:50 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-01-07 13:02:50 +0200 |
| commit | 50fd04cd4b831a166db30292c4dc0c24be8e6e9d (patch) | |
| tree | e5285446bf5c316657ece533b51e397bca83abf4 | |
| parent | 512e9886be693f61f9d1932f19461bf4482fba51 (diff) | |
| download | emacs-50fd04cd4b831a166db30292c4dc0c24be8e6e9d.tar.gz emacs-50fd04cd4b831a166db30292c4dc0c24be8e6e9d.zip | |
Avoid infloop in 'ispell-region'
* lisp/textmodes/ispell.el (ispell-begin-skip-region-regexp):
Protect against 'ispell-skip-region-alist' being nil. Reported by
Ernest Adrogué <nfdisco@gmail.com>, see
http://lists.gnu.org/archive/html/help-gnu-emacs/2017-01/msg00007.html.
| -rw-r--r-- | lisp/textmodes/ispell.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 27ee5d372fd..9747bd6cc12 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -3133,7 +3133,14 @@ Must be called after `ispell-buffer-local-parsing' due to dependence on mode." | |||
| 3133 | (if (string= "" comment-end) "^" (regexp-quote comment-end))) | 3133 | (if (string= "" comment-end) "^" (regexp-quote comment-end))) |
| 3134 | (if (and (null ispell-check-comments) comment-start) | 3134 | (if (and (null ispell-check-comments) comment-start) |
| 3135 | (regexp-quote comment-start)) | 3135 | (regexp-quote comment-start)) |
| 3136 | (ispell-begin-skip-region ispell-skip-region-alist) | 3136 | ;; If they set ispell-skip-region-alist to nil, mapconcat |
| 3137 | ;; will produce an empty string, which will then match | ||
| 3138 | ;; anything without moving point, something | ||
| 3139 | ;; ispell-skip-region doesn't expect. Perhaps we should be | ||
| 3140 | ;; more defensive and delq "" above as well, in addition to | ||
| 3141 | ;; deleting nil elements. | ||
| 3142 | (if ispell-skip-region-alist | ||
| 3143 | (ispell-begin-skip-region ispell-skip-region-alist)) | ||
| 3137 | (ispell--make-filename-or-URL-re))) | 3144 | (ispell--make-filename-or-URL-re))) |
| 3138 | "\\|")) | 3145 | "\\|")) |
| 3139 | 3146 | ||