unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: emacs-devel@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: global-set-key has no effect for iswitchb-buffer
Date: Fri, 09 Mar 2007 19:28:54 +0100	[thread overview]
Message-ID: <v9y7m6qnix.fsf@marauder.physik.uni-ulm.de> (raw)

Hi,

I have iswitchb-mode enabled.  But occasionally I want to use the
plain `switch-to-buffer' command which I have bound to `C-c b b'.
Recently (well, I haven't updated from CVS for a while) this stopped
to work: `C-c b b' also calls `iswitchb-buffer'.

To reproduce:

$ emacs -Q -eval '
(progn
  (iswitchb-mode 1)
  (global-set-key (kbd "C-c b b") (quote switch-to-buffer)))
'

- C-c b b

- Expected prompt: Switch to buffer (...)
  Actual prompt:   iswitch {*Messages*,*scratch*}

Reverting Stephan's patch (see below) fixed the problem.  But I'm not
sure if this change was installed fix some other bug.

2007-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>

	* iswitchb.el (iswitchb-global-map): Use command-remapping if available.

--8<---------------cut here---------------start------------->8---
--- iswitchb.el	17 Mar 2006 21:29:33 -0000	1.67
+++ iswitchb.el	3 Jan 2007 03:37:15 -0000	1.68
@@ -1,7 +1,7 @@
 ;;; iswitchb.el --- switch between buffers using substrings
 
 ;; Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Stephen Eglen <stephen@gnu.org>
 ;; Maintainer: Stephen Eglen <stephen@gnu.org>
@@ -495,14 +495,13 @@
 
 (defvar iswitchb-global-map
   (let ((map (make-sparse-keymap)))
-    (substitute-key-definition 'switch-to-buffer ; normally C-x b
-			       'iswitchb-buffer map global-map)
-    (substitute-key-definition 'switch-to-buffer-other-window ; C-x 4 b
-			       'iswitchb-buffer-other-window map global-map)
-    (substitute-key-definition 'switch-to-buffer-other-frame ; C-x 5 b
-			       'iswitchb-buffer-other-frame map global-map)
-    (substitute-key-definition 'display-buffer ; C-x 4 C-o
-			       'iswitchb-display-buffer map global-map)
+    (dolist (b '((switch-to-buffer . iswitchb-buffer)
+                 (switch-to-buffer-other-window . iswitchb-buffer-other-window)
+                 (switch-to-buffer-other-frame . iswitchb-buffer-other-frame)
+                 (display-buffer . iswitchb-display-buffer)))
+      (if (fboundp 'command-remapping)
+          (define-key map (vector 'remap (car b)) (cdr b))
+        (substitute-key-definition (car b) (cdr b) map global-map)))
     map)
   "Global keymap for `iswitchb-mode'.")
 
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

             reply	other threads:[~2007-03-09 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 18:28 Reiner Steib [this message]
2007-03-09 23:36 ` global-set-key has no effect for iswitchb-buffer Kim F. Storm
2007-03-24 12:13   ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9y7m6qnix.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).