Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 problems with completer from emacs 21.1

closed-fixed
None
5
2002-08-16
2001-11-30
Anonymous
No

When using ilisp.emacs (from version 5.11) as Emacs startup file (only the path to the ilisp files was changed) the Emacs minibuffer completion stopped working.
When removing (require 'completer) from .emacs, this effect is delayed until one does 'run-ilisp".

XEmacs 21.1 (patch 14) works fine with the same .emacs file.

Discussion

  • Logged In: NO

    I'm able to reproduce this problem with
    GNU Emacs 21.1.1 (i386-msvc-nt5.0.2195) of 2001-10-22
    and ilisp 5.11.

     
  • Logged In: YES
    user_id=38855

    This is fixed in current CVS ILISP.

     
    • assigned_to: nobody --> mkoeppe
    • status: open --> open-fixed
     
  • Logged In: NO

    with ilisp 5.11, you can work around this problem by using
    this directive in your .emacs file:

    (setq ilisp-*prefix-match* t)

    Tord Kallqvist Romstad pointed this out in a posting to
    comp.lang.lisp.

     
  • Logged In: YES
    user_id=275595

    I don't know if this helps, but I found trouble with the
    completion of symbols, and tracked it down to a bug in
    minibuffer.
    I'm not sure whether this is the same problem. Here's some
    information I sent to the xemacs maintainers:
    I BELIEVE that ilisp-cmp has a bug in ilisp-read-symbol,
    particularly
    in the way it uses the minibuffer. I was finding that this
    crashed in
    my copy of ilisp (ilisp-cmp.el,v 1.4) on Xemacs 21.1.14, linux.

    When using meta-dot to find a function definition, I was getting
    completion crashes with the error that LAST-EXACT-COMPLETION was
    unbound.

    That variable is defined in minibuf.el (no version number
    available in
    my copy :-<), but not bound.

    When one calls SOME minibuffer completion function, it seems
    to behave in
    a well-balanced way: the function first binds
    last-exact-completion
    to nil, then starts functioning.

    However, if one calls minibuffer-complete, as
    completer-complete in
    ilisp-read-symbol does, last-exact-completion is not bound.

    The head of minibuffer-do-completion has the following in it:

    (defun minibuffer-do-completion (buffer-string)
    (let* ((completion (try-completion buffer-string
    minibuffer-completion-table

    minibuffer-completion-predicate))
    (status (minibuffer-do-completion-1 buffer-string
    completion))
    (last last-exact-completion))

    ...note that this assumes last-exact-completion is bound on
    entry to
    the function.

    Since minibuffer-complete is interactive, and thus can be called
    directly, I BELIEVE that the appropriate patch is to modify
    minibuffer-complete as follows:

    OLD version:

    (defun minibuffer-complete ()
    "Complete the minibuffer contents as far as possible.
    Return nil if there is no valid completion, else t.
    If no characters can be completed, display a list of
    possible completions.
    If you repeat this command after it displayed such a list,
    scroll the window of possible completions."
    (interactive)
    ;; If the previous command was not this, then mark the
    completion
    ;; buffer obsolete.
    (or (eq last-command this-command)
    (setq minibuffer-scroll-window nil))
    (let ((window minibuffer-scroll-window))
    (if (and window (windowp window) (window-buffer window)
    (buffer-name (window-buffer window)))
    ;; If there's a fresh completion window with a live buffer
    ;; and this command is repeated, scroll that window.
    (let ((obuf (current-buffer)))
    (unwind-protect
    (progn
    (set-buffer (window-buffer window))
    (if (pos-visible-in-window-p (point-max) window)
    ;; If end is in view, scroll up to the beginning.
    (set-window-start window (point-min))
    ;; Else scroll down one frame.
    (scroll-other-window)))
    (set-buffer obuf))
    nil)
    (let ((status (minibuffer-do-completion (buffer-string))))
    (if (eq status 'none)
    nil
    (progn
    (cond ((eq status 'unique)
    (temp-minibuffer-message
    " [Sole completion]"))
    ((eq status 'exact)
    (temp-minibuffer-message
    " [Complete, but not unique]")))
    t))))))

    NEW version:

    (defun minibuffer-complete ()
    "Complete the minibuffer contents as far as possible.
    Return nil if there is no valid completion, else t.
    If no characters can be completed, display a list of
    possible completions.
    If you repeat this command after it displayed such a list,
    scroll the window of possible completions."
    (interactive)
    ;; If the previous command was not this, then mark the
    completion
    ;; buffer obsolete.
    (cond ((not (eq last-command this-command))
    (setq minibuffer-scroll-window nil)
    (setq last-exact-completion nil)))
    (let ((window minibuffer-scroll-window))
    (if (and window (windowp window) (window-buffer window)
    (buffer-name (window-buffer window)))
    ;; If there's a fresh completion window with a live buffer
    ;; and this command is repeated, scroll that window.
    (let ((obuf (current-buffer)))
    (unwind-protect
    (progn
    (set-buffer (window-buffer window))
    (if (pos-visible-in-window-p (point-max) window)
    ;; If end is in view, scroll up to the beginning.
    (set-window-start window (point-min))
    ;; Else scroll down one frame.
    (scroll-other-window)))
    (set-buffer obuf))
    nil)
    (let ((status (minibuffer-do-completion (buffer-string))))
    (if (eq status 'none)
    nil
    (progn
    (cond ((eq status 'unique)
    (temp-minibuffer-message
    " [Sole completion]"))
    ((eq status 'exact)
    (temp-minibuffer-message
    " [Complete, but not unique]")))
    t))))))

     
    • status: open-fixed --> closed-fixed
     
  • Logged In: YES
    user_id=38855

    Can you please test with a recent ILISP version?

    ILISP 5.11 completer.el is known to be broken with Emacs 21.
    We fixed the problem in CVS in or before February 2002.
    Since then, ILISP 5.12 and a snapshot have been released.

     
  • Logged In: YES
    user_id=275595

    I'm not sure that mine is really the same bug as 487717. I
    just checked, and the version of ilisp-cmp.el that is in the
    current ilisp and the version in mine (the one that's
    distributed from xemacs.org) are identical, except for the
    version number.

    And, anyway, the bug I found is in the minibuffer code, not
    in ilisp, so nothing in the ilisp distribution could fix it.

     
  • Logged In: YES
    user_id=275595

    I'm not sure that mine is really the same bug as 487717. I
    just checked, and the version of ilisp-cmp.el that is in the
    current ilisp and the version in mine (the one that's
    distributed from xemacs.org) are identical, except for the
    version number.

    And, anyway, the bug I found is in the minibuffer code, not
    in ilisp, so nothing in the ilisp distribution could fix it.