From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Documentation for overriding-terminal-local-map is confusing? Date: Mon, 25 May 2020 10:08:03 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="1601"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:d9tiMPfW2ReBUD76LGFllnWmL0U= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 25 16:08:54 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdDmd-0000Hz-Qm for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 16:08:51 +0200 Original-Received: from localhost ([::1]:37286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdDmc-0000na-RV for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 10:08:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdDm0-0000nG-6z for help-gnu-emacs@gnu.org; Mon, 25 May 2020 10:08:12 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:45224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdDlz-0003s5-KY for help-gnu-emacs@gnu.org; Mon, 25 May 2020 10:08:11 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jdDlx-000XS7-41 for help-gnu-emacs@gnu.org; Mon, 25 May 2020 16:08:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=159.69.161.202; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 10:08:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123128 Archived-At: > I currently have this piece of elisp in my init.el: > ... > (setf jsynacek-terminal-map (make-sparse-keymap)) > (setf overriding-terminal-local-map jsynacek-terminal-map) > (define-key jsynacek-terminal-map (kbd "C-b") 'ido-switch-buffer) > (define-key jsynacek-terminal-map (kbd "C-o") 'find-file) > ... > > It works until I use isearch-forward, which resets > overriding-terminal-local-map. It took me a while to figure out, > until I noticed this in "22.9 Controlling the Active Keymaps" in the > ELisp manual: I guess you're victim of the fact that the ELisp manual is not written for people editing their init.el but for people writing Elisp packages. > 2) What is the proper way to make my own keymap that overrides > everything? I know that the 'use-package/bind-key' package does this by > creating a minor mode and then using emulation-mode-map-alists, but the > variable's documentation doesn't even remotely suggest to use it that > way. emulation-mode-map-alists is meant for that, yes. (think of it as emulating the UI of an editor that binds C-b to switch-buffer, ...) Stefan