From unknown Fri Sep 12 16:03:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#27267 <27267@debbugs.gnu.org> To: bug#27267 <27267@debbugs.gnu.org> Subject: Status: 25.1; ffap-file-at-point erroneously returns "" in some cases Reply-To: bug#27267 <27267@debbugs.gnu.org> Date: Fri, 12 Sep 2025 23:03:34 +0000 retitle 27267 25.1; ffap-file-at-point erroneously returns "" in some cases reassign 27267 emacs submitter 27267 Alex severity 27267 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 06 18:43:53 2017 Received: (at submit) by debbugs.gnu.org; 6 Jun 2017 22:43:53 +0000 Received: from localhost ([127.0.0.1]:59981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dINCb-0000gQ-7P for submit@debbugs.gnu.org; Tue, 06 Jun 2017 18:43:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dINCZ-0000gD-FS for submit@debbugs.gnu.org; Tue, 06 Jun 2017 18:43:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dINCT-0006Cz-EK for submit@debbugs.gnu.org; Tue, 06 Jun 2017 18:43:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dINCT-0006Cf-Ai for submit@debbugs.gnu.org; Tue, 06 Jun 2017 18:43:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dINCS-0004s3-8L for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 18:43:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dINCP-00065l-5r for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 18:43:44 -0400 Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]:33010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dINCO-00063I-Vz for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 18:43:41 -0400 Received: by mail-io0-x22a.google.com with SMTP id b184so13494674ioe.0 for ; Tue, 06 Jun 2017 15:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=dca0OcAoD1rL51YjW1/dy+Ch5eXm9KDpdziijSDJlj8=; b=SReKUecjY0EDS2u7y//XtSUq28mrJihOAdwHdbFNtuWk4OddhbipEKebqJZVjrO177 qrsOB7vbwxewHqI/dsT4wgkPuPGthkEwr2+LqIJcjSn//pqRnRrM/38lpXORpKB1yOXa ZteYa9N0gt5aKcm2yFacOvnFARxmybB5dJTu+05UIrtXfo2Od90gH7/+bBcmJqqN+N5Z 97+t+CfGwYezN7QTMSFrGLpKlkuUr9blqfmYpGcpDhCF98tPzU5E7O+SicMiKsANjjxQ dDT51L9saAi7qHnvW+8Q8LZn+5RSebqrEbRiQ/MiQQLqJrYmfMH676nio4KSb+5z0s32 FbUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=dca0OcAoD1rL51YjW1/dy+Ch5eXm9KDpdziijSDJlj8=; b=G+cnaH3Rfukb3sGsHXdBomSvicimh22kgCM5vYqoy1eYzpOQwLyorvL9Ff7akdaLH1 GoMW0qPhK55wp/dY6sumXN2VevbeUeMKRY/KKxMt6KRd8NHG2tedDaMrsr5K09uYIHSC o+bQ7PxQ7jIEqTUqE6cJX/tF8qy42fuzybuazZWlpcoaQxdTUDQPFvSpAFEpIT5Vxt3n XutuqxfD8hI2jSy/kskG0D+nYLLxrOU4KdtCij4ynZel2Up1JKOZgAJ4INIlp/kt6cQi IxTiTTUpD9UvjcjsKNr4gbmZJ8WHxR/HXuuXR64YeNn14br6r4EY3cOF2CTK2LrJyPau 1SpQ== X-Gm-Message-State: AODbwcBZXlognvWxRbIFeMMHiV/Hmxbk2Q5lTJvbAyVt1y6MM+xrj7P4 OFg/zrqCN8Qb670H X-Received: by 10.107.10.141 with SMTP id 13mr10995317iok.204.1496789018381; Tue, 06 Jun 2017 15:43:38 -0700 (PDT) Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id t76sm91523ita.22.2017.06.06.15.43.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jun 2017 15:43:37 -0700 (PDT) From: Alex To: bug-gnu-emacs@gnu.org Subject: 25.1; ffap-file-at-point erroneously returns "" in some cases Date: Tue, 06 Jun 2017 16:43:32 -0600 Message-ID: <87r2yw3ffv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain Execute ffap-file-at-point with the following buffer contents (| for cursor position): 7:| The result is "", which leads to ffap's default input being ~ (not ~/ as expected). Similarly, try ffap-file-at-point on: :6| This is due to ffap-file-at-point stripping off the colon and numbers, and sending "" to ffap-file-exists-string. (file-exists-p "") returns t, so ffap-file-at-point treats "" as an existent file. The following diff fixes this, but I'm not sure if it's the best approach. Perhaps ffap-file-at-point just checks that the argument to ffap-file-exists-string is non-empty each time it's called. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=ffap2.diff Content-Description: ffap diff --git a/lisp/ffap.el b/lisp/ffap.el index 87531110b8..21312b34c3 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -514,6 +514,7 @@ ffap-file-exists-string The optional NOMODIFY argument suppresses the extra search." (cond ((not file) nil) ; quietly reject nil + ((string-empty-p file) nil) ; reject empty string ((file-exists-p file) file) ; try unmodified first ;; three reasons to suppress search: (nomodify nil) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 13:48:49 2019 Received: (at 27267) by debbugs.gnu.org; 21 Jul 2019 17:48:49 +0000 Received: from localhost ([127.0.0.1]:59437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpFx2-0008SZ-R7 for submit@debbugs.gnu.org; Sun, 21 Jul 2019 13:48:49 -0400 Received: from quimby.gnus.org ([80.91.231.51]:33282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpFx1-0008SP-7R for 27267@debbugs.gnu.org; Sun, 21 Jul 2019 13:48:47 -0400 Received: from [80.169.244.84] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hpFwy-0006Fb-1H; Sun, 21 Jul 2019 19:48:46 +0200 From: Lars Ingebrigtsen To: Alex Subject: Re: bug#27267: 25.1; ffap-file-at-point erroneously returns "" in some cases References: <87r2yw3ffv.fsf@gmail.com> Date: Sun, 21 Jul 2019 19:48:43 +0200 In-Reply-To: <87r2yw3ffv.fsf@gmail.com> (Alex's message of "Tue, 06 Jun 2017 16:43:32 -0600") Message-ID: <87wogb2s90.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alex writes: > Execute ffap-file-at-point with the following buffer contents (| for > cursor position): > > 7:| > > The result is "", which leads to ffap's default input being ~ (not ~/ as > expected). Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 27267 Cc: 27267@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alex writes: > Execute ffap-file-at-point with the following buffer contents (| for > cursor position): > > 7:| > > The result is "", which leads to ffap's default input being ~ (not ~/ as > expected). I get (ffap-file-at-point) => "/home/larsi/" so this seems like it's fixed. > > Similarly, try ffap-file-at-point on: > > :6| > > This is due to ffap-file-at-point stripping off the colon and numbers, > and sending "" to ffap-file-exists-string. (file-exists-p "") returns t, > so ffap-file-at-point treats "" as an existent file. I get nil from that in the Emacs trunk, which seems correct, so I guess this has been fixed to, and I'm closing this bug report. Please reopen if this is still present on the trunk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 13:48:56 2019 Received: (at control) by debbugs.gnu.org; 21 Jul 2019 17:48:56 +0000 Received: from localhost ([127.0.0.1]:59440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpFxA-0008Sv-3Y for submit@debbugs.gnu.org; Sun, 21 Jul 2019 13:48:56 -0400 Received: from quimby.gnus.org ([80.91.231.51]:33296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpFx9-0008So-0l for control@debbugs.gnu.org; Sun, 21 Jul 2019 13:48:55 -0400 Received: from [80.169.244.84] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hpFx6-0006Fi-D6 for control@debbugs.gnu.org; Sun, 21 Jul 2019 19:48:54 +0200 Date: Sun, 21 Jul 2019 19:48:51 +0200 Message-Id: <87v9vv2s8s.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #27267 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 27267 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 27267 quit From unknown Fri Sep 12 16:03:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 19 Aug 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator