From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jan Synacek Newsgroups: gmane.emacs.help Subject: Re: Documentation for overriding-terminal-local-map is confusing? Date: Mon, 25 May 2020 18:38:56 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11172"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 25 18:39:33 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 1jdG8S-0002nK-HO for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 18:39:32 +0200 Original-Received: from localhost ([::1]:32782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdG8R-0002kK-L5 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 12:39:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdG89-0002k8-Mk for help-gnu-emacs@gnu.org; Mon, 25 May 2020 12:39:13 -0400 Original-Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52133 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdG88-0000Nu-7e for help-gnu-emacs@gnu.org; Mon, 25 May 2020 12:39:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590424751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lo/L1TlJ289C9TecoOaLeHYg6HCgSEwVBJ2Q81ct304=; b=Ob50Tj67MUPJxMJqD+tZbCurLjk/yHnz3CXaMMC8QUUNbEd2lnAaIHGwUKA0NLbUAksq2S LvbcgQYFsxqUUkKYL8vBQMWhYDzUjUE7Fdz/9QgxqumGNSAM0vbxNb0Q74um51/cpB4dgE 11JKqvlg/2g790QXqozSztkky8Fh+P4= Original-Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-86-9YNwBHqgNNGOHFwcwwb-3g-1; Mon, 25 May 2020 12:39:09 -0400 X-MC-Unique: 9YNwBHqgNNGOHFwcwwb-3g-1 Original-Received: by mail-lj1-f200.google.com with SMTP id f25so644897ljo.14 for ; Mon, 25 May 2020 09:39:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lo/L1TlJ289C9TecoOaLeHYg6HCgSEwVBJ2Q81ct304=; b=quwGAzgleii9OwXVmj7b+FJ1s+aRxRcFFtxTaIb+sygm54AAyOTkrBLMymExmYJhSd eROESbP0B9z1WKOBTnGcmabG3C9Hf0tCfXv0WKtZfdzsk5cpVtmjCpgAtp22l9BQ68/+ oPw3YgOvSj3BEE6Ll0ivPANbxpGr2Ie/LaZCjj/vjXVOZmFcqJQuj50p0CHHZjHiOA6p MTZHYCr5vEBlTaf5RjYKrDzwfkbD71OAckSUdhws7LiZ1QB0cNiVYWTUnQZAQ77fnMGv UcfWc7gtzRiofDQKnJO+9EHPes5JXEZtPs1iyzq5ApxWn13amn7YTN0Y/aiZxLY6ckqT Wt7Q== X-Gm-Message-State: AOAM530QfyBjZNuGA7YJAqpx8Cy7BT7KH60j43excq8fvQRPUL5SwZBq r7b7i21nuYEOXbpPenHqK/WhhfXM+Dhz1w/QWUYtxxFD4iGTjwZDeTiba2tSzrWoaBQe03pSZsn iMS9QG+MAUCz7Bom/WZ5IKJ8Nz8wMsjnU X-Received: by 2002:a05:651c:303:: with SMTP id a3mr3416424ljp.414.1590424747717; Mon, 25 May 2020 09:39:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdi7fGubRNK53GhJ5R5Lt6EL+aKjITxa8Lc8C9NM9XdR0gFdqq2Ic7QZ6d2WiWv35FHKLlD20ttuqO5bnWq7I= X-Received: by 2002:a05:651c:303:: with SMTP id a3mr3416412ljp.414.1590424747403; Mon, 25 May 2020 09:39:07 -0700 (PDT) In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=jsynacek@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 01:44:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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:123129 Archived-At: On Mon, May 25, 2020 at 4:08 PM Stefan Monnier wrote: > > > 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. Yes, that's what also came to my mind. And that's actually fine. But, I still think that the manual could be improved in this regard a bit. > > 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, ...) I see. Thank you, -- Jan Synacek Software Engineer, Red Hat