bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comint-dynamic-simple-complete should accept an obarray


From: Markus Armbruster
Subject: comint-dynamic-simple-complete should accept an obarray
Date: 15 Jul 2001 21:36:39 +0200

In GNU Emacs 20.7.2 (i386-debian-linux-gnu, X toolkit)
 of Tue Jun 20 2000 on raven
configured using `configure  i386-debian-linux-gnu --prefix=/usr 
--sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib 
--infodir=/usr/share/info --with-pop=yes --with-x=yes --with-x-toolkit=yes'

Both try-completion and all-completions take a COLLECTION argument to
specify the possible completions.  This argument must be an alist
whose CARs are strings, or an obarray, or a function.  Fine.

Quote from comint.el:

  ;; Completion for comint-mode users
  ;; 
  ;; For modes that use comint-mode, comint-dynamic-complete-functions is the
  ;; hook to add completion functions to.  Functions on this list should return
  ;; non-nil if completion occurs (i.e., further completion should not occur).
  ;; You could use comint-dynamic-simple-complete to do the bulk of the
  ;; completion job.

Unfortunately, comint-dynamic-simple-complete expects the possible
completions as list of strings.  This is inconsistent and
inconvenient.  I suggest to extend it to accept the usual arguments,
too.  Something like:

*** /usr/share/emacs/20.7/lisp/comint.el        Wed Oct  6 22:10:08 1999
--- /home/armbru/tmp/comint.el  Sun Jul 15 21:00:41 2001
***************
*** 2225,2231 ****
         (suffix (cond ((not comint-completion-addsuffix) "")
                       ((not (consp comint-completion-addsuffix)) " ")
                       (t (cdr comint-completion-addsuffix))))
!        (candidates (mapcar (function (lambda (x) (list x))) candidates))
         (completions (all-completions stub candidates)))
      (cond ((null completions)
           (message "No completions of %s" stub)
--- 2225,2235 ----
         (suffix (cond ((not comint-completion-addsuffix) "")
                       ((not (consp comint-completion-addsuffix)) " ")
                       (t (cdr comint-completion-addsuffix))))
!        (candidates (if (stringp (car-safe candidates))
!                        (mapcar (function (lambda (x)
!                                            (list x)))
!                                candidates)
!                      candidates))
         (completions (all-completions stub candidates)))
      (cond ((null completions)
           (message "No completions of %s" stub)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]