branch: elpa/inf-clojure commit b048358406c24f5f22a3fc51c0a1348236bcfde1 Author: Hlöðver Sigurðsson <hlo...@gmail.com> Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>
Add expression break chars and prevent completions for numbers (#110) --- inf-clojure.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inf-clojure.el b/inf-clojure.el index 2d93d54..dd4ccb1 100644 --- a/inf-clojure.el +++ b/inf-clojure.el @@ -1239,7 +1239,7 @@ See variable `inf-clojure-buffer'." (inf-clojure--read-or-nil) (inf-clojure--list-or-nil)))) -(defconst inf-clojure-clojure-expr-break-chars " \t\n\"\'`><,;|&{(") +(defconst inf-clojure-clojure-expr-break-chars " \t\n\"\'`><,;|&{()[]") (defun inf-clojure-completion-bounds-of-expr-at-point () "Return bounds of expression at point to complete." @@ -1247,7 +1247,9 @@ See variable `inf-clojure-buffer'." (save-excursion (let ((end (point))) (skip-chars-backward (concat "^" inf-clojure-clojure-expr-break-chars)) - (cons (point) end))))) + (let ((first-char (substring-no-properties (thing-at-point 'symbol) 0 1))) + (when (string-match-p "[^0-9]" first-char) + (cons (point) end))))))) (defun inf-clojure-completion-expr-at-point () "Return expression at point to complete."