aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/thingatpt.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index df5c52d4d61..6d1014bb92d 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -586,9 +586,11 @@ Signal an error if the entire string was not used."
586 "This is an internal thingatpt function and should not be used.") 586 "This is an internal thingatpt function and should not be used.")
587 587
588(defun form-at-point (&optional thing pred) 588(defun form-at-point (&optional thing pred)
589 (let ((sexp (ignore-errors 589 (let* ((obj (thing-at-point (or thing 'sexp)))
590 (thing-at-point--read-from-whole-string 590 (sexp (if (stringp obj)
591 (thing-at-point (or thing 'sexp)))))) 591 (ignore-errors
592 (thing-at-point--read-from-whole-string obj))
593 obj)))
592 (if (or (not pred) (funcall pred sexp)) sexp))) 594 (if (or (not pred) (funcall pred sexp)) sexp)))
593 595
594;;;###autoload 596;;;###autoload