From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#35693: The prompt for find-file becomes a ~ instead of ~/ Date: Tue, 14 May 2019 14:56:12 +0900 Organization: Emacsen advocacy group Message-ID: References: <87pnoo8l1m.2.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="131549"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-cygwin) Cc: 35693@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 Tue May 14 07:57:14 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 1hQQR8-000Y6E-Fs for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 07:57:14 +0200 Original-Received: from localhost ([127.0.0.1]:39778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQQR7-0005fh-EE for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 01:57:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQQQx-0005fP-3O for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 01:57:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQQQw-0004xJ-2C for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 01:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33384) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQQQv-0004wy-VG for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 01:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQQQv-0005KX-Kk; Tue, 14 May 2019 01:57:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87pnoo8l1m.2.fsf@jidanni.org> Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 14 May 2019 05:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35693 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 35693-submit@debbugs.gnu.org id=B35693.155781340020461 (code B ref 35693); Tue, 14 May 2019 05:57:01 +0000 Original-Received: (at 35693) by debbugs.gnu.org; 14 May 2019 05:56:40 +0000 Original-Received: from localhost ([127.0.0.1]:46928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQQQX-0005Jv-P5 for submit@debbugs.gnu.org; Tue, 14 May 2019 01:56:39 -0400 Original-Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:49156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQQQV-0005Jk-BU for 35693@debbugs.gnu.org; Tue, 14 May 2019 01:56:36 -0400 X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CD56221C80; Tue, 14 May 2019 05:56:33 +0000 (UTC) Original-Received: from hampton.hostforweb.net (100-96-14-60.trex.outbound.svc.cluster.local [100.96.14.60]) (Authenticated sender: tih5qno0ow) by relay.mailchannels.net (Postfix) with ESMTPA id 2ABC021D70; Tue, 14 May 2019 05:56:25 +0000 (UTC) X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net Original-Received: from hampton.hostforweb.net ([TEMPUNAVAIL]. [172.245.115.217]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Tue, 14 May 2019 05:56:33 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net X-MailChannels-Auth-Id: tih5qno0ow X-Bitter-Cure: 4dd8257c3bc143c8_1557813393624_245857237 X-MC-Loop-Signature: 1557813393624:2483940292 X-MC-Ingress-Time: 1557813393624 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:60000 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hQQQB-006zMf-Mp; Tue, 14 May 2019 00:56:17 -0500 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:vKWtJcunkTbzV4+oYROQLuXlYKk= X-OutGoing-Spam-Status: No, score=-0.2 X-AuthUser: yamaoka@hampton.hostforweb.net 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:159245 Archived-At: On Sun, 12 May 2019 10:27:01 +0800, =E7=A9=8D=E4=B8=B9=E5=B0=BC 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,