Commit 8b33b76e authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Revert "Make `symbol-at-point' work in buffers with no symbols"

This reverts commit 40a5df81.

This fails when a point is after a symbol, and there's
nothing else in the buffer.
parent c502cdd2
Pipeline #8854 failed with stages
in 158 minutes and 41 seconds
......@@ -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)
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment