GNU bug report logs - #35577
ffap-commands causes find-file-read-only doc to display <open> for find-file

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 5 May 2019 12:33:02 UTC

Severity: minor

Tags: fixed

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35577 in the body.
You can then email your comments to 35577 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35577; Package emacs. (Sun, 05 May 2019 12:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 05 May 2019 12:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: find-file-read-only docstring old
Date: Sun, 05 May 2019 15:21:29 +0800
"open"? Don't you mean find-file?:

   find-file-read-only is an interactive compiled Lisp function in
   ‘files.el’.

   (find-file-read-only FILENAME &optional WILDCARDS)

   Edit file FILENAME but don’t allow changes.
   Like <open>, but marks buffer as read-only.
   Use C-x C-q to permit editing.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35577; Package emacs. (Sun, 05 May 2019 12:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 35577 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35577 <at> debbugs.gnu.org
Subject: Re: bug#35577: find-file-read-only docstring old
Date: Sun, 05 May 2019 08:40:57 -0400
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> "open"? Don't you mean find-file?:

If shows the binding of find-file.  I guess you've removed the C-x C-f
binding so you the the <open> one (which appears to be for a Sun
keyboard).

bindings.el:

    (define-key global-map [again]		'repeat-complex-command) ; Sun keyboard
    (define-key global-map [open]		'find-file) ; Sun

>    Like <open>, but marks buffer as read-only.

From 'emacs -Q' it says:

    Like C-x C-f, but marks buffer as read-only.

>    Use C-x C-q to permit editing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35577; Package emacs. (Sun, 05 May 2019 12:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 35577 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 35577 <at> debbugs.gnu.org
Subject: Re: bug#35577: find-file-read-only docstring old
Date: Sun, 05 May 2019 20:55:48 +0800
Oh, so that is a side effect of ffap-bindings. Hmmm.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35577; Package emacs. (Sun, 05 May 2019 13:20:02 GMT) Full text and rfc822 format available.

Message #14 received at 35577 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35577 <at> debbugs.gnu.org
Subject: Re: bug#35577: find-file-read-only docstring old
Date: Sun, 05 May 2019 09:19:36 -0400
[Message part 1 (text/plain, inline)]
retitle 35577 ffap-commands causes find-file-read-only doc to display <open> for find-file
quit

積丹尼 Dan Jacobson <jidanni <at> jidanni.org> 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):

[0001-Use-remapping-in-ffap-bindings-Bug-35577.patch (text/x-diff, inline)]
From 0713b2d8ad3e75339c573354212602e661d314af Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
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


Changed bug title to 'ffap-commands causes find-file-read-only doc to display <open> for find-file' from 'find-file-read-only docstring old' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 05 May 2019 13:20:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35577; Package emacs. (Sun, 12 May 2019 12:08:01 GMT) Full text and rfc822 format available.

Message #19 received at 35577 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35577 <at> debbugs.gnu.org
Subject: Re: bug#35577: find-file-read-only docstring old
Date: Sun, 12 May 2019 08:07:28 -0400
tags 35577 fixed
close 35577 27.1
quit

>> 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)

Pushed to master.

b1cc876b6c 2019-05-12T08:05:01-04:00 "Use remapping in ffap-bindings (Bug#35577)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b1cc876b6c9d00cd9d9f4ed65176274bf35a81c4





Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 12 May 2019 12:08:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 35577 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 12 May 2019 12:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Jun 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 336 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.