From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Evgeni Pandurski Newsgroups: gmane.emacs.bugs Subject: bug#60815: 28.2; Hard-coded M-sff key binding in dired-aux.el Date: Tue, 17 Jan 2023 21:01:43 +0200 Message-ID: References: <83fscd6l0v.fsf@gnu.org> <83edrx6jah.fsf@gnu.org> <86tu0p6wrc.fsf@mail.linkov.net> <86tu0p0zi3.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21361"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60815@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 18 02:48:29 2023 Return-path: Envelope-to: geb-bug-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 1pHxYz-0005OO-9A for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Jan 2023 02:48:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHxYb-0005Cu-IT; Tue, 17 Jan 2023 20:48:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHxYY-00057d-Lm for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 20:48:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHxYY-0007iD-Cr for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 20:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pHxYY-0007k2-90 for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 20:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Evgeni Pandurski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jan 2023 01:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60815 X-GNU-PR-Package: emacs Original-Received: via spool by 60815-submit@debbugs.gnu.org id=B60815.167400643029573 (code B ref 60815); Wed, 18 Jan 2023 01:48:02 +0000 Original-Received: (at 60815) by debbugs.gnu.org; 18 Jan 2023 01:47:10 +0000 Original-Received: from localhost ([127.0.0.1]:38711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHxXi-0007gp-5k for submit@debbugs.gnu.org; Tue, 17 Jan 2023 20:47:10 -0500 Original-Received: from mail-qv1-f42.google.com ([209.85.219.42]:44966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHrDc-0000yQ-Pe for 60815@debbugs.gnu.org; Tue, 17 Jan 2023 14:02:04 -0500 Original-Received: by mail-qv1-f42.google.com with SMTP id y8so22213925qvn.11 for <60815@debbugs.gnu.org>; Tue, 17 Jan 2023 11:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=X+CvK8aduCl22DCA3WSvtfSKx4lkyP7XBTxJZNkXtT4=; b=fSbwSVmU589m14jCPfDmk8TSwWAueO3Uip1uW0undBt/DfeLRvejXwYp0XAbknSh8a Z8Afzbbhm7tPQ6Y1C37op3dNCcCfMpJDgu5BxKnYp+OjsEoxYv9mJdJxj4nJ0KBEkwNB g0Ste2s8njEZLiF+mfWCRoorxK9b4YJB4lgq2ZRlo5IxU/lEx7YinsnqE+pV3/rAeuRq 6OwKT6T7+2AKPHbl6xfv9Jvs3F1OYozg5jrbp2LZ4LXbX2fxobvN9JsNG7NM4jgEz9ua RaznrGynI6LT0NTzqJY07CmwrrJ7pt/ck70D6iGYuE0CbTBY3RXRYnW8MoL9Not2k/ej MI/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X+CvK8aduCl22DCA3WSvtfSKx4lkyP7XBTxJZNkXtT4=; b=M35b2r/NtPzysOIkzvSuwXHEuUkQmCWuRC6oQmSpzG6inBcJ+8PZosX0V4KaFHT5kQ 1yrbP0l7ST7HI3et9Nuv8zXxJRH+bznZPRs063cVTiDv0FITnOQoG+uzleAGor1Pzv5r 9h0fCoFegTDp4dFFhVX+GCK22Eunu9fb4By+a0oJz8VG+rhA9s2hQtftXsoJebeN/2OD c4Vj8Hcv+hvfeeJo1WXPT1nnX7JSzLGndOwY1iz/tGF9E1ZeWE5ymdlmIYeDxjf62J1L w2rfN7y6sfKvSE4d/Z0nNulhbrA/C3PkNetjX4Qhmpj4hHusxysai3WeAoRQ0l+u+vYF 6hRA== X-Gm-Message-State: AFqh2kqXb96YyWX0Ud2dIkgIQNrBuBRJo/QC6NWdsuwz7tZEUEVwUP5/ YZNfQOnjlArrfoEprgDPKkPqxTjOUP98Eudgr6rRcNi1VYk= X-Google-Smtp-Source: AMrXdXu2p38TB5m4kRONK96bG3UMD4QR/qGl7FT/LhJlMnepi9msLKi8T1P+zK7C47uqlFd7dOUY5RVZvPt08SJ3Rl4= X-Received: by 2002:a05:6214:3b0e:b0:535:1bee:c81b with SMTP id nm14-20020a0562143b0e00b005351beec81bmr199314qvb.66.1673982114893; Tue, 17 Jan 2023 11:01:54 -0800 (PST) In-Reply-To: <86tu0p0zi3.fsf@mail.linkov.net> X-Mailman-Approved-At: Tue, 17 Jan 2023 20:47:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253598 Archived-At: Thanks. The problem that remains is that I should do the equivalent of: (define-key isearch-mode-map [f6] isearch-mode-search-map) (define-key isearch-mode-map (kbd "M-s") other-window) for several other minor (and probably some minor modes). To name a few: minibuffer-local-map, Buffer-menu-mode-map, and dired-mode-map all shadow my M-s redefinition, and I can not go to other window in these modes. It would be very nice if those major modes are more clever, clever when overriding global bindings. On Tue, Jan 17, 2023 at 8:49 PM Juri Linkov wrote: > > reopen 60815 > thanks > > >> Then I guess this report can be closed, done. > > > > I think so. Your patch would allow me to just change the value of > > dired-isearch-filenames-toggle-key, instead of monkey-patching the > > whole function in my .emacs. > > > > But it seems that some key-bindings are much harder to change than > > another. "M-s", is such an example, because many modes decide to > > override it in their keymaps. Just an idea: Wouldn't it be nice, if > > there were an configuration that defines what is the key sequence for > > "the M-s search" (M-s by default), and if major modes want to override > > the "M-s search commands", they would respect what the configuration > > says. > > Indeed, there is already such variable: `search-map'. So you can do: > > (define-key global-map [f6] search-map) > > > For example, If I rebind "M-s" to say "M-6", then the > > dired-isearch-filenames-setup function would define the "M-6ff" > > binding, instead of "M-sff". I am not sure if this is a good idea, but > > this seems like a good approach to me. > > > > So basically, I propose, instead of the > > "dired-isearch-filenames-toggle-key" configuration ("M-sfff by > > default), to have, say "global-search-key-sequence" ("M-s" by > > default), which all major modes can use when building their local > > keymaps. This way, I would not need to fix this binding in every major > > mode which overrides it, wrongly believing that M-s is my "search > > prefix". > > The problem is that isearch doesn't use the global "M-s" keymap, > but hard-codes "M-s" used in isearch-map. The patch below adds > a new variable for the isearch's keymap "M-s" that you can > customize with e.g.: > > (define-key isearch-mode-map [f6] isearch-mode-search-map) > > Needless to say this patch is for master. >