Re: *Completions* buffer does not closed automatically

Bill Clementson <[email protected]> Wed, 26 Sep 2007 08:48:21 -0700
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Hi Pierre,

Pierre Radermecker <[email protected]> writes:
>> I believe that distel's completion buffer behaves in a similar manner
>> to "normal" completion (at least it appears to work the same way for
>> me). If you're seeing something different, perhaps you could list the
>> specific steps you take to replicate the behaviour.
>
> Here are the steps with Distel:
>
> 1) type "io:f" in the buffer and press alt-tab:
> *Completions* buffer open
> 2) go on typing "orm" in the buffer and press alt-tab:
> Automatic completion in the buffer, the *Completions* window stays open.
>
> Here are the steps in the *Scratch* buffer
> 1) type (gl and press alt-tab:
> *Completions* buffer open
> 2) go on typing "obal-k" in the buffer and press alt-tab:
> Automatic completion in the buffer, *Completions* buffer automatically cl=
ose.
>
> Do you have a similar behavior ?

I think I see what's happening. I normally only have one buffer
visible in the Emacs frame, so when I hit M-TAB I always get the
completions buffer shown. You must be displaying 2 buffers in an Emacs
frame. When I do that, I get the results that you do. Does the
attached patch fix the problem for you?

> Thanks for your help (maybe we will meet at OOPSLA in Montr=E9al)

Neat! Yes, I'll be at OOPSLA, but only on Monday (the DLS sessions and
the MSLUG meeting) and a couple of OOPSLA sessions on Tueesday. Will
you be at DLS or MSLUG? =


- Bill

Patch:
Index: elisp/erl-service.el
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- elisp/erl-service.el        (revision 42)
+++ elisp/erl-service.el        (working copy)
@@ -827,6 +827,8 @@
 (defun erl-complete (node)
   "Complete the module or remote function name at point."
   (interactive (list (erl-target-node)))
+  (let ((win (get-buffer-window "*Completions*" 0)))
+    (if win (with-selected-window win (bury-buffer))))
   (let ((end (point))
   (beg (ignore-errors =

          (save-excursion (backward-sexp 1)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/