branch: elpa/forth-mode
commit 5c1c9284908c555899e0ed1e9a957859ec2ef31d
Author: Helmut Eller <[email protected]>
Commit: Helmut Eller <[email protected]>
Make completion case insensitive
* forth-mode.el (forth-expand-symbol): Bind completion-ignore-case.
---
forth-mode.el | 7 ++++++-
test/tests.el | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/forth-mode.el b/forth-mode.el
index 11e02e18ab..f672cf76ae 100644
--- a/forth-mode.el
+++ b/forth-mode.el
@@ -83,7 +83,12 @@
(when (listp (rest index))
(dolist (def (rest index))
(push (car def) list)))))
- (list (forth-symbol-start) (forth-symbol-end) list)))
+ (list (forth-symbol-start) (forth-symbol-end)
+ ;; FIXME: this should use `completion-table-case-fold' or
+ ;; closures but neither is available in Emacs23.
+ `(lambda (string pred action)
+ (let ((completion-ignore-case t))
+ (complete-with-action action ',list string pred))))))
(defun forth-block-with-newlines-p ()
(save-excursion
diff --git a/test/tests.el b/test/tests.el
index 28f23f2555..0b747201e7 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -345,6 +345,6 @@ The whitespace before and including \"|\" on each line is
removed."
(ert-deftest forth-completion-at-point ()
(forth-with-forth
(forth-should-before/after
- "2C→"
+ "2c→"
"2Constant→"
#'completion-at-point)))