]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "Make `symbol-at-point' work in buffers with no symbols"
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Jan 2021 04:44:16 +0000 (05:44 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Jan 2021 04:44:16 +0000 (05:44 +0100)
This reverts commit 40a5df81434ce02fba01779256b50976fb74da4f.

This fails when a point is after a symbol, and there's
nothing else in the buffer.

lisp/thingatpt.el
test/lisp/thingatpt-tests.el

index 69c23c35431271dd833f4d3c71beeb2696d46fa6..d3ba941fcc2fb66f691a3a7b458ced1d89cf35a9 100644 (file)
@@ -218,14 +218,6 @@ The bounds of THING are determined by `bounds-of-thing-at-point'."
 
 (put 'sexp 'beginning-op 'thing-at-point--beginning-of-sexp)
 
-;; Symbols
-
-(put 'symbol 'end-op 'thing-at-point--end-of-symbol)
-
-(defun thing-at-point--end-of-symbol ()
-  "Move point to the end of the current symbol."
-  (re-search-forward "\\(\\sw\\|\\s_\\)+"))
-
 ;;  Lists
 
 (put 'list 'bounds-of-thing-at-point 'thing-at-point-bounds-of-list-at-point)
index b7c315062f96f118c940d350aed4b7d7402f15a1..c43c81af9fde264460d0f012871f78fb0ed0e691 100644 (file)
@@ -146,18 +146,4 @@ position to retrieve THING.")
       (should (thing-at-point-looking-at "2abcd"))
       (should (equal (match-data) m2)))))
 
-(ert-deftest test-narrow-buffer-symbol ()
-  (with-temp-buffer
-    (insert "foo bar zot")
-    (goto-char 5)
-    (should (equal (symbol-at-point) 'bar)))
-  (with-temp-buffer
-    (insert "`[[`(")
-    (goto-char 2)
-    (should (equal (symbol-at-point) nil)))
-  (with-temp-buffer
-    (insert "aa `[[`(")
-    (goto-char 4)
-    (should (equal (symbol-at-point) nil))))
-
 ;;; thingatpt.el ends here