From 7ff62f95df81c9e2d9068eebb80d021ea14d8434 Mon Sep 17 00:00:00 2001 From: Sean O'Rourke Date: Mon, 30 Jan 2012 13:04:16 -0700 Subject: [PATCH] * sepia.el (sepia-complete-symbol): Finally fix method completion to not delete invocant. --- ChangeLog | 5 +++++ README | 3 --- sepia.el | 11 +++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9cf19d6..7d8a00d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-01-30 Sean O'Rourke + + * sepia.el (sepia-complete-symbol): Finally fix method completion + to not delete invocant. + 2011-11-16 Sean O'Rourke * VERSION: 0.992 diff --git a/README b/README index 656c06e..8bc5aa6 100644 --- a/README +++ b/README @@ -107,9 +107,6 @@ reproduce, with the dates they were first observed. Nothing smart is done about packages, so e.g. "new Foo" will result in listings for every instance of "new" in your program. ** (2008-01-18) the first value printed in the debugger is undef. why?! -** (2009-12-13) completion deletes things it shouldn't - e.g. $x->method => method. I need to rewrite this code to not - suck. ** (2010-09-30) broken in view-mode should scroll up if you enable view-mode, but for whatever reason it stays bound to hungry-delete. I'm not sure if diff --git a/sepia.el b/sepia.el index 25052ee..717710f 100644 --- a/sepia.el +++ b/sepia.el @@ -1021,6 +1021,7 @@ The function is intended to be bound to \\M-TAB, like ;; Otherwise actually do completion: ;; 0 - try a shortcut + (multiple-value-bind (typ name) (sepia-ident-before-point) (when (eq major-mode 'sepia-repl-mode) (save-excursion (comint-bol) @@ -1033,11 +1034,14 @@ The function is intended to be bound to \\M-TAB, like (setq meth (sepia-simple-method-before-point)) (when meth (setq len (length (caddr meth)) - completions (xref-method-completions + name (caddr meth) + completions + (mapcar + (lambda (x) (format "%s->%s" (car meth) x)) + (xref-method-completions (cons 'expr (format "'%s'" (car meth))) (cadr meth) - "Sepia::repl_eval") - type (format "%s->" (car meth))))) + "Sepia::repl_eval"))))) ;; 1.x - look for a module (unless completions (setq completions @@ -1049,7 +1053,6 @@ The function is intended to be bound to \\M-TAB, like name)) ))) - (multiple-value-bind (typ name) (sepia-ident-before-point) (unless completions ;; 2 - look for a regular function/variable/whatever (setq type typ -- 2.11.4.GIT