all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net
Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path
Date: Mon, 25 Jul 2016 20:02:36 +0300	[thread overview]
Message-ID: <83mvl5tzv7.fsf@gnu.org> (raw)
In-Reply-To: <CAFyQvY0CkLeu8_GWO8NsJ9wxju4mfgNUmvAumWq5NejXO-J8kA@mail.gmail.com> (message from Kaushal Modi on Mon, 25 Jul 2016 02:19:13 +0000)

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Mon, 25 Jul 2016 02:19:13 +0000
> Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net
> 
>     I tried with a comment that begins like this:
> 
>       ////share/foo
> 
>     and I don't think the proposed behavior will be correct in all cases.
>     The problem is that comment-search-forward moves all the way past the
>     leading 4 slashes, instead of only 2.  
> 
> That is expected, as I posted in a table earlier:

If I understood you correctly, the table you posted didn't cover
systems which support UNC file names, so you asked me to try on such a
system.  The above was my response to your request.

> The problem with that is .. what is a user has a decorative comment like:
> 
> ///I would like to
> ///share foo
> 
> It is not possible to know if the user liked to use "//" or "///" or "////" or .. as the comment prefix. Also it is not possible to know if the user meant "/share" or "//share".

IMO, it isn't Emacs's place to second-guess the user in a way that
prohibits valid use cases.

> So the best way to make the user's intent clear is by preceding the path with a space.

When there's whitespace between the comment leader and the rest, the
problem I'm talking about doesn't exist.

> Also thinking that the user meant "//share" in "////share" does not make much sense. It's very confusing to count the number of slashes in there. What is the user has "/////share" (5 slashes)? Where would we want the ffap-string-at-point to guess the comment-starter<>comment boundary then?

If you want to code a backward-compatible solution, then skipping the
comment-start regexp should do, I think.  Where it stops, ffap should
start looking for valid file names.

> With the current state of ffap-string-at-point, it creates erroneous behavior for many people including me. But with the patch, if a user needs to put a path like "//share" in a comment for a major mode using "//" as comment prefix, all they need to do is use a space to separate the two. Also I think that it is very unlikely that someone would have a confusing comment like "////share" where the user meant "//share" (or "/share").

I see your point.  My point is that when we introduce
backward-incompatible behavior, which makes previously valid use cases
invalid, such incompatible behavior should initially be opt-in, even
if it looks to you that the previous behavior made no sense.  I have
enough gray hair to testify how such decisions in the past turned out
to be annoyances for some users.  Later, usually years later, we could
collect user experience and decide to make this the default behavior.

So if you disagree with my suggestion to skip comment-start instead of
using comment-search-forward, the behavior you propose should IMO be
off by default.

Thanks.





  reply	other threads:[~2016-07-25 17:02 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=83mvl5tzv7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24057@debbugs.gnu.org \
    --cc=kaushal.modi@gmail.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.