unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Configure SPACE as file auto-complete character
@ 2007-12-17  2:46 Bruza
  2007-12-17  9:48 ` Jason Rumney
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Bruza @ 2007-12-17  2:46 UTC (permalink / raw)
  To: help-gnu-emacs

I just installed emacs 22.1.1 GTK on Ubuntu. The first thing I noticed
is that the auto filename completion key in the min-buffer is not
SPACE anymore. I need to use TAB instead. Is there a way I can
configure SPACE as the filename auto-complete character?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-17  2:46 Configure SPACE as file auto-complete character Bruza
@ 2007-12-17  9:48 ` Jason Rumney
  2007-12-17 20:28 ` Eli Zaretskii
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Jason Rumney @ 2007-12-17  9:48 UTC (permalink / raw)
  To: help-gnu-emacs

Bruza wrote:
> I just installed emacs 22.1.1 GTK on Ubuntu. The first thing I noticed
> is that the auto filename completion key in the min-buffer is not
> SPACE anymore. I need to use TAB instead. Is there a way I can
> configure SPACE as the filename auto-complete character?

C-h n
C-s space

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-17  2:46 Configure SPACE as file auto-complete character Bruza
  2007-12-17  9:48 ` Jason Rumney
@ 2007-12-17 20:28 ` Eli Zaretskii
  2007-12-17 21:10 ` Sebastian Tennant
  2007-12-18 15:38 ` rob wahoo
  3 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2007-12-17 20:28 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Bruza <benruza@gmail.com>
> Date: Sun, 16 Dec 2007 18:46:36 -0800 (PST)
> 
> I just installed emacs 22.1.1 GTK on Ubuntu. The first thing I noticed
> is that the auto filename completion key in the min-buffer is not
> SPACE anymore.

This is so you could use file names with spaces.

> Is there a way I can configure SPACE as the filename auto-complete
> character?

See this entry in NEWS (and the one it refers to):

  ** When Emacs prompts for file names, SPC no longer completes the file name.
  This is so filenames with embedded spaces could be input without the
  need to quote the space with a C-q.  The underlying changes in the
  keymaps that are active in the minibuffer are described below under
  "New keymaps for typing file names".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-17  2:46 Configure SPACE as file auto-complete character Bruza
  2007-12-17  9:48 ` Jason Rumney
  2007-12-17 20:28 ` Eli Zaretskii
@ 2007-12-17 21:10 ` Sebastian Tennant
  2007-12-17 22:03   ` Drew Adams
  2007-12-18 15:38 ` rob wahoo
  3 siblings, 1 reply; 11+ messages in thread
From: Sebastian Tennant @ 2007-12-17 21:10 UTC (permalink / raw)
  To: help-gnu-emacs

Quoth Bruza <benruza@gmail.com>:
> I just installed emacs 22.1.1 GTK on Ubuntu. The first thing I noticed
> is that the auto filename completion key in the min-buffer is not
> SPACE anymore. I need to use TAB instead. Is there a way I can
> configure SPACE as the filename auto-complete character?

C-h n C-s space:

 ** When Emacs prompts for file names, SPC no longer completes the file name.
 This is so filenames with embedded spaces could be input without the
 need to quote the space with a C-q.  The underlying changes in the
 keymaps that are active in the minibuffer are described below under
 "New keymaps for typing file names".

Interesting... I've had the following line in my ~/.emacs for quite a
while for precisely this reason:

;;; disable 'SPC' completion in minibuffer
(substitute-key-definition 'minibuffer-complete-word 'self-insert-command minibuffer-local-completion-map)

However, I believe my substitution disables auto-completion across the
board, not just file name auto-completion.

Sebastian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Configure SPACE as file auto-complete character
  2007-12-17 21:10 ` Sebastian Tennant
@ 2007-12-17 22:03   ` Drew Adams
  0 siblings, 0 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-17 22:03 UTC (permalink / raw)
  To: Sebastian Tennant, help-gnu-emacs

