emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/forth-mode 5c1c928490 132/153: Make completion case insens


From: ELPA Syncer
Subject: [nongnu] elpa/forth-mode 5c1c928490 132/153: Make completion case insensitive
Date: Sat, 29 Jan 2022 08:02:26 -0500 (EST)

branch: elpa/forth-mode
commit 5c1c9284908c555899e0ed1e9a957859ec2ef31d
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Helmut Eller <eller.helmut@gmail.com>

    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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]