emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1942f4c: Avoid a flyspell error if point is at begi


From: Alex Branham
Subject: [Emacs-diffs] master 1942f4c: Avoid a flyspell error if point is at beginning of buffer
Date: Mon, 17 Jun 2019 15:04:11 -0400 (EDT)

branch: master
commit 1942f4ccba52896e3e97789dc6b51926ad74c591
Author: Alex Branham <address@hidden>
Commit: Alex Branham <address@hidden>

    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
---
 lisp/textmodes/flyspell.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index d18916d..bfe9123 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]