From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Adding refactoring capabilities to Emacs Date: Sun, 1 Oct 2023 05:07:54 -0700 Message-ID: References: <83fs4f36wi.fsf@gnu.org> <8408fa63-af93-ab36-8524-fa12de7918ea@gutov.dev> <87pm25qck5.fsf@posteo.net> <83a5t51d21.fsf@gnu.org> <87jzs95fh5.fsf@gmail.com> 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="15498"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Robert Pluim , Eli Zaretskii , "Alfred M. Szmidt" , drew.adams@oracle.com, dmitry@gutov.dev, philipk@posteo.net, emacs-devel@gnu.org To: Stefan Monnier , =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 01 14:09:15 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qmvG5-0003ep-C5 for ged-emacs-devel@m.gmane-mx.org; Sun, 01 Oct 2023 14:09:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmvF3-0005dP-Hc; Sun, 01 Oct 2023 08:08:10 -0400 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 1qmvEx-0005dC-0b for emacs-devel@gnu.org; Sun, 01 Oct 2023 08:08:03 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmvEu-00026L-6r; Sun, 01 Oct 2023 08:08:01 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50336768615so25440640e87.0; Sun, 01 Oct 2023 05:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696162075; x=1696766875; darn=gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=/QNT08wfUY75ngIavKtL4PXOLxTHtU/VV9ymyVDrM1Q=; b=B92QkRLzANzJx2EwblMQDPh6iiZkhpk8DDORdoHTZsAHUHDr0T7r3JdJJuX963fpO4 ngVtlr8ZMHEjL/ClvnBLKcOlzNs1jVN+R2qDeEEiD2BrRG0bNc8WwY9bE4DLfJ6iJ14K 2FKxYfiB7FnYNMi00DZMuiXY3Y8FkBFmV+2ReN9TRqDAo9mA9Dif3yN5hYaocRKfRXBM pl5j9ZDr7rQxQX+z6s/RpLBorftg0OQFNvrsPmKDdG01vZni7is15rGKQbbTDMRRHbqx w6LM2wVQxumxeI7qO5cnjJXecWW/KVPst8ZtJErQH2v+1T7iPGfdbK1s3UOjPHpH9JgT 0cdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696162075; x=1696766875; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/QNT08wfUY75ngIavKtL4PXOLxTHtU/VV9ymyVDrM1Q=; b=LUGXjqThb0T8Bou48oQs+giHbyEy62AF3EvsJmwWmyZX93IxzjnuchGGJfRUELyQBo e5/j4BdvCNXTcI5GnJh2Ynmhe3cLR60B9+jbkbeCbg7VBxBjZjfnhg/4kzAvHfw/77UC oUodqsj9bk7HKsLlkulZ1QSt4UU+GOJAp7rN3TNAQh4KyMrPT9Ds5zICF/VXrhrGuEhi olSS02KcEdKzk0VipipDU293GjjMxU5q67dtnZLc6agHUQxpicH6N/h31k9FmTb54Gx3 34GIW+SztYhH0c83OkgwtD106/Vq94VFJEjLLaU3wtjvnZaEwerdTqxxxNeN9N5H7Ovo nQTQ== X-Gm-Message-State: AOJu0Ywkzs3VWdNAiznovCwXiWacZGhzNvlsN9+Ez6Yc685ZXsj5x1tI j1yAbOvJ9f4VlDAashZ3oUrPpDQYC/LC1JHPC7E= X-Google-Smtp-Source: AGHT+IGyi32ZNhlqHIsG0NgTIg6sOSuFymZwb05d3/7jtynp4s2wmTxR+xHrGA4BZUjGzX7MONKwi55SdeSciFvs1XI= X-Received: by 2002:a05:6512:55c:b0:4ff:7f7f:22e7 with SMTP id h28-20020a056512055c00b004ff7f7f22e7mr6852668lfl.17.1696162075247; Sun, 01 Oct 2023 05:07:55 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 1 Oct 2023 05:07:54 -0700 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=stefankangas@gmail.com; helo=mail-lf1-x12a.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311218 Archived-At: Stefan Monnier writes: >>> > We should "merge" `C-x C-q` and `e`, indeed, like we do for Dired. >>> Yes, and isn't a buffer-local value for read-only-mode-hook the >>> suitable way to fix that? > > I must admit I haven't looked at what the implementation > would/should/could look like. > >> For context, I'm asking because I don't think rebinding `C-x C-q` >> to a different command (like in the case of Dired) is as good >> as using the existing hook. It should be much more consistent >> to use the standard facilities of the existing minor mode. > > In general, I agree. There are degrees, tho. > E.g. Dired doesn't touch `C-x C-q`, strictly speaking, instead it remaps > `read-only-mode` which is much cleaner already. Agreed. But until someone cleans that up, perhaps we're already making progress if we install this simple change? diff --git a/lisp/replace.el b/lisp/replace.el index 6b06e48c384..b40843da141 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1315,6 +1315,7 @@ occur-mode-map (define-key map "r" 'occur-rename-buffer) (define-key map "c" 'clone-buffer) (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) + (define-key map [remap read-only-mode] #'occur-edit-mode) (bindings--define-key map [menu-bar occur] (cons "Occur" occur-menu-map)) map) "Keymap for `occur-mode'.")