emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Entering filenames with spaces


From: David Reitter
Subject: Re: Entering filenames with spaces
Date: Mon, 14 Nov 2005 11:18:16 +0000

On 7 Nov 2005, at 15:34, Richard M. Stallman wrote:

It is pleasingly simple.  I have a few comments on details.

+ initial_define_key (Vminibuffer_local_filename_completion_map, '\t',
    +                 "minibuffer-complete");
+ initial_define_key (Vminibuffer_local_filename_completion_map, '?',
                          "minibuffer-completion-help");

I think it would be cleaner to use Vminibuffer_local_completion_map
as this map's parent, and override only the SPC character.


I take it that's done by binding it to self-insert-command, as in the new version below. I can re-send the patch as attachment (with an unpleasant encoding) if needed.



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       14 Nov 2005 11:16:16 -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,
***************
*** 2918,2923 ****
--- 2920,2928 ----
                      "minibuffer-complete-word");
    initial_define_key (Vminibuffer_local_completion_map, '?',
                      "minibuffer-completion-help");
+
+   initial_define_key (Vminibuffer_local_filename_completion_map, ' ',
+                     "self-insert-command");

    initial_define_key (Vminibuffer_local_must_match_map, Ctl ('m'),
                      "minibuffer-complete-and-exit");
Index: src/keymap.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/keymap.c,v
retrieving revision 1.308
diff -c -r1.308 keymap.c
*** src/keymap.c        9 Nov 2005 07:48:38 -0000       1.308
--- src/keymap.c        14 Nov 2005 11:16:16 -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;
***************
*** 3780,3785 ****
--- 3783,3796 ----
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_completion_map);
+

DEFVAR_LISP ("minibuffer-local-must-match-map", &Vminibuffer_local_must_match_map, doc: /* Local keymap for minibuffer input with completion, for exact match. */);
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      14 Nov 2005 11:16:16 -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;







reply via email to

[Prev in Thread] Current Thread [Next in Thread]