[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-chicken 0bcd595 050/102: Fuzzy matching for Chicken
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-chicken 0bcd595 050/102: Fuzzy matching for Chicken AutoDoc and Completions |
Date: |
Sun, 1 Aug 2021 18:26:53 -0400 (EDT) |
branch: elpa/geiser-chicken
commit 0bcd595e719133f87cf57576f794ade1bd9cb6a7
Author: Dan Leslie <dan@ironoxide.ca>
Commit: Dan Leslie <dan@ironoxide.ca>
Fuzzy matching for Chicken AutoDoc and Completions
Because Chicken allows symbols to be imported with prefixes, and because
'apropos' does not provide any utility to match with the loaded
prefixes, it is difficult to acquire information about prefixed symbols.
This solution hacks around the issue by providing naive
fuzzy-matching. If no match for a symbol can be found then the first
character is dropped and matching is attempted again; the process is
repeated until matches are found or the entire symbol is consumed.
Also removes the (now redundant and slow) geiser-chicken-prefix-delimiters.
---
elisp/geiser-chicken.el | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el
index 9775769..d0eb1d1 100644
--- a/elisp/geiser-chicken.el
+++ b/elisp/geiser-chicken.el
@@ -65,12 +65,6 @@
"Customization for Geiser's Chicken flavour."
:group 'geiser)
-(geiser-custom--defcustom geiser-chicken-prefix-delimiters
- '("^:" "^#")
- "Regex to match symbol prefix delimiters. Consider that it will be placed
inside []."
- :type '(repeat string)
- :group 'geiser-chicken)
-
(geiser-custom--defcustom geiser-chicken-binary
(cond ((eq system-type 'windows-nt) '("csi.exe" "-:c"))
((eq system-type 'darwin) "csi")
@@ -189,19 +183,10 @@ This function uses `geiser-chicken-init-file' if it
exists."
(defun geiser-chicken--exit-command () ",q")
(defun geiser-chicken--symbol-begin (module)
- (apply
- 'max
- (cons
- (if module
- (max (save-excursion (beginning-of-line) (point))
- (save-excursion (skip-syntax-backward "^(>") (1- (point))))
- (save-excursion (skip-syntax-backward "^'-()>") (point)))
- (let ((distance-to-beginning-of-line (- (point)
(line-beginning-position))))
- (mapcar
- (lambda (match-string)
- (save-excursion
- (skip-chars-backward match-string distance-to-beginning-of-line)
(point)))
- geiser-chicken-prefix-delimiters)))))
+ (if module
+ (max (save-excursion (beginning-of-line) (point))
+ (save-excursion (skip-syntax-backward "^(>") (1- (point))))
+ (save-excursion (skip-syntax-backward "^'-()>") (point))))
;;; Error display
- [nongnu] elpa/geiser-chicken 309c67f 034/102: Minor improvements, (continued)
- [nongnu] elpa/geiser-chicken 309c67f 034/102: Minor improvements, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 8bd8b5c 031/102: Converts toplevel methods to prefixed methods, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken a4c49f2 033/102: Turn off debug log, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken bcd1a09 037/102: Use OS-specific quotes when asking for versions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 9b9b180 039/102: Fixes for Literals, Errors and Modules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 935a114 040/102: Allows redefinition of modules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 95d19aa 044/102: Minor changes to help with debugging completions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 2098767 046/102: Quoting binary on version checks (issue #117), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 42b18d5 045/102: Minor cleanup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 1ff0274 048/102: Performance Improvements, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 0bcd595 050/102: Fuzzy matching for Chicken AutoDoc and Completions,
Philip Kaludercic <=
- [nongnu] elpa/geiser-chicken 5cc0dd2 052/102: Fix for #127, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 402e1bc 054/102: Minor typo, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken fc0c8e6 056/102: Disable aggressive prefix assumption, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 1c969ee 058/102: Allows Chicken to limit the number of symbols provided to Geiser, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 26b1f56 059/102: Use (car (process-lines ...)) instead of (shell-command ...), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 17a3799 062/102: Removed rate limit setting., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken a35ce4e 065/102: Chicken 5 works with Geiser, many features removed, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken d69c1ea 069/102: Removed more unused code, speeding things up., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken c85d953 071/102: Only check for specific chicken words, not all their keywords., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-chicken 3486915 075/102: geiser-chicken.el: Use a more stable API to get CHICKEN's version, Philip Kaludercic, 2021/08/01