* lisp/thingatpt.el (form-at-point):
Use thing-at-point--read-from-whole-string only if thing-at-point
returns a string (Bug#24605).
"This is an internal thingatpt function and should not be used.")
(defun form-at-point (&optional thing pred)
- (let ((sexp (ignore-errors
- (thing-at-point--read-from-whole-string
- (thing-at-point (or thing 'sexp))))))
+ (let* ((obj (thing-at-point (or thing 'sexp)))
+ (sexp (if (stringp obj)
+ (ignore-errors
+ (thing-at-point--read-from-whole-string obj))
+ obj)))
(if (or (not pred) (funcall pred sexp)) sexp)))
;;;###autoload