unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Switching from (ido-mode 'both) to (ido-mode 'buffer) doesn't work
@ 2005-05-18  3:58 Daniel Brockman
  2005-06-14  5:28 ` Daniel Brockman
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Brockman @ 2005-05-18  3:58 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

Steps to reproduce:

 1. M-: (ido-mode 'buffer)

 2. Note that C-x C-f is *not* bound to any ido stuff.

 3. M-: (ido-mode 'both)

 4. Note that C-x C-f *is* bound to ido stuff.

 5. M-: (ido-mode 'buffer)

 6. Note that C-x C-f is *still* bound to ido stuff.

Here's one solution:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1036 bytes --]

Index: ido.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ido.el,v
retrieving revision 1.55
diff -u -r1.55 ido.el
--- ido.el	5 May 2005 22:15:58 -0000	1.55
+++ ido.el	18 May 2005 03:49:17 -0000
@@ -1320,9 +1320,14 @@
 
     (add-hook 'kill-emacs-hook 'ido-kill-emacs-hook)
 
-    (unless ido-minor-mode-map-entry
-      (setq ido-minor-mode-map-entry (cons 'ido-mode (make-sparse-keymap)))
-      (add-to-list 'minor-mode-map-alist ido-minor-mode-map-entry))
+    (when ido-minor-mode-map-entry
+      (setq minor-mode-map-alist
+            (assq-delete-all 'ido-mode minor-mode-map-alist)))
+
+    ;; In case the user wants to switch from, e.g., 'both to 'buffer, always
+    ;; create a fresh keymap so that old bindings are not retained.
+    (setq ido-minor-mode-map-entry (cons 'ido-mode (make-sparse-keymap)))
+    (add-to-list 'minor-mode-map-alist ido-minor-mode-map-entry)
 
     (let ((map (cdr ido-minor-mode-map-entry)))
       (when (memq ido-mode '(file both))

[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


-- 
Daniel Brockman <daniel@brockman.se>

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2005-06-14 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18  3:58 [PATCH] Switching from (ido-mode 'both) to (ido-mode 'buffer) doesn't work Daniel Brockman
2005-06-14  5:28 ` Daniel Brockman
2005-06-14  6:00   ` Daniel Brockman
2005-06-14 15:09   ` Kim F. Storm
2005-06-14 15:19     ` Daniel Brockman

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