unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 24057@debbugs.gnu.org, Noam Postavsky <npostavs@users.sourceforge.net>
Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path
Date: Sat, 23 Jul 2016 11:56:40 +0000	[thread overview]
Message-ID: <CAFyQvY2VcODyWxhQwjSj1YfULphs-iffCrM9JfGoe79HmprXOg@mail.gmail.com> (raw)
In-Reply-To: <83lh0sx0yf.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

On Sat, Jul 23, 2016 at 3:34 AM Eli Zaretskii <eliz@gnu.org> 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

[-- Attachment #2: Type: text/html, Size: 3293 bytes --]

  reply	other threads:[~2016-07-23 11:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 23:00 bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Kaushal Modi
2016-07-22 23:11 ` Kaushal Modi
2016-07-23  1:26 ` npostavs
2016-07-23  7:38   ` Eli Zaretskii
2016-07-23  7:34 ` Eli Zaretskii
2016-07-23 11:56   ` Kaushal Modi [this message]
2016-07-23 13:05     ` Eli Zaretskii
2016-07-23 13:23       ` Kaushal Modi
2016-07-23 13:59         ` Eli Zaretskii
2016-07-23 18:02           ` Noam Postavsky
2016-07-23 18:20             ` Eli Zaretskii
2016-07-23 18:22             ` Eli Zaretskii
2016-07-23 21:51           ` Kaushal Modi
2016-07-24 14:16             ` Eli Zaretskii
2016-07-25  2:19               ` Kaushal Modi
2016-07-25 17:02                 ` Eli Zaretskii
2016-07-25 17:13                   ` Kaushal Modi
2016-07-25 17:24                     ` Eli Zaretskii
2016-07-25 18:13                       ` Kaushal Modi
2016-07-25 20:18                         ` Kaushal Modi
2016-07-26 14:41                           ` Eli Zaretskii
2016-07-26 15:11                             ` Kaushal Modi
2017-03-17  2:10                           ` npostavs
2017-03-17  2:13                             ` npostavs
2017-03-17 22:16                             ` Kaushal Modi
2017-03-17 23:30                               ` npostavs
2017-03-18  1:28                                 ` Kaushal Modi
2017-03-18 15:41                                   ` npostavs
2017-03-23 13:01                                     ` npostavs
2017-03-23 13:30                                       ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY2VcODyWxhQwjSj1YfULphs-iffCrM9JfGoe79HmprXOg@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=24057@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).