unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: paul r <paul.r.ml@gmail.com>, emacs- devel <emacs-devel@gnu.org>
Subject: Re: Usability suggestion : completion for M-:
Date: Sat, 15 Mar 2008 23:36:14 +0200	[thread overview]
Message-ID: <87hcf7r7vl.fsf@jurta.org> (raw)
In-Reply-To: <87ejaei4iz.fsf@stupidchicken.com> (Chong Yidong's message of "Thu, 13 Mar 2008 19:32:36 -0400")

>> 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/




  parent reply	other threads:[~2008-03-15 21:36 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 17:30 Usability suggestion : completion for M-: paul r
2008-03-13 18:04 ` Lennart Borgman (gmail)
2008-03-13 21:16 ` Drew Adams
2008-03-13 21:32   ` paul r
2008-03-13 21:45     ` Lennart Borgman (gmail)
2008-03-13 23:32 ` Chong Yidong
2008-03-13 23:49   ` Drew Adams
2008-03-21  5:21     ` Drew Adams
2008-03-14  8:52   ` paul r
2008-03-15 21:36   ` Juri Linkov [this message]
2008-03-15 23:35     ` Drew Adams
2008-03-15 23:43       ` Lennart Borgman (gmail)
2008-03-16  8:12         ` Drew Adams
2008-03-16 11:00           ` paul r
2008-03-16 11:21             ` Ralf Angeli
2008-03-16 16:52             ` Drew Adams
2008-03-16 12:27           ` Lennart Borgman (gmail)
2008-03-16 16:50             ` Drew Adams
2008-03-16  0:17       ` Juri Linkov
2008-03-16  8:11         ` Drew Adams
2008-03-16 10:48           ` Andreas Schwab
2008-03-16 12:22             ` Lennart Borgman (gmail)
2008-03-16 13:36               ` Andreas Schwab
2008-03-16 10:56           ` paul r
2008-03-16 16:49             ` Drew Adams
2008-03-16 18:42               ` paul r
2008-03-16 19:56                 ` Bastien
2008-03-16 20:22                   ` David De La Harpe Golden
2008-03-17  2:52                   ` Stefan Monnier
2008-03-17  4:07                     ` Mike Mattie
2008-03-17 13:32                       ` Stefan Monnier
2008-03-17  9:32                     ` paul r
2008-03-17 19:16                     ` Richard Stallman
2008-03-18  9:19                       ` paul r
2008-03-19  2:53                         ` Richard Stallman
2008-03-19 16:28                           ` Stefan Monnier
2008-03-19 18:16                             ` paul r
2008-03-19 19:25                               ` Andreas Schwab
2008-03-16 18:49               ` paul r
2008-03-16 12:31           ` Lennart Borgman (gmail)
2008-03-16 16:50             ` Drew Adams
2008-03-16 20:06         ` Bastien Guerry
2008-03-22 21:14     ` Chong Yidong
2008-03-23  2:30       ` Juri Linkov
2008-03-23  5:54         ` Drew Adams
2008-04-09 20:42 ` Paul R
2008-04-09 21:20   ` Drew Adams
2008-04-10 23:12     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hcf7r7vl.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=paul.r.ml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).