[slime-devel] Re: [PATCH] slime-complete-function* on XEmacs

Madhu enometh at meer.net
Sun Sep 2 08:07:06 UTC 2007


Updating the patch at:

* Date: Sat, 04 Aug 2007 19:35:15 +0530
  Message-ID: <m3wswbe6p0.fsf at robolove.meer.net> 
  Archived-At: <http://permalink.gmane.org/gmane.lisp.slime.devel/6410>

| | There is a problem in XEmacs (21.4) with the current implementation
| | of `slime-complete-symbol*'. On completing a symbol, the text gets
| | truncated to the length of the unambiguous prefix of all matches --
| | This is entirely an artifact of the XEmacs completion mechanism, and
| | has nothing to do with SLIME's code. I'm appending a patch which
| | works around this issue when the situation is applicable and which I
| | believe is harmless in all other scenarios.

[This is not a "consensus issue" but one of fixing an error when using
 that XEmacs.  This patch is NOT recommended to be applied as is to CVS
 as it prints a debug message to the minibuffer --- the hope is that
 debug message would convince the committer]

ndex: contrib/slime-c-p-c.el          
===================================================================
RCS file: /project/slime/cvsroot/slime/contrib/slime-c-p-c.el,v
retrieving revision 1.4
diff -u -r1.4 slime-c-p-c.el
--- contrib/slime-c-p-c.el      31 Aug 2007 22:16:11 -0000      1.4
+++ contrib/slime-c-p-c.el      2 Sep 2007 07:50:48 -0000
@@ -43,10 +43,13 @@
                 "Can't find completion for \"%s\"" prefix)
                (ding)
                (slime-complete-restore-window-configuration))
-      (goto-char end)
-      (insert-and-inherit completed-prefix)
-      (delete-region beg end)
-      (goto-char (+ beg (length completed-prefix)))
+      (cond ((> (length completed-prefix) (- end beg))
+            (goto-char end)
+            (insert-and-inherit completed-prefix)
+            (delete-region beg end)
+            (goto-char (+ beg (length completed-prefix))))
+           (t (message "completed-prefix=%s prefix=%s"
+                       completed-prefix prefix)))
       (cond ((and (member completed-prefix completion-set)
                   (slime-length= completion-set 1))
              (slime-minibuffer-respecting-message "Sole completion")




More information about the slime-devel mailing list