]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid errors in thing-at-point with 2nd argument non-nil
authorEli Zaretskii <eliz@gnu.org>
Sat, 5 Sep 2015 08:22:11 +0000 (11:22 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 5 Sep 2015 08:22:11 +0000 (11:22 +0300)
* lisp/thingatpt.el (thing-at-point): Only call 'length' on
sequences.  (Bug#21391)

lisp/thingatpt.el

index 6e90b265082cfae202b1e797240c4c58d7c40794..a9c539b7b870d33ded25d5a490da35065fe19245 100644 (file)
@@ -145,7 +145,7 @@ a symbol as a valid THING."
            (let ((bounds (bounds-of-thing-at-point thing)))
              (when bounds
                (buffer-substring (car bounds) (cdr bounds)))))))
-    (when (and text no-properties)
+    (when (and text no-properties (sequencep text))
       (set-text-properties 0 (length text) nil text))
     text))