]> code.delx.au - gnu-emacs/commitdiff
Replace uses of in-string-p; make it obsolete
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 6 Jun 2015 09:57:59 +0000 (12:57 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 6 Jun 2015 09:57:59 +0000 (12:57 +0300)
* lisp/thingatpt.el (in-string-p): Declare obsolete (bug#20732).
(end-of-sexp, beginning-of-sexp): Use syntax-ppss instead.

lisp/thingatpt.el

index b3fe1bc79507f5ea2dd06e447ac0eb9f0f360fc5..7fdb32c1ddfd55d60350179ec7de1190bbe1c84e 100644 (file)
@@ -180,6 +180,7 @@ The bounds of THING are determined by `bounds-of-thing-at-point'."
 (defun in-string-p ()
   "Return non-nil if point is in a string.
 \[This is an internal function.]"
+  (declare (obsolete "use (nth 3 (syntax-ppss)) instead." "25.1"))
   (let ((orig (point)))
     (save-excursion
       (beginning-of-defun)
@@ -190,7 +191,7 @@ The bounds of THING are determined by `bounds-of-thing-at-point'."
 \[This is an internal function.]"
   (let ((char-syntax (syntax-after (point))))
     (if (or (eq char-syntax ?\))
-           (and (eq char-syntax ?\") (in-string-p)))
+           (and (eq char-syntax ?\") (nth 3 (syntax-ppss))))
        (forward-char 1)
       (forward-sexp 1))))
 
@@ -201,7 +202,7 @@ The bounds of THING are determined by `bounds-of-thing-at-point'."
 \[This is an internal function.]"
   (let ((char-syntax (char-syntax (char-before))))
     (if (or (eq char-syntax ?\()
-           (and (eq char-syntax ?\") (in-string-p)))
+           (and (eq char-syntax ?\") (nth 3 (syntax-ppss))))
        (forward-char -1)
       (forward-sexp -1))))