emacs-diffs
[Top][All Lists]
Advanced

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

master 8ef92096c34 1/2: ; Handle string-at-point at end of buffer gracef


From: Philip Kaludercic
Subject: master 8ef92096c34 1/2: ; Handle string-at-point at end of buffer gracefully
Date: Sat, 22 Jul 2023 03:21:13 -0400 (EDT)

branch: master
commit 8ef92096c349206794e928f702b56f62bf88a122
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    ; Handle string-at-point at end of buffer gracefully
    
    * lisp/thingatpt.el (thing-at-point-bounds-of-string-at-point): Check
    if 'char-after' returns non-nil before passing it to
    'char-syntax'.  (Bug#64733)
---
 lisp/thingatpt.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index f3367290dee..408713dda1a 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -250,7 +250,8 @@ Prefer the enclosing string with fallback on sexp at point.
             (goto-char (nth 8 ppss))
             (cons (point) (progn (forward-sexp) (point))))
         ;; At the beginning of the string
-        (if (eq (char-syntax (char-after)) ?\")
+        (if (let ((ca (char-after)))
+              (and ca (eq (char-syntax ca) ?\")))
             (let ((bound (bounds-of-thing-at-point 'sexp)))
              (and bound
                   (<= (car bound) (point)) (< (point) (cdr bound))



reply via email to

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