From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Date: Sat, 23 Jul 2016 11:56:40 +0000 Message-ID: References: <83lh0sx0yf.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d38060d9c8b05384c3f49 X-Trace: ger.gmane.org 1469275051 24833 80.91.229.3 (23 Jul 2016 11:57:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 11:57:31 +0000 (UTC) Cc: 24057@debbugs.gnu.org, Noam Postavsky To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 23 13:57:21 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQvYQ-00045X-Kr for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 13:57:14 +0200 Original-Received: from localhost ([::1]:51524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQvYP-00044M-Lg for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 07:57:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQvYI-00044B-M6 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 07:57:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQvYE-0007EK-I9 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 07:57:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQvYE-0007EG-ES for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 07:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQvYE-0006yO-31 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 07:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146927502026796 (code B ref 24057); Sat, 23 Jul 2016 11:57:02 +0000 Original-Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 11:57:00 +0000 Original-Received: from localhost ([127.0.0.1]:34225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvYC-0006y8-0u for submit@debbugs.gnu.org; Sat, 23 Jul 2016 07:57:00 -0400 Original-Received: from mail-oi0-f42.google.com ([209.85.218.42]:33264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvY8-0006xt-14 for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 07:56:58 -0400 Original-Received: by mail-oi0-f42.google.com with SMTP id j185so196394546oih.0 for <24057@debbugs.gnu.org>; Sat, 23 Jul 2016 04:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bdg68gClYbnkUttQL4X5UhqKAQTdelLam4zBe2uHhmc=; b=ZDkxyn14KEX0pJfbKVadA85E9qn4vagIo6mQEURRnBHSfMce4qXP5Clqk+tVo++5ec HW7pDVN224cpC/uczzrIJKHuaY88oU+hhXWDu6OySW0lDATjlwB9ldMOBYHxQI9WEuZo A3svm2IzulZhtkbuqr4Jy5w2EPFslAPI0+vKipogvXUm8DY1Qc+zPuyhkyCUDmASZhpg BrMIUADnxIRuDXzkjnvwRGQTX6kkHBjDPsYjyAgAlE2h+s3B7mP3C3wQNJyNnPoxHLhc trZnLJHgUMlxaOly97ct7D8GrmoinrJYCQAVNV6Mk5k2NP2RlJheOuDKh3iBEWbwBRWw r63A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bdg68gClYbnkUttQL4X5UhqKAQTdelLam4zBe2uHhmc=; b=m9Ewl+ajT3J326ukStwIAfmOBj/2R/7xjNn4cgmJN/ntZwDMsiyY32AKXjHTH5++q+ mQP8QU9vk88N/OHuuxM0cm0CB9De2TKbPXOCsRrqkn/X0KinEZ0KAVPdTEU7KRQFlSsc BiKMnzCEZIcEFigdBInzHMJQGj+odwy3uNwWxuScTv1+g21ZMZUpc2hRCxHAPp8A1XAR Sl/o8UGJ5esVfknh1QB02MbyD/0FhAbxqBGDVnntabnDdx8/mDL2IUlvqVrRhTocwLuY 0peHCG1mev+Vx1AEsIJVyNAQA500KlcB5kuRF9xd4RGTSqhMJ80e1m1HQZDx8BvPwxhM qGvg== X-Gm-Message-State: AEkooutryecW3xmgp27cbU83t+VUzk+1zOUntf6U3HwIlvXpM95O22k6a1yAtd9DVe3FID2sG37CYCqRidvfbg== X-Received: by 10.202.234.5 with SMTP id i5mr4824606oih.98.1469275010078; Sat, 23 Jul 2016 04:56:50 -0700 (PDT) In-Reply-To: <83lh0sx0yf.fsf@gnu.org> 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: 208.118.235.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:121445 Archived-At: --001a113d38060d9c8b05384c3f49 Content-Type: text/plain; charset=UTF-8 On Sat, Jul 23, 2016 at 3:34 AM Eli Zaretskii wrote: > I see no reason to assume that file names cannot appear in comments. > I have already tested with these use cases and now it seems to do-the-right-thing: In the below table, 'x' represents the point (the cursor would be on the character to its right). The second column shows the value that ffap-string-at-point is set to on doing C-x C-f (with the ido setup explained in the first email). |-----------------------------------+---------------------------------| | Example string in `c-mode' buffer | Returned `ffap-string-at-point' | |-----------------------------------+---------------------------------| | x//tmp | "tmp" | | //xtmp | "tmp" | | x////tmp | "tmp" | | ////xtmp | "tmp" | | x// //tmp | "" | | // //xtmp | "//tmp" | |-----------------------------------+---------------------------------| To try this out, paste the below in a new buffer and M-x c-mode. //tmp ////tmp // //tmp Now do C-x C-f with cursor at those 6 different points and you will see that an attempt to read /tmp happens only in the case of "// //tmp" when the point is anywhere in the "//tmp" portion following "// ". I could agree with a user option to disable this behavior, but > disabling it unconditionally is IMO a mistake. > Of course, if this patch returns in unintended ffap-string-at-point, I will add a defcustom to enable this behavior. -- Kaushal Modi --001a113d38060d9c8b05384c3f49 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jul 23= , 2016 at 3:34 AM Eli Zaretskii <eliz@gn= u.org> wrote:
I see no reaso= n to assume that file names cannot appear in comments.
=C2=A0
I have already tested with these use cases and now it see= ms to do-the-right-thing:

In the below table, '= ;x' represents the point (the cursor would be on the character to its r= ight).
The second column shows the value that ffap-string-at-poin= t is set to on doing C-x C-f (with the ido setup explained in the first ema= il).


= |-----------------------------------+---------------------------------|
| Example string in `c-mode' buf= fer | Returned `ffap-string-at-point' |
|-----------------------------------+---------------------------= ------|
| x//tmp =C2=A0 =C2=A0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=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | "//tmp" =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
|-----------------------------------+------= ---------------------------|


To try this out, past= e the below in a new buffer and M-x c-mode.

//tmp
////tmp
// //tmp

Now do C-x C-f with cursor at those 6 different points and y= ou will see that an attempt to read /tmp happens only in the case of "= // //tmp" when the point is anywhere i= n the "//tmp" portion following "// ".


I could agree with a user option to disable this behavior, but
disabling it unconditionally is IMO a mistake.

Of course, if this patch returns in unintended ffap-string-at-point= , I will add a defcustom to enable this behavior.=C2=A0
--

Kaushal Modi

--001a113d38060d9c8b05384c3f49--