From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#22407: Better support external completion tools Date: Tue, 19 Jan 2016 09:19:48 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1453213291 18553 80.91.229.3 (19 Jan 2016 14:21:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Jan 2016 14:21:31 +0000 (UTC) To: 22407@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 19 15:21:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aLX9o-0001by-D8 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 15:21:16 +0100 Original-Received: from localhost ([::1]:37263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLX9n-0001hQ-NN for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 09:21:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLX9i-0001h1-Me for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:21:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLX9a-00087A-4q for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:21:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLX9a-000873-0o for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aLX9Z-0000fO-Tf for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jan 2016 14:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14532132122486 (code B ref -1); Tue, 19 Jan 2016 14:21:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jan 2016 14:20:12 +0000 Original-Received: from localhost ([127.0.0.1]:53529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLX8l-0000e2-QL for submit@debbugs.gnu.org; Tue, 19 Jan 2016 09:20:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40658) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLX8j-0000dn-BV for submit@debbugs.gnu.org; Tue, 19 Jan 2016 09:20:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLX8X-0007IF-AV for submit@debbugs.gnu.org; Tue, 19 Jan 2016 09:20:03 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLX8X-0007I7-8B for submit@debbugs.gnu.org; Tue, 19 Jan 2016 09:19:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLX8V-00010V-DJ for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:19:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLX8R-0007HJ-7I for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:19:55 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:41475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLX8R-0007HA-1V for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 09:19:51 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CNEAA731xV/++PWxdcgxABU16CULJTAZAMB4V5BIFAPBEBAQEBAQEBgQpBBYQ5EwFLDwQhARwNVYgOmy+0IIo4hTUBAQVqhBUFi0RshhmiOyOBRwwTIQMBG4FwIDGBDIE7AQEB X-IPAS-Result: A0CNEAA731xV/++PWxdcgxABU16CULJTAZAMB4V5BIFAPBEBAQEBAQEBgQpBBYQ5EwFLDwQhARwNVYgOmy+0IIo4hTUBAQVqhBUFi0RshhmiOyOBRwwTIQMBG4FwIDGBDIE7AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="190273357" Original-Received: from 23-91-143-239.cpe.pppoe.ca (HELO pastel.home) ([23.91.143.239]) by ironport2-out.teksavvy.com with ESMTP; 19 Jan 2016 09:19:50 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 88F0C5FF67; Tue, 19 Jan 2016 09:19:48 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111742 Archived-At: Package: Emacs Version: 25.1.50 The current minibuffer.el code is sometimes inconvenient to use for some packages because the only hooks it provides is for the package to give the output of `all-completions' and `try-completion' (basically), which is too limiting when the completion is performed by outside tools which may provide natively things like "substring" matching. We should add new methods to the completion-tables (beside the existing try, all, test, boundaries, and metadata) that allow the completion table to provide its own version of completion-try-completion and completion-all-completions. Clearly, that means that `completion-styles' wouldn't be automatically honored, so it'd be up to those completion tables to do their best to try and honor `completion-styles' (or not). Note: checking (memq 'partial-completion completion-styles) is fundamentally broken since the user may be using its own `my-partial-completion' instead. So maybe to avoid this problem and make it easier for those completion-tables to honor `completion-styles', we could extend `completion-styles-alist' so that each style can provide some "description" of the kinds of candidates it would accept. Not sure what that "description" could look like, tho. Maybe a function which takes a user-input string and return a regexp, or maybe a simple predicate taking a user input string and a candidate and returns whether to keep it or not. Probably neither would work well enough, tho (e.g. if the completion-table includes candidates that fix typos in the user-input string). Stefan In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2016-01-14 built on pastel Repository revision: b8d080b21a801fe70170b15b663888d19df4a32d Windowing system distributor 'The X.Org Foundation', version 11.0.11604000 System Description: Debian GNU/Linux 8.2 (jessie) Configured using: 'configure -C --enable-checking --enable-check-lisp-object-type 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign' PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG SOUND NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 Important settings: value of $LANG: fr_CH.UTF-8 locale-coding-system: utf-8-unix Major mode: InactiveMinibuffer Minor modes in effect: c-electric-flag: t dired-omit-mode: t shell-dirtrack-mode: t diff-auto-refine-mode: t electric-pair-mode: t global-reveal-mode: t reveal-mode: t auto-insert-mode: t savehist-mode: t minibuffer-electric-default-mode: t url-handler-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Finding changes in /home/monnier/src/emacs/work/lisp/nxml/nxml-mode.el...done Hunk already applied Saving file /home/monnier/src/emacs/work/lisp/nxml/nxml-mode.el... Wrote /home/monnier/src/emacs/work/lisp/nxml/nxml-mode.el Finding changes in /home/monnier/src/emacs/work/lisp/nxml/nxml-mode.el...done Making completion list... Quit Making completion list... Quit Load-path shadows: /home/monnier/src/emacs/elpa/packages/ada-mode/ada-ref-man hides /home/monnier/src/emacs/elpa/packages/ada-ref-man/ada-ref-man /home/monnier/src/emacs/elpa/packages/avy/.dir-locals hides /home/monnier/src/emacs/elpa/packages/company-statistics/.dir-locals /home/monnier/src/emacs/elpa/packages/avy/.dir-locals hides /home/monnier/src/emacs/elpa/packages/company/.dir-locals /home/monnier/src/emacs/elpa/packages/avy/.dir-locals hides /home/monnier/src/emacs/elpa/packages/gnugo/.dir-locals /home/monnier/src/emacs/elpa/packages/avy/.dir-locals hides /home/monnier/src/emacs/elpa/packages/hydra/.dir-locals /home/monnier/src/emacs/elpa/packages/avy/.dir-locals hides /home/monnier/src/emacs/elpa/packages/js2-mode/.dir-locals /home/monnier/src/emacs/elpa/packages/ada-mode/ada-prj hides /home/monnier/src/emacs/work/lisp/progmodes/ada-prj /home/monnier/src/emacs/elpa/packages/ada-mode/ada-stmt hides /home/monnier/src/emacs/work/lisp/progmodes/ada-stmt /home/monnier/src/emacs/elpa/packages/ada-mode/ada-mode hides /home/monnier/src/emacs/work/lisp/progmodes/ada-mode /home/monnier/src/emacs/elpa/packages/ada-mode/ada-xref hides /home/monnier/src/emacs/work/lisp/progmodes/ada-xref /home/monnier/src/emacs/elpa/packages/avy/.dir-locals hides /home/monnier/src/emacs/work/lisp/gnus/.dir-locals /home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp /home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/work/lisp/obsolete/landmark /home/monnier/src/emacs/work/lisp/emacs-lisp/cl-generic hides /home/monnier/src/emacs/elpa/packages/cl-generic/cl-generic Features: (sort mail-extr emacsbug css-mode skeleton sm-c-mode ffap two-column smerge-mode whitespace smie log-edit message sendmail rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils mailheader pcvs-util vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc-dir let-alist derived inline epg subr-x package-x dabbrev rect cc-mode cl-seq cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-langs cc-vars cc-defs python tramp-sh tramp tramp-compat tramp-loaddefs trampver format-spec json dired-x dired dired-loaddefs bug-reference add-log eieio-opt speedbar sb-image ezimage dframe texnfo-upd texinfo sgml-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct character-fold misearch multi-isearch shell pcomplete grep compile vc vc-dispatcher map rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok executable copyright xscheme warnings unsafep trace testcover shadow scheme re-builder profiler inf-lisp ielm comint ansi-color ring gmm-utils ert pp find-func ewoc debug elp edebug cl-indent cus-edit cus-start cus-load wid-edit vc-git diff-mode filecache seq server noutline outline easy-mmode flyspell ispell checkdoc thingatpt load-dir elec-pair reveal autoinsert proof-site proof-autoloads cl pg-vars savehist minibuf-eldef disp-table edmacro kmacro advice info finder-inf package epg-config url-handlers url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core cl-macs gv eieio-loaddefs gnus-util time-date mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr password-cache url-vars bbdb-autoloads vm-autoloads mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote inotify dynamic-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 571183 143835) (symbols 48 44226 0) (miscs 40 10879 3055) (strings 32 116260 12700) (string-bytes 1 3071372) (vectors 16 68223) (vector-slots 8 2435977 194326) (floats 8 797 593) (intervals 56 51774 1418) (buffers 976 122) (heap 1024 766281 15256))