unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6695: 24.0.50; thing-at-point-url-at-point and ffap-guesser problem
@ 2010-07-21 18:16 Drew Adams
  2011-07-14 13:25 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2010-07-21 18:16 UTC (permalink / raw)
  To: 6695

emacs -Q
 
Load thingatpt.el and ffap.el.  Use this test line of text:
 
;; c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf
 
1. Put the cursor on the g of Settings.
   M-: (thing-at-point-url-at-point) => "http://Settings/foobar/My"
 
2. Put the cursor on the S of MyStuff.
   M-: (thing-at-point-url-at-point) =>
   "http://Documents/MyStuff/foo.pdf"
 
Neither of those is remotely correct.
 
3. Put the cursor on the g of Settings.
   M-: (ffap-guesser) => nil
 
   Same thing with cursor *anywhere* on the absolute file name, except:
   If the cursor is on any character in this string: "c:/Documents" then
   (ffap-guesser) returns "c:/Documents and Settings/" (which is also
   wrong).
 
What should happen:
 
`ffap-guesser' should return
"c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf"
 
`thing-at-point-url-at-point should return
"http://c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf"
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-07-19 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/xpm/include'
 






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#6695: 24.0.50; thing-at-point-url-at-point and ffap-guesser problem
  2010-07-21 18:16 bug#6695: 24.0.50; thing-at-point-url-at-point and ffap-guesser problem Drew Adams
@ 2011-07-14 13:25 ` Lars Magne Ingebrigtsen
  2011-07-14 16:29   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-14 13:25 UTC (permalink / raw)
  To: Drew Adams; +Cc: 6695

"Drew Adams" <drew.adams@oracle.com> writes:

> Load thingatpt.el and ffap.el.  Use this test line of text:
>
> ;; c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf
>
> 1. Put the cursor on the g of Settings.
>    M-: (thing-at-point-url-at-point) => "http://Settings/foobar/My"
>
> 2. Put the cursor on the S of MyStuff.
>    M-: (thing-at-point-url-at-point) =>
>    "http://Documents/MyStuff/foo.pdf"

These both return nil for me in Emacs 24.

> Neither of those is remotely correct.
>
> 3. Put the cursor on the g of Settings.
>    M-: (ffap-guesser) => nil

[...]

> What should happen:
>
> `ffap-guesser' should return
> "c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf"
>
> `thing-at-point-url-at-point should return
> "http://c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf"

I don't really see how guessing that these things are file names is
feasible.

Unless one adds special matches for Windows where [letter]:/ matches
stuff until the end of the line or something...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#6695: 24.0.50; thing-at-point-url-at-point and ffap-guesser problem
  2011-07-14 13:25 ` Lars Magne Ingebrigtsen
@ 2011-07-14 16:29   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2011-07-14 16:29 UTC (permalink / raw)
  To: 'Lars Magne Ingebrigtsen'; +Cc: 6695

> These both return nil for me in Emacs 24.

Yes.  So it is still not fixed, but is broken in another way.

Well, to be fair, punting and returning nil is not incorrect in the sense that
it gives the wrong URL.  It is incorrect in that it does not give the (correct)
URL at all.  It says, in effect, there is no URL at point, which is wrong.

> > Neither of those is remotely correct.
> >
> > 3. Put the cursor on the g of Settings.
> >    M-: (ffap-guesser) => nil

In the case of `ffap-guesser' it is perhaps too strong to say that a nil value
indicates that there is no URL at point (as in the `thing-at-point' case).  It
is only claiming to "guess", whereas `thing-at-point' returning nil claims that
there is no URL at point, and programs should be able to depend on that.

> > What should happen:
> >
> > `ffap-guesser' should return
> > "c:/Documents and Settings/foobar/My Documents/MyStuff/foo.pdf"
> >
> > `thing-at-point-url-at-point should return
> > "http://c:/Documents and Settings/foobar/My 
> Documents/MyStuff/foo.pdf"
> 
> I don't really see how guessing that these things are file names is
> feasible.

Why not?  That's their job.

> Unless one adds special matches for Windows where [letter]:/ matches
> stuff until the end of the line or something...

Maybe.  Dunno.  It would be good for someone knowledgable in thingatpt.el and
ffap.el take a look and see how these cases can be improved.

In the case of ffap.el, I guess you could call this an enhancement request,
since returning `nil' is just giving up and saying it has no "guess".  In the
case of thingatpt.el, this is a bug: it claims incorrectly that there is no URL
at point.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-14 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21 18:16 bug#6695: 24.0.50; thing-at-point-url-at-point and ffap-guesser problem Drew Adams
2011-07-14 13:25 ` Lars Magne Ingebrigtsen
2011-07-14 16:29   ` Drew Adams

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).