From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: Entering filenames with spaces Date: Sat, 5 Nov 2005 15:02:30 +0000 Message-ID: References: <70488FA4-561C-43F2-8B70-4A7017984282@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: multipart/mixed; boundary=Apple-Mail-40-424411072 X-Trace: sea.gmane.org 1131204795 27101 80.91.229.2 (5 Nov 2005 15:33:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 5 Nov 2005 15:33:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 05 16:33:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EYQ29-0004Y5-Vl for ged-emacs-devel@m.gmane.org; Sat, 05 Nov 2005 16:32:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYQ28-0004Mt-6u for ged-emacs-devel@m.gmane.org; Sat, 05 Nov 2005 10:32:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EYPZ3-0003gE-IY for emacs-devel@gnu.org; Sat, 05 Nov 2005 10:02:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EYPYy-0003et-Jp for emacs-devel@gnu.org; Sat, 05 Nov 2005 10:02:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYPYy-0003em-3h for emacs-devel@gnu.org; Sat, 05 Nov 2005 10:02:36 -0500 Original-Received: from [64.233.182.204] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EYPYx-0001kl-KV for emacs-devel@gnu.org; Sat, 05 Nov 2005 10:02:35 -0500 Original-Received: by nproxy.gmail.com with SMTP id o60so19151nfa for ; Sat, 05 Nov 2005 07:02:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:from:subject:date:to:x-mailer; b=pZCV6lXu3jUDCe2TCkzY1aOY0Jo7MDcg+iUFqkChoVdeSoyS0fodivXYxnS2eBdQHegQ1kBSka/zWoJhiAo86FKXrimKRCcZic6HYgsDTmbryV2gSzhL6Od8TGMo/MqZM0kKaZDKVimMGpLLJQHvTh9BUPycd72RuJnrvrueWM0= Original-Received: by 10.48.30.12 with SMTP id d12mr302021nfd; Sat, 05 Nov 2005 07:02:35 -0800 (PST) Original-Received: from ?10.0.0.34? ( [82.13.31.46]) by mx.gmail.com with ESMTP id p43sm1975860nfa.2005.11.05.07.02.30; Sat, 05 Nov 2005 07:02:31 -0800 (PST) In-Reply-To: Original-To: rms@gnu.org X-Mailer: Apple Mail (2.746.2) 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:45458 Archived-At: --Apple-Mail-40-424411072 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 19 Oct 2005, at 03:43, Richard M. Stallman wrote: > > Does a filename-minibuffer have an extra keymap? > > Not at present, but giving it its own keymap is the cleanest > way to do this job. OK, this is a simple patch now which allows for inputting spaces in filenames in the minibuffer, while keeping the binding of space to minibuffer-complete-word in other contexts. It introduces a new keymap, minibuffer-local-filename-completion-map. 2005-11-05 David Reitter * commands.h (Vminibuffer_local_filename_completion_map): declare a new keymap for minibuffer completion in case of filenames. * keymap.c (syms_of_keymap): Declare (Lisp) and make new keymap. * minibuf.c (completing-read): Use a new keymap when deadling with filenames. (keys_of_minibuf): initialize the new keymap. for etc/NEWS: ** Minibuffer changes: *** For filenames, Space is not bound to completion any longer Filenames with spaces can be input intuitively with the space bar now, space is not bound to `minibuffer-complete-word' any longer. A new key map minibuffer-local-filename-completion-map applies whenever a file name is prompted for. --Apple-Mail-40-424411072 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; x-mac-creator=454D4178; name="minibuffer-space.patch" Content-Disposition: attachment; filename=minibuffer-space.patch Index: src/minibuf.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/minibuf.c,v retrieving revision 1.290 diff -c -r1.290 minibuf.c *** src/minibuf.c 24 Oct 2005 16:22:15 -0000 1.290 --- src/minibuf.c 5 Nov 2005 01:30:56 -0000 *************** *** 1747,1753 **** XSETFASTINT (histpos, 0); val = read_minibuf (NILP (require_match) ! ? Vminibuffer_local_completion_map : Vminibuffer_local_must_match_map, init, prompt, make_number (pos), 0, histvar, histpos, def, 0, --- 1747,1755 ---- XSETFASTINT (histpos, 0); val = read_minibuf (NILP (require_match) ! ? (NILP (Vminibuffer_completing_file_name) ! ? Vminibuffer_local_completion_map ! : Vminibuffer_local_filename_completion_map) : Vminibuffer_local_must_match_map, init, prompt, make_number (pos), 0, histvar, histpos, def, 0, *************** *** 2917,2922 **** --- 2919,2929 ---- initial_define_key (Vminibuffer_local_completion_map, ' ', "minibuffer-complete-word"); initial_define_key (Vminibuffer_local_completion_map, '?', + "minibuffer-completion-help"); + + initial_define_key (Vminibuffer_local_filename_completion_map, '\t', + "minibuffer-complete"); + initial_define_key (Vminibuffer_local_filename_completion_map, '?', "minibuffer-completion-help"); initial_define_key (Vminibuffer_local_must_match_map, Ctl ('m'), Index: src/commands.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/commands.h,v retrieving revision 1.22 diff -c -r1.22 commands.h *** src/commands.h 7 Aug 2005 12:33:16 -0000 1.22 --- src/commands.h 5 Nov 2005 01:30:56 -0000 *************** *** 37,42 **** --- 37,45 ---- /* keymap used for minibuffers when doing completion */ extern Lisp_Object Vminibuffer_local_completion_map; + /* keymap used for minibuffers when doing completion in filenames*/ + extern Lisp_Object Vminibuffer_local_filename_completion_map; + /* keymap used for minibuffers when doing completion and require a match */ extern Lisp_Object Vminibuffer_local_must_match_map; Index: src/keymap.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/keymap.c,v retrieving revision 1.307 diff -c -r1.307 keymap.c *** src/keymap.c 12 Sep 2005 10:26:35 -0000 1.307 --- src/keymap.c 5 Nov 2005 01:30:57 -0000 *************** *** 65,70 **** --- 65,73 ---- /* was MinibufLocalCompletionMap */ Lisp_Object Vminibuffer_local_completion_map; + /* keymap used for minibuffers when doing completion in filenames */ + Lisp_Object Vminibuffer_local_filename_completion_map; + /* keymap used for minibuffers when doing completion and require a match */ /* was MinibufLocalMustMatchMap */ Lisp_Object Vminibuffer_local_must_match_map; *************** *** 3774,3779 **** --- 3777,3789 ---- doc: /* Local keymap for minibuffer input with completion. */); Vminibuffer_local_completion_map = Fmake_sparse_keymap (Qnil); Fset_keymap_parent (Vminibuffer_local_completion_map, Vminibuffer_local_map); + + DEFVAR_LISP ("minibuffer-local-filename-completion-map", &Vminibuffer_local_filename_completion_map, + doc: /* Local keymap for minibuffer input with completion for filenames. */); + Vminibuffer_local_filename_completion_map = Fmake_sparse_keymap (Qnil); + Fset_keymap_parent (Vminibuffer_local_filename_completion_map, + Vminibuffer_local_map); + DEFVAR_LISP ("minibuffer-local-must-match-map", &Vminibuffer_local_must_match_map, doc: /* Local keymap for minibuffer input with completion, for exact match. */); --Apple-Mail-40-424411072 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --Apple-Mail-40-424411072--