1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

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
This commit is contained in:
Alex Branham 2019-06-14 13:15:36 -05:00
parent 44a086e5cc
commit 1942f4ccba
No known key found for this signature in database
GPG Key ID: 1E4227A253E99AC7

View File

@ -423,9 +423,10 @@ like <img alt=\"Some thing.\">."
(defun flyspell-generic-progmode-verify ()
"Used for `flyspell-generic-check-word-predicate' in programming modes."
;; (point) is next char after the word. Must check one char before.
(let ((f (get-text-property (- (point) 1) 'face)))
(memq f flyspell-prog-text-faces)))
(unless (eql (point) (point-min))
;; (point) is next char after the word. Must check one char before.
(let ((f (get-text-property (1- (point)) 'face)))
(memq f flyspell-prog-text-faces))))
;; Records the binding of M-TAB in effect before flyspell was activated.
(defvar flyspell--prev-meta-tab-binding)