From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35577: find-file-read-only docstring old Date: Sun, 05 May 2019 09:19:36 -0400 Message-ID: <87bm0hm42f.fsf@gmail.com> References: <87ftptv01y.5.fsf@jidanni.org> <87ef5dm5uu.fsf@gmail.com> <87o94hcb6z.5.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50824"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35577@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 05 15:20:43 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hNH4K-000D43-Jd for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 May 2019 15:20:40 +0200 Original-Received: from localhost ([127.0.0.1]:41043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNH4J-0004ST-Hp for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 May 2019 09:20:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNH3k-0003zq-AZ for bug-gnu-emacs@gnu.org; Sun, 05 May 2019 09:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNH3j-0008AI-7b for bug-gnu-emacs@gnu.org; Sun, 05 May 2019 09:20:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNH3i-0008A6-VX for bug-gnu-emacs@gnu.org; Sun, 05 May 2019 09:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNH3i-0001pj-Lq for bug-gnu-emacs@gnu.org; Sun, 05 May 2019 09:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 May 2019 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35577 X-GNU-PR-Package: emacs Original-Received: via spool by 35577-submit@debbugs.gnu.org id=B35577.15570623877018 (code B ref 35577); Sun, 05 May 2019 13:20:02 +0000 Original-Received: (at 35577) by debbugs.gnu.org; 5 May 2019 13:19:47 +0000 Original-Received: from localhost ([127.0.0.1]:53226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNH3S-0001p3-Pp for submit@debbugs.gnu.org; Sun, 05 May 2019 09:19:47 -0400 Original-Received: from mail-qt1-f182.google.com ([209.85.160.182]:40881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNH3Q-0001oj-MU; Sun, 05 May 2019 09:19:45 -0400 Original-Received: by mail-qt1-f182.google.com with SMTP id k24so8072930qtq.7; Sun, 05 May 2019 06:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Z5P7kdpymaIXR7n6j7jPwnCNVbjKDvYBKUS8yeeL/ns=; b=DEZ8rRAetLad7tUwv9pm1gof1pOGILMZcs+KZXtSxbObInebzYiymR3w67S/NF50bi 7QtYFdgVMFQA3ZPBjHBeIwhKkeCqCKnPS21eBoQSfRN7zoqH5rrhTGvM+rPaxQHUdPvO M0qRY+OmltS9kOO9W5lRjjRe68q48Yqkciw4SKW58+5f1cudPl2HSs5cG/2NeCbV9vv5 jHaSrr3o+0dX5BZJHo1ewdqaAuwAK5D/LXyrVXmMYQiScuyUV3dM4upfht8gm74bwokv lmkl4V9SHrjwOWJ49MLZXzG6B0I7GQ151PxDgo7xZYHeFv58/O97JUoCqPKZzHpvgRF+ hqgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Z5P7kdpymaIXR7n6j7jPwnCNVbjKDvYBKUS8yeeL/ns=; b=QqrKj5NjwryFXe2UIUf7hSjjhOXPQzcEBdWDlDHgd3G8E+m21ukOykNqlZSb6tlO/d SzR9V3FdmObXgAr93XKNN5HxzjzgsHNccGDVIFF4Bd5WzJKAGF0emDWvHoI/5klTXGq0 p7mP090fMJ+ObiZjcN4gy7ED+INUIqyWGjrBmQz4Cmv4uNVSNXNsQ5XQ7ECbLIh+oj3A Bofb/jVTAmwFqwOrxEAph8Xi0KduW+Na17bBvl1cwVfrvgeVbBykwslDk8oBpbonmHI2 z/IiodMMo2K92Vi08eMabHUF2pGrLYqZ/bBpMxCjIKnbXp9VdqQzQPNMuIGIkFd0v53C q75A== X-Gm-Message-State: APjAAAV2nXKNlmKSCJaSXKovaPtlupcteagwVj5pxh5pI8S7BW6TYCU/ IYtrMkCyg6dplmWpkI37hB/4b+4z X-Google-Smtp-Source: APXvYqxdgBWqhxmpXJAjJnEkt5mdOLjEYUK4wh9WMfQfLSTdCgQ8wIu1rjEmLhgmjXjFNB05tjsHOA== X-Received: by 2002:ac8:440f:: with SMTP id j15mr12856171qtn.153.1557062378936; Sun, 05 May 2019 06:19:38 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id t63sm4380927qka.33.2019.05.05.06.19.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 May 2019 06:19:37 -0700 (PDT) In-Reply-To: <87o94hcb6z.5.fsf@jidanni.org> ("=?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson"'s message of "Sun, 05 May 2019 20:55:48 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158792 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable retitle 35577 ffap-commands causes find-file-read-only doc to display for find-file quit =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: > Oh, so that is a side effect of ffap-bindings. Hmmm. Ah, I see. I think using [rename CMD] works better and fixes this case (ido-mode uses this technique): --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Use-remapping-in-ffap-bindings-Bug-35577.patch Content-Description: patch >From 0713b2d8ad3e75339c573354212602e661d314af Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 5 May 2019 09:13:19 -0400 Subject: [PATCH] Use remapping in ffap-bindings (Bug#35577) * lisp/ffap.el (ffap-bindings): Bind to the [remap COMMAND] instead of hardcoding the default keybindings. This better adapts better if non-default are used. And lets the original keybindings be remembered, so that, e.g., \[find-file] in docstrings will still be substituted with C-x C-f (even though that binding has been remapped to find-file-at-point. --- lisp/ffap.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 36e37e95fe..bcb5efef54 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -2042,19 +2042,19 @@ (defvar ffap-bindings '((global-set-key [S-mouse-3] 'ffap-at-mouse) (global-set-key [C-S-mouse-3] 'ffap-menu) - (global-set-key "\C-x\C-f" 'find-file-at-point) - (global-set-key "\C-x\C-r" 'ffap-read-only) - (global-set-key "\C-x\C-v" 'ffap-alternate-file) - - (global-set-key "\C-x4f" 'ffap-other-window) - (global-set-key "\C-x5f" 'ffap-other-frame) - (global-set-key "\C-x4r" 'ffap-read-only-other-window) - (global-set-key "\C-x5r" 'ffap-read-only-other-frame) - - (global-set-key "\C-xd" 'dired-at-point) - (global-set-key "\C-x4d" 'ffap-dired-other-window) - (global-set-key "\C-x5d" 'ffap-dired-other-frame) - (global-set-key "\C-x\C-d" 'ffap-list-directory) + (global-set-key [remap find-file] 'find-file-at-point) + (global-set-key [remap find-file-read-only] 'ffap-read-only) + (global-set-key [remap find-alternate-file] 'ffap-alternate-file) + + (global-set-key [remap find-file-other-window] 'ffap-other-window) + (global-set-key [remap find-file-other-frame] 'ffap-other-frame) + (global-set-key [remap find-file-read-only-other-window] 'ffap-read-only-other-window) + (global-set-key [remap find-file-read-only-other-frame] 'ffap-read-only-other-frame) + + (global-set-key [remap dired] 'dired-at-point) + (global-set-key [remap dired-other-window] 'ffap-dired-other-window) + (global-set-key [remap dired-other-frame] 'ffap-dired-other-frame) + (global-set-key [remap list-directory] 'ffap-list-directory) (add-hook 'gnus-summary-mode-hook 'ffap-gnus-hook) (add-hook 'gnus-article-mode-hook 'ffap-gnus-hook) -- 2.11.0 --=-=-=--