diff options
| author | Lars Ingebrigtsen | 2021-01-20 05:44:16 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-20 05:44:16 +0100 |
| commit | 8b33b76eb9fbb857bccbe3d223c961c486e4e8f9 (patch) | |
| tree | b413c02ccd9a60f6c3a49db6b33c3454bc9727d0 | |
| parent | c502cdd2b71f396b202e22103cd8aa5b0796fdab (diff) | |
| download | emacs-8b33b76eb9fbb857bccbe3d223c961c486e4e8f9.tar.gz emacs-8b33b76eb9fbb857bccbe3d223c961c486e4e8f9.zip | |
Revert "Make `symbol-at-point' work in buffers with no symbols"
This reverts commit 40a5df81434ce02fba01779256b50976fb74da4f.
This fails when a point is after a symbol, and there's
nothing else in the buffer.
| -rw-r--r-- | lisp/thingatpt.el | 8 | ||||
| -rw-r--r-- | test/lisp/thingatpt-tests.el | 14 |
2 files changed, 0 insertions, 22 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 69c23c35431..d3ba941fcc2 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el | |||
| @@ -218,14 +218,6 @@ The bounds of THING are determined by `bounds-of-thing-at-point'." | |||
| 218 | 218 | ||
| 219 | (put 'sexp 'beginning-op 'thing-at-point--beginning-of-sexp) | 219 | (put 'sexp 'beginning-op 'thing-at-point--beginning-of-sexp) |
| 220 | 220 | ||
| 221 | ;; Symbols | ||
| 222 | |||
| 223 | (put 'symbol 'end-op 'thing-at-point--end-of-symbol) | ||
| 224 | |||
| 225 | (defun thing-at-point--end-of-symbol () | ||
| 226 | "Move point to the end of the current symbol." | ||
| 227 | (re-search-forward "\\(\\sw\\|\\s_\\)+")) | ||
| 228 | |||
| 229 | ;; Lists | 221 | ;; Lists |
| 230 | 222 | ||
| 231 | (put 'list 'bounds-of-thing-at-point 'thing-at-point-bounds-of-list-at-point) | 223 | (put 'list 'bounds-of-thing-at-point 'thing-at-point-bounds-of-list-at-point) |
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index b7c315062f9..c43c81af9fd 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el | |||
| @@ -146,18 +146,4 @@ position to retrieve THING.") | |||
| 146 | (should (thing-at-point-looking-at "2abcd")) | 146 | (should (thing-at-point-looking-at "2abcd")) |
| 147 | (should (equal (match-data) m2))))) | 147 | (should (equal (match-data) m2))))) |
| 148 | 148 | ||
| 149 | (ert-deftest test-narrow-buffer-symbol () | ||
| 150 | (with-temp-buffer | ||
| 151 | (insert "foo bar zot") | ||
| 152 | (goto-char 5) | ||
| 153 | (should (equal (symbol-at-point) 'bar))) | ||
| 154 | (with-temp-buffer | ||
| 155 | (insert "`[[`(") | ||
| 156 | (goto-char 2) | ||
| 157 | (should (equal (symbol-at-point) nil))) | ||
| 158 | (with-temp-buffer | ||
| 159 | (insert "aa `[[`(") | ||
| 160 | (goto-char 4) | ||
| 161 | (should (equal (symbol-at-point) nil)))) | ||
| 162 | |||
| 163 | ;;; thingatpt.el ends here | 149 | ;;; thingatpt.el ends here |