> Interesting... I've had the following line in my ~/.emacs for quite a
> while for precisely this reason:
>
> ;;; disable 'SPC' completion in minibuffer
> (substitute-key-definition 'minibuffer-complete-word
> 'self-insert-command minibuffer-local-completion-map)
>
> However, I believe my substitution disables auto-completion across the
> board, not just file name auto-completion.

And that's a good thing, IMO.  I doubt that you regret it.

Completion using `completing-read' is general; there is nothing that
suggests that it should be mainly for text that doesn't contain spaces. Why
does Emacs limit space self-insertion to file-name completion?

Thank goodness for at least that change. It was due at least in part to the
widespread use of MS Windows (and also to the fact that word-by-word
completion is not so useful).

FWIW - In Icicles, each of these characters self-inserts in the minibuffer:
`?', `C-j' (newline), and `SPC' - regardless of the input type. You can
still do word-by-word completion, using `M-SPC' (configurable), but I'm sure
that any use of word-by-word completion is rare.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
       [not found] <mailman.5130.1197929124.18990.help-gnu-emacs@gnu.org>
@ 2007-12-18  5:13 ` Bruza
  2007-12-18  6:52   ` Klaus Zeitler
  2007-12-18 14:17   ` Sebastian Tennant
  0 siblings, 2 replies; 11+ messages in thread
From: Bruza @ 2007-12-18  5:13 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: benkial

But, back to my original question, if I like to keep the SPACE as the
file
auto-complete character, how can I configure it back to the pre-
version 22
behavior?

Thanks,

Ben

On Dec 17, 2:03 pm, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > Interesting... I've had the following line in my ~/.emacs for quite a
> > while for precisely this reason:
>
> > ;;; disable 'SPC' completion in minibuffer
> > (substitute-key-definition 'minibuffer-complete-word
> > 'self-insert-command minibuffer-local-completion-map)
>
> > However, I believe my substitution disables auto-completion across the
> > board, not just file name auto-completion.
>
> And that's a good thing, IMO.  I doubt that you regret it.
>
> Completion using `completing-read' is general; there is nothing that
> suggests that it should be mainly for text that doesn't contain spaces. Why
> does Emacs limit space self-insertion to file-name completion?
>
> Thank goodness for at least that change. It was due at least in part to the
> widespread use of MS Windows (and also to the fact that word-by-word
> completion is not so useful).
>
> FWIW - In Icicles, each of these characters self-inserts in the minibuffer:
> `?', `C-j' (newline), and `SPC' - regardless of the input type. You can
> still do word-by-word completion, using `M-SPC' (configurable), but I'm sure
> that any use of word-by-word completion is rare.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-18  5:13 ` Bruza
@ 2007-12-18  6:52   ` Klaus Zeitler
  2007-12-18 14:17   ` Sebastian Tennant
  1 sibling, 0 replies; 11+ messages in thread
From: Klaus Zeitler @ 2007-12-18  6:52 UTC (permalink / raw)
  To: help-gnu-emacs

Hello Ben,
>>>>> "Bruza" == Bruza  <benruza@gmail.com> writes:
    Bruza> 
    Bruza> if I like to keep the SPACE as the file auto-complete
    Bruza> character, how can I configure it back to the pre- version 22
    Bruza> behavior?

Yes that change is a real pain. I guess I need a space in a filename
about once or twice a year here in our Solaris/GNU Linux environment. I
wish there was an option to switch back to the original behavior or even
better this change would be the default for Microsoft users only.

Here's what I added to my .emacs file:

(if (>= emacs-major-version 22)
    (if partial-completion-mode
	(progn
	  (define-key minibuffer-local-must-match-filename-map
	    (kbd "SPC") 'PC-complete-word)
	  (define-key minibuffer-local-filename-completion-map
	    (kbd "SPC") 'PC-complete-word))
      (define-key minibuffer-local-must-match-filename-map
	(kbd "SPC") 'minibuffer-complete-word)
      (define-key minibuffer-local-filename-completion-map
	(kbd "SPC") 'minibuffer-complete-word)))

HTH
Klaus

-- 
 -------------------------------------
|  Klaus Zeitler      Alcatel-Lucent  |
 -------------------------------------
---
The difference between a fool and a wise man is not
the things they know, it's the questions they ask.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-18  5:13 ` Bruza
  2007-12-18  6:52   ` Klaus Zeitler
@ 2007-12-18 14:17   ` Sebastian Tennant
  2007-12-18 15:30     ` Drew Adams
  1 sibling, 1 reply; 11+ messages in thread
From: Sebastian Tennant @ 2007-12-18 14:17 UTC (permalink / raw)
  To: help-gnu-emacs

Quoth Bruza <benruza@gmail.com>:
> But, back to my original question, if I like to keep the SPACE as the
> file
> auto-complete character, how can I configure it back to the pre-
> version 22
> behavior?

Ah!  Yes... good question.... Drew?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Configure SPACE as file auto-complete character
  2007-12-18 14:17   ` Sebastian Tennant
@ 2007-12-18 15:30     ` Drew Adams
  0 siblings, 0 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-18 15:30 UTC (permalink / raw)
  To: Sebastian Tennant, help-gnu-emacs

> > But, back to my original question, if I like to keep the SPACE as the
> > file auto-complete character, how can I configure it back to the pre-
> > version 22 behavior?
>
> Ah!  Yes... good question.... Drew?

I thought someone had answered that already. The Emacs NEWS - or more
likely, the Emacs manual Anti-News, should explain that. At least the NEWS
mentions that this is controlled in the file-name completion maps (which are
new with Emacs 22, mainly to accommodate the fact that they didn't want this
space change also for non-file-name completion). It says this, which is
correct but perhaps not sufficiently clear:

 "The underlying changes in the keymaps that are active in the
  minibuffer are described below under `New keymaps for typing
  file names'."

Anyway, Klaus has now shown you how - you just need to change the binding of
the space character in the file-name completion maps.

[For Icicles: Space completion a word at a time is determined by option
`icicle-word-completion-keys' - just set it to the key(s) you want for that.
And if you don't want space to complete a word at a time, but you also don't
want space to self-insert, then do the same thing that Klaus showed, but for
all minibuffer completion keymaps.]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-17  2:46 Configure SPACE as file auto-complete character Bruza
                   ` (2 preceding siblings ...)
  2007-12-17 21:10 ` Sebastian Tennant
@ 2007-12-18 15:38 ` rob wahoo
  2007-12-21 23:16   ` Bruza
  3 siblings, 1 reply; 11+ messages in thread
From: rob wahoo @ 2007-12-18 15:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Dec 16, 9:46 pm, Bruza <benr...@gmail.com> wrote:
> I just installed emacs 22.1.1 GTK on Ubuntu. The first thing I noticed
> is that the auto filename completion key in the min-buffer is not
> SPACE anymore. I need to use TAB instead. Is there a way I can
> configure SPACE as the filename auto-complete character?

;;============================================================
;; minibuffer space completion
;;============================================================
(define-key minibuffer-local-filename-completion-map (kbd "SPC")
        'minibuffer-complete-word)

(define-key minibuffer-local-must-match-filename-map (kbd "SPC")
        'minibuffer-complete-word)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Configure SPACE as file auto-complete character
  2007-12-18 15:38 ` rob wahoo
@ 2007-12-21 23:16   ` Bruza
  0 siblings, 0 replies; 11+ messages in thread
From: Bruza @ 2007-12-21 23:16 UTC (permalink / raw)
  To: help-gnu-emacs

On Dec 18, 7:38 am, rob wahoo <robchris...@gmail.com> wrote:
> On Dec 16, 9:46 pm,Bruza<benr...@gmail.com> wrote:
>
> > I just installed emacs 22.1.1 GTK on Ubuntu. The first thing I noticed
> > is that the auto filename completion key in the min-buffer is not
> > SPACE anymore. I need to use TAB instead. Is there a way I can
> > configure SPACE as the filename auto-complete character?
>
> ;;============================================================
> ;; minibuffer space completion
> ;;============================================================
> (define-key minibuffer-local-filename-completion-map (kbd "SPC")
>         'minibuffer-complete-word)
>
> (define-key minibuffer-local-must-match-filename-map (kbd "SPC")
>         'minibuffer-complete-word)

Thanks for all the help. I can now finally "claim" my SPACE back :-).

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-12-21 23:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-17  2:46 Configure SPACE as file auto-complete character Bruza
2007-12-17  9:48 ` Jason Rumney
2007-12-17 20:28 ` Eli Zaretskii
2007-12-17 21:10 ` Sebastian Tennant
2007-12-17 22:03   ` Drew Adams
2007-12-18 15:38 ` rob wahoo
2007-12-21 23:16   ` Bruza
     [not found] <mailman.5130.1197929124.18990.help-gnu-emacs@gnu.org>
2007-12-18  5:13 ` Bruza
2007-12-18  6:52   ` Klaus Zeitler
2007-12-18 14:17   ` Sebastian Tennant
2007-12-18 15:30     ` Drew Adams

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).