emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ergoemacs-mode 10007d2 64/87: Preserve the behavior of


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 10007d2 64/87: Preserve the behavior of 'space' when rebinding inside a minibuffer
Date: Wed, 14 Apr 2021 18:47:09 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 10007d278575e7156b6d74f5578170c8432166f2
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>

    Preserve the behavior of 'space' when rebinding inside a minibuffer
    
    In minibuffers, the usual binding for 'space' is 'complete-word.  When
    completing filenames, it is overriden to allow literal spaces.  This
    fix preserves that override.
    
    Fixes #471
---
 ergoemacs-map.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ergoemacs-map.el b/ergoemacs-map.el
index 15a1040..1e758cd 100644
--- a/ergoemacs-map.el
+++ b/ergoemacs-map.el
@@ -1023,7 +1023,12 @@ When INI is non-nil, add conditional maps to 
`minor-mode-map-alist'."
         (use-local-map (ergoemacs current-local-map))
         (setq ergoemacs-map--breadcrumb ""))
        (when (and (minibufferp) ergoemacs-read-from-minibuffer-map)
-        (use-local-map (ergoemacs ergoemacs-read-from-minibuffer-map))
+         ;; Preserve bindings for space, such as when completing a filename
+         (if (and (equal (key-binding " ") 'self-insert-command))
+             (use-local-map (list 'keymap
+                                  '(32 . self-insert-command) ;; space==32
+                                  (ergoemacs 
ergoemacs-read-from-minibuffer-map)))
+           (use-local-map (ergoemacs ergoemacs-read-from-minibuffer-map)))
         (setq ergoemacs-read-from-minibuffer-map nil
               ergoemacs-map--breadcrumb ""))
        ;; Run deferred "hooks"



reply via email to

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