From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Usability suggestion : completion for M-: Date: Sat, 15 Mar 2008 23:36:14 +0200 Organization: JURTA Message-ID: <87hcf7r7vl.fsf@jurta.org> References: <87ejaei4iz.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205618113 20337 80.91.229.12 (15 Mar 2008 21:55:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Mar 2008 21:55:13 +0000 (UTC) Cc: paul r , emacs- devel To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 15 22:55:39 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JaeLp-00079v-23 for ged-emacs-devel@m.gmane.org; Sat, 15 Mar 2008 22:55:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JaeLF-0004b7-Nc for ged-emacs-devel@m.gmane.org; Sat, 15 Mar 2008 17:55:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JaeKO-000447-Ny for emacs-devel@gnu.org; Sat, 15 Mar 2008 17:54:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JaeKN-00043I-6L for emacs-devel@gnu.org; Sat, 15 Mar 2008 17:54:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JaeKM-00043B-Nj for emacs-devel@gnu.org; Sat, 15 Mar 2008 17:54:06 -0400 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JaeKM-0000Uv-97 for emacs-devel@gnu.org; Sat, 15 Mar 2008 17:54:06 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JaeKI-0004xI-L5; Sat, 15 Mar 2008 23:54:02 +0200 In-Reply-To: <87ejaei4iz.fsf@stupidchicken.com> (Chong Yidong's message of "Thu, 13 Mar 2008 19:32:36 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: efe3bc1504fa577d936f03857ce6b673 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 2421 [Mar 14 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 11 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92704 Archived-At: >> Emacs seems to have a consistent behaviour regarding TAB and >> completion, i.e : Almost everywhere, TAB triggers completion when : >> - indentation does not make sens >> - tabulation char is unlikely to make sens >> >> For exemple, TAB triggers completion in find-file. I think TAB should >> be bound to lisp-complete-symbol in M-x eval-expression, aka M-: . >> >> Hope everybody agree and this will be widely considered as a simple >> yet positive change. > > ISTR this being discussed on this list at some point in the past, but > don't remember the details. > > At first glance, it seems like a definite win to rebind TAB to symbol > completion. Any anyone point out a usage pattern where the old > binding of TAB is preferable? I think the only problem preventing this change is one completion message that overwrites the minibuffer when TAB doesn't find a completion. I propose the patch below similar to the patch I proposed for the shell command minibuffer completion. When this is fixed, it makes sense to allow TAB to complete a lisp symbol part of the eval-expression minibuffer in the same way as TAB will allow completion of command name and file name parts of the shell-command minibuffer. Index: lisp/emacs-lisp/lisp.el =================================================================== RCS file: /sources/emacs/emacs/lisp/emacs-lisp/lisp.el,v retrieving revision 1.84 diff -c -r1.84 lisp.el *** lisp/emacs-lisp/lisp.el 5 Mar 2008 20:54:56 -0000 1.84 --- lisp/emacs-lisp/lisp.el 15 Mar 2008 21:35:47 -0000 *************** *** 667,673 **** (completion (try-completion pattern obarray predicate))) (cond ((eq completion t)) ((null completion) ! (message "Can't find completion for \"%s\"" pattern) (ding)) ((not (string= pattern completion)) (delete-region beg end) --- 667,675 ---- (completion (try-completion pattern obarray predicate))) (cond ((eq completion t)) ((null completion) ! (if (window-minibuffer-p (selected-window)) ! (minibuffer-message (format " [No completions of \"%s\"]" pattern)) ! (message "Can't find completion for \"%s\"" pattern)) (ding)) ((not (string= pattern completion)) (delete-region beg end) Index: lisp/simple.el =================================================================== RCS file: /sources/emacs/emacs/lisp/simple.el,v retrieving revision 1.906 diff -c -r1.906 simple.el *** lisp/simple.el 14 Mar 2008 17:42:16 -0000 1.906 --- lisp/simple.el 15 Mar 2008 21:35:59 -0000 *************** *** 1012,1017 **** --- 1012,1018 ---- ;; Initialize read-expression-map. It is defined at C level. (let ((m (make-sparse-keymap))) (define-key m "\M-\t" 'lisp-complete-symbol) + (define-key m "\t" 'lisp-complete-symbol) (set-keymap-parent m minibuffer-local-map) (setq read-expression-map m)) -- Juri Linkov http://www.jurta.org/emacs/