From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#8492: 23.3; Time to use a different binding for completion? Date: Tue, 19 Apr 2011 15:01:14 +0200 Message-ID: References: <87zknuhxl4.fsf@sc3d.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1303218465 25042 80.91.229.12 (19 Apr 2011 13:07:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2011 13:07:45 +0000 (UTC) Cc: 8492@debbugs.gnu.org, Reuben Thomas To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 19 15:07:41 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QCAea-0001qB-7T for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Apr 2011 15:07:40 +0200 Original-Received: from localhost ([::1]:46083 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCAeZ-0003JQ-Mg for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Apr 2011 09:07:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCAeW-0003JA-VL for bug-gnu-emacs@gnu.org; Tue, 19 Apr 2011 09:07:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCAeP-0005aJ-6L for bug-gnu-emacs@gnu.org; Tue, 19 Apr 2011 09:07:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCAeP-0005aE-1f for bug-gnu-emacs@gnu.org; Tue, 19 Apr 2011 09:07:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QCAZ8-0002QI-C0; Tue, 19 Apr 2011 09:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Apr 2011 13:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8492 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8492-submit@debbugs.gnu.org id=B8492.13032181039287 (code B ref 8492); Tue, 19 Apr 2011 13:02:02 +0000 Original-Received: (at 8492) by debbugs.gnu.org; 19 Apr 2011 13:01:43 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QCAYo-0002Pj-BV for submit@debbugs.gnu.org; Tue, 19 Apr 2011 09:01:42 -0400 Original-Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QCAYm-0002PY-BF for 8492@debbugs.gnu.org; Tue, 19 Apr 2011 09:01:41 -0400 Original-Received: by eye13 with SMTP id 13so1981957eye.3 for <8492@debbugs.gnu.org>; Tue, 19 Apr 2011 06:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=V8LS3C5VY1gyi00Ol7EjXT28CCXslA8schXifdCBkW8=; b=X6pTU5DMkm+Ghpt60T5rdDRD4G5t7uSV/62zUKTXlKLLeRMsOQZkP0QKR3RK3dOjv5 YVWMDGKmxfnlO+1Snc0rSy+cAvkbWJZLsbgnCE0f8gVGTbCAdbSwyVzDfNWeIlBKoUPO cj/K4secg+TRRTi2v1resvLGU1d3B3XgiweaA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=IiZ+D2TMkvpC62muVdKpo6I6sOCwVX05Huob1r+aNI+YXQbqEQB+LW6lMt+O8JHMI2 +j+pmXI2TJ9dpJ5AmWjeZXOt7b7WrPhtz6G/Ffzi5PJn8jkU0w7KaTqjLW0xjPpNY5YZ mcV0rgMx9S9DU1LrneRqC+bDBm+hbkSQSnUs4= Original-Received: by 10.213.109.199 with SMTP id k7mr4060094ebp.134.1303218094273; Tue, 19 Apr 2011 06:01:34 -0700 (PDT) Original-Received: by 10.213.23.8 with HTTP; Tue, 19 Apr 2011 06:01:14 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 19 Apr 2011 09:02:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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:45867 Archived-At: On Tue, Apr 19, 2011 at 2:46 PM, Stefan Monnier wrote: >>>>> Is it therefore time to admit defeat and find an alternative binding = for >>>>> completion functions, even if it=E2=80=99s an extra binding rather th= an simply a >>>>> different one? >>>> TAB can do completion if you (setq tab-always-indent 'complete). >>> Thanks for the tip, I'll try that. >> The idea is nice, but there is perhaps a problem with the current >> implementation: There are many ways to complete in Emacs. > > It's not the ultimate solution, no. =C2=A0I'm not sure what "other choice= s" > you're thinking of, but I know that for some major modes, mixing > completion and indentation via (setq tab-always-indent 'complete) is not > really an option (e.g. Python where TAB cycles through various > indentation levels). This is what I have in tabkey2.el in nXhtml (though it might be broken at the moment): (defcustom tabkey2-completion-functions '( ("Emacs default completion" completion-at-point completion-at-point-functions) ;; Front ends (should take care of the rest, ie temporary things, ;; snippets etc...) ("Company Mode completion" company-complete company-mode) ;; Temporary things ("Spell check word" flyspell-correct-word-before-point nil) ;; Snippets ("Yasnippet" yas/expand (yas/expandable-at-point)) ;; Main mode related, often used ("Semantic Smart Completion" senator-complete-symbol senator-minor-mode= ) ("Programmable completion" pcomplete (and (boundp 'pcomplete-parse-arguments-function) pcomplete-parse-arguments-function)) ("nXML completion" nxml-complete (derived-mode-p 'nxml-mode)) ("Complete Emacs symbol" lisp-complete-symbol (and (derived-mode-p 'emacs-lisp-mode) (not (fboundp 'completion-at-point)))) ("Widget complete" widget-complete nil) ("Comint Dynamic Complete" comint-dynamic-complete nil) ("PHP completion" php-complete-function php-mode) ("Tags completion" complete-tag nil) ;; General word completion ("Predictive word" complete-word-at-point predictive-mode) ("Predictive abbreviations" pabbrev-expand-maybe) ("Dynamic word expansion" dabbrev-expand t (setq dabbrev--last-abbrev-location nil)) ("Ispell complete word" ispell-complete-word t) ;; The catch all ("Anything" anything (commandp 'anything)) ) "List of completion functions. The first 'active' entry in this list is normally used during the 'Tab completion state' by `tabkey2-complete'. An entry in the list should have either of this forms \(TITLE COMPLETION-FUNCTION ACTIVE-FORM RESET-FORM) TITLE to show in menus etc. COMPLETION-FUNCTION is the completion function symbol. The entry is considered active if the symbol COMPLETION-FUNCTION is bound to a command and - This function has a key binding at point and ACTIVE-FORM is equal to nil. or - The elisp expression ACTIVE-FORM evaluates to non-nil. If it is a single symbol then its variable value is used, otherwise the elisp form is evaled. RESET-FORM is used to reset the completion function before calling it. When choosing with `tabkey2-cycle-completion-functions' only the currently active entry in this list are shown." :type '(repeat (list string (choice (command :tag "Currently known comman= d") (symbol :tag "Command not known yet"= )) (choice (const :tag "Active only if it has a key binding at point" nil) (sexp :tag "Elisp, if evals to non-nil then active")) (sexp :tag "Elisp, reset completion function"))) :group 'tabkey2)