diff options
| author | Alex Branham | 2019-06-14 13:15:36 -0500 |
|---|---|---|
| committer | Alex Branham | 2019-06-17 14:03:33 -0500 |
| commit | 1942f4ccba52896e3e97789dc6b51926ad74c591 (patch) | |
| tree | cfb1ed58f1576ef7aa6603a53ba643c0fe738e50 | |
| parent | 44a086e5ccb920bb5a310079130ce1eaabdfe4ce (diff) | |
| download | emacs-1942f4ccba52896e3e97789dc6b51926ad74c591.tar.gz emacs-1942f4ccba52896e3e97789dc6b51926ad74c591.zip | |
Avoid a flyspell error if point is at beginning of buffer
* lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify): Check
if point is at the beginning of the buffer. This prevents an error
when e.g. 'flyspell-auto-correct-word' gets called with point at the
beginning of the buffer.
Bug#35967
| -rw-r--r-- | lisp/textmodes/flyspell.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index d18916dfd01..bfe912308e9 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -423,9 +423,10 @@ like <img alt=\"Some thing.\">." | |||
| 423 | 423 | ||
| 424 | (defun flyspell-generic-progmode-verify () | 424 | (defun flyspell-generic-progmode-verify () |
| 425 | "Used for `flyspell-generic-check-word-predicate' in programming modes." | 425 | "Used for `flyspell-generic-check-word-predicate' in programming modes." |
| 426 | ;; (point) is next char after the word. Must check one char before. | 426 | (unless (eql (point) (point-min)) |
| 427 | (let ((f (get-text-property (- (point) 1) 'face))) | 427 | ;; (point) is next char after the word. Must check one char before. |
| 428 | (memq f flyspell-prog-text-faces))) | 428 | (let ((f (get-text-property (1- (point)) 'face))) |
| 429 | (memq f flyspell-prog-text-faces)))) | ||
| 429 | 430 | ||
| 430 | ;; Records the binding of M-TAB in effect before flyspell was activated. | 431 | ;; Records the binding of M-TAB in effect before flyspell was activated. |
| 431 | (defvar flyspell--prev-meta-tab-binding) | 432 | (defvar flyspell--prev-meta-tab-binding) |