GNU bug report logs - #35693
The prompt for find-file becomes a ~ instead of ~/

Previous Next

Packages: emacs, gnus;

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

Date: Sun, 12 May 2019 02:28:01 UTC

Severity: minor

Found in version 5.13

Done: Katsumi Yamaoka <yamaoka <at> jpl.org>

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 35693 in the body.
You can then email your comments to 35693 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, bugs <at> gnus.org:
bug#35693; Package emacs,gnus. (Sun, 12 May 2019 02:28:01 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, bugs <at> gnus.org. (Sun, 12 May 2019 02:28:01 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: submit <at> debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)
Subject: The prompt for find-file becomes a ~ instead of ~/
Date: Sun, 12 May 2019 10:27:01 +0800
M-x gnus
C-x C-f
The prompt for find-file becomes a ~ instead of ~/
It turns out because since one uses ffap-bindings
and the cursor is now resting after a ":", the find-file prompt is
affected.
OK it is not a gnus bug, but most commonly seen when using gnus...

My conf files are in jidanni.org/comp/configuration/

Gnus v5.13
GNU Emacs 26.1 (build 2, i686-pc-linux-gnu, GTK+ Version 3.24.4)
 of 2019-02-04, modified by Debian




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#35693; Package emacs,gnus. (Tue, 14 May 2019 05:57:01 GMT) Full text and rfc822 format available.

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

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35693 <at> debbugs.gnu.org
Subject: Re: bug#35693: The prompt for find-file becomes a ~ instead of ~/
Date: Tue, 14 May 2019 14:56:12 +0900
On Sun, 12 May 2019 10:27:01 +0800, 積丹尼 wrote:
> M-x gnus
> C-x C-f
> The prompt for find-file becomes a ~ instead of ~/

`C-x C-f' invokes `find-file-at-point' because of `ffap-bindings'.

> It turns out because since one uses ffap-bindings
> and the cursor is now resting after a ":", the find-file prompt is
> affected.
> OK it is not a gnus bug, but most commonly seen when using gnus...

Yes, it's not a Gnus bug.  That happens when performing `C-x C-f'
just after the colon in the group line like this:

	123: nnfoo:bar

There ffap grabs a string "123:", recognizes it as a colon separated
paths list, and extracts a path where the cursor is, that is "".
That *path* string is used to create a prompt string by way of:

(abbreviate-file-name (expand-file-name ""))

It returns "~" because you are in the home directory.  That is why
you are prompted with "~" instead of "~/".

There would be many ways to solve it, though I'm not sure what is
the best.  Here are two of them (based on ffap.el in the trunk):

1. (ffap-file-at-point): Don't recognize "" as a path name.
--- ffap.el~	2019-05-12 21:20:25.967974700 +0000
+++ ffap.el	2019-05-14 05:51:47.038159300 +0000
@@ -1326,6 +1326,7 @@
 	 ;; If it contains a colon, get rid of it (and return if exists)
 	 ((and (string-match path-separator name)
 	       (setq name (ffap-string-at-point 'nocolon))
+	       (> (length name) 0)
 	       (ffap-file-exists-string name)))
 	 ;; File does not exist, try the alist:
 	 ((let ((alist ffap-alist) tem try case-fold-search)

2. (ffap-file-exists-string): Don't recognize "" as a file name.
--- ffap.el~	2019-05-12 21:20:25.967974700 +0000
+++ ffap.el	2019-05-14 05:51:47.038159300 +0000
@@ -513,7 +513,7 @@
 name may have a suffix added from `ffap-compression-suffixes'.
 The optional NOMODIFY argument suppresses the extra search."
   (cond
-   ((not file) nil)			; quietly reject nil
+   ((zerop (length file)) nil)		; quietly reject nil and ""
    ((file-exists-p file) file)		; try unmodified first
    ;; three reasons to suppress search:
    (nomodify nil)

Regards,




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#35693; Package emacs,gnus. (Tue, 14 May 2019 09:43:01 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 35693 <at> debbugs.gnu.org
Subject: Re: bug#35693: The prompt for find-file becomes a ~ instead of ~/
Date: Tue, 14 May 2019 17:42:15 +0800
>>>>> "KY" == Katsumi Yamaoka <yamaoka <at> jpl.org> writes:
KY> It returns "~" because you are in the home directory.  That is why
KY> you are prompted with "~" instead of "~/".

How terrible. Glad you found the cause. Hope it will get fixed soon.




Reply sent to Katsumi Yamaoka <yamaoka <at> jpl.org>:
You have taken responsibility. (Fri, 17 May 2019 01:36:02 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Fri, 17 May 2019 01:36:02 GMT) Full text and rfc822 format available.

Message #16 received at 35693-done <at> debbugs.gnu.org (full text, mbox):

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35693-done <at> debbugs.gnu.org
Subject: Re: bug#35693: The prompt for find-file becomes a ~ instead of ~/
Date: Fri, 17 May 2019 10:35:22 +0900
[Message part 1 (text/plain, inline)]
On Tue, 14 May 2019 17:42:15 +0800, 積丹尼 wrote:
>>>>>> "KY" == Katsumi Yamaoka <yamaoka <at> jpl.org> writes:
KY> It returns "~" because you are in the home directory.  That is why
KY> you are prompted with "~" instead of "~/".

> How terrible. Glad you found the cause. Hope it will get fixed soon.

BTW, I can't imagine the ffap bindings to be useful in the Gnus
group mode.  An exapmle to get rid of the ffap bindings in only
the Gnus group mode is below.

Anyway I've installed both of the following two changes in the
trunk, and am closing this bug.

> 1. (ffap-file-at-point): Don't recognize "" as a path name.
> 2. (ffap-file-exists-string): Don't recognize "" as a file name.

Regards,

[Message part 2 (application/emacs-lisp, inline)]

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

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

Previous Next


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