Skip to content

Commit eb2c3c7

Browse files
author
Greg Hendershott
committed
Completion: Fix problem with commit f4a69e0.
Need to consider symbol as well as word syntax characters. Also rewrite the (now more complicated) regexp using `rx` for clarity.
1 parent eb8ad00 commit eb2c3c7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

racket-common.el

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,16 @@ existence using `fboundp'."
463463
(defun racket-indent-or-complete ()
464464
"Try `indent-for-tab-command' then `completion-at-point'.
465465
466-
Call `indent-for-tab-command'. See if it did anything (changed
467-
the indentation, or moved point to `beginning-of-line-text'). If
468-
not, call `completion-at-point'."
466+
Call `indent-for-tab-command'. If did not change the indentation
467+
or move point to `beginning-of-line-text', and if point is
468+
in/after at least 3 word/symbol characters, then call
469+
`completion-at-point'."
469470
(interactive)
470471
(let ((pt (point)))
471472
(indent-for-tab-command)
472-
(when (and (equal (point) pt)
473-
(looking-back "\\sw\\{3\\}" 3))
473+
(when (and (equal pt (point))
474+
(thing-at-point-looking-at (rx (>= 3 (or (syntax word)
475+
(syntax symbol))))))
474476
(completion-at-point))))
475477

476478
(defun racket-backward-up-list ()

0 commit comments

Comments
 (0)