aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-03-25 17:32:40 +0100
committerLars Ingebrigtsen2022-03-25 17:32:40 +0100
commit4eabca26d3d17a87ff2548dd251b597d8b2d2c55 (patch)
tree6d8dbc69689302ea34074d775d5513f6620db7fe
parentec2f2ed65ef5232c83ed84384b0f6230345c7d78 (diff)
downloademacs-4eabca26d3d17a87ff2548dd251b597d8b2d2c55.tar.gz
emacs-4eabca26d3d17a87ff2548dd251b597d8b2d2c55.zip
Fix (bounds-of-thing-at-point 'number)
* lisp/thingatpt.el (number): Make (bounds-of-thing-at-point 'number) work (bug#54555).
-rw-r--r--lisp/thingatpt.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 5f9ccc094af..b3dca5890f1 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -82,7 +82,7 @@ question.
82(defun forward-thing (thing &optional n) 82(defun forward-thing (thing &optional n)
83 "Move forward to the end of the Nth next THING. 83 "Move forward to the end of the Nth next THING.
84THING should be a symbol specifying a type of syntactic entity. 84THING should be a symbol specifying a type of syntactic entity.
85Possibilities include `symbol', `list', `sexp', `defun', 85Possibilities include `symbol', `list', `sexp', `defun', `number',
86`filename', `url', `email', `uuid', `word', `sentence', `whitespace', 86`filename', `url', `email', `uuid', `word', `sentence', `whitespace',
87`line', and `page'." 87`line', and `page'."
88 (let ((forward-op (or (get thing 'forward-op) 88 (let ((forward-op (or (get thing 'forward-op)
@@ -97,7 +97,7 @@ Possibilities include `symbol', `list', `sexp', `defun',
97(defun bounds-of-thing-at-point (thing) 97(defun bounds-of-thing-at-point (thing)
98 "Determine the start and end buffer locations for the THING at point. 98 "Determine the start and end buffer locations for the THING at point.
99THING should be a symbol specifying a type of syntactic entity. 99THING should be a symbol specifying a type of syntactic entity.
100Possibilities include `symbol', `list', `sexp', `defun', 100Possibilities include `symbol', `list', `sexp', `defun', `number',
101`filename', `url', `email', `uuid', `word', `sentence', `whitespace', 101`filename', `url', `email', `uuid', `word', `sentence', `whitespace',
102`line', and `page'. 102`line', and `page'.
103 103
@@ -732,6 +732,7 @@ Signal an error if the entire string was not used."
732 "Return the symbol at point, or nil if none is found." 732 "Return the symbol at point, or nil if none is found."
733 (let ((thing (thing-at-point 'symbol))) 733 (let ((thing (thing-at-point 'symbol)))
734 (if thing (intern thing)))) 734 (if thing (intern thing))))
735
735;;;###autoload 736;;;###autoload
736(defun number-at-point () 737(defun number-at-point ()
737 "Return the number at point, or nil if none is found. 738 "Return the number at point, or nil if none is found.
@@ -746,7 +747,9 @@ like \"0xBEEF09\" or \"#xBEEF09\", are recognized."
746 (string-to-number 747 (string-to-number
747 (buffer-substring (match-beginning 0) (match-end 0)))))) 748 (buffer-substring (match-beginning 0) (match-end 0))))))
748 749
750(put 'number 'forward-op 'forward-word)
749(put 'number 'thing-at-point 'number-at-point) 751(put 'number 'thing-at-point 'number-at-point)
752
750;;;###autoload 753;;;###autoload
751(defun list-at-point (&optional ignore-comment-or-string) 754(defun list-at-point (&optional ignore-comment-or-string)
752 "Return the Lisp list at point, or nil if none is found. 755 "Return the Lisp list at point, or nil if none is found.