unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ffap
@ 2003-09-21 22:34 Richard Stallman
  0 siblings, 0 replies; 16+ messages in thread
From: Richard Stallman @ 2003-09-21 22:34 UTC (permalink / raw)


I have got no response from the maintainer of ffap.el,
mic@mathcs.emory.edu, for many months.  Would anyone else
like to maintain it?

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

* Re: FFAP
  2009-11-06  4:20   ` FFAP (was: find-file-literally-at-point) Stefan Monnier
@ 2009-11-06  4:41     ` Miles Bader
  2009-11-06 15:20       ` FFAP Stefan Monnier
  2009-11-06  4:45     ` FFAP Juri Linkov
  1 sibling, 1 reply; 16+ messages in thread
From: Miles Bader @ 2009-11-06  4:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Juri Linkov, Edward O'Connor, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Or maybe we could have a keybinding in
> minibuffer-local-filename-completion-map to bring in the
> filename-at-point.

That sounds most useful to me -- it seems more flexible for users, and
it could immediately be used with (almost) all functions that want
filename entry.

-Miles

-- 
Hers, pron. His.




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

* Re: FFAP
  2009-11-06  4:20   ` FFAP (was: find-file-literally-at-point) Stefan Monnier
  2009-11-06  4:41     ` FFAP Miles Bader
@ 2009-11-06  4:45     ` Juri Linkov
  2009-11-06  8:50       ` FFAP Eli Zaretskii
  2009-11-06 15:18       ` FFAP Stefan Monnier
  1 sibling, 2 replies; 16+ messages in thread
From: Juri Linkov @ 2009-11-06  4:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Edward O'Connor, emacs-devel

>> When I added a few find-file related functions to ffap,
>> I don't remember why I missed `find-file-literally'.
>> Maybe because it has no keybinding (should we try to find one?).
>> So we definitely need such a function.
>
> BTW, I'd be interested in trying to integrate the FFAP behavior into the
> default find-file behavior.  If you people have ideas how such an
> integration could take place, I'm all ears (of course, backward
> compatibility with older users is very important).

I had an idea for a long time how to do such an integration, but
not implemented it yet because I currently don't see how to do this
without loading the whole ffap.el by default.  Perhaps we should
rewrite most of the ffap functionality and simplify it.

The idea is to put a file/URL from the text around the point into
the minibuffer's default values list.  So typing `C-x C-f M-n'
on a file name will bring in it from the current buffer into the
minibuffer.  This is useful for all prompts that read files or
directories.  For instance, `M-x mkdir RET M-n' will try to fetch
the directory name from the current buffer, and so on.

> Or maybe we could have a keybinding in
> minibuffer-local-filename-completion-map to bring in the
> filename-at-point.

`M-n' is such a binding that users are already familiar with.
If it turns out that it's unsuitable, we could invent a new one.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: FFAP
  2009-11-06  4:45     ` FFAP Juri Linkov
@ 2009-11-06  8:50       ` Eli Zaretskii
  2009-11-06 10:37         ` FFAP Juri Linkov
  2009-11-06 15:18       ` FFAP Stefan Monnier
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2009-11-06  8:50 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel, monnier, hober0

> From: Juri Linkov <juri@jurta.org>
> Date: Fri, 06 Nov 2009 06:45:45 +0200
> Cc: Edward O'Connor <hober0@gmail.com>, emacs-devel@gnu.org
> 
> The idea is to put a file/URL from the text around the point into
> the minibuffer's default values list.  So typing `C-x C-f M-n'
> on a file name will bring in it from the current buffer into the
> minibuffer.

That's fine, but I don't think it should be the only possibility.  We
should also provide a special key binding just for ffap, and if
possible also an explicit prompt or tooltip for it.

The reason is that I think we already have too many unintuitive
features in minibuffer prompts, that may be working well for Emacs
veterans, but are entirely concealed (by virtue of their unintuitive
behavior) from the rest.  `M-n' is one such unintuitive feature.




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

* Re: FFAP
  2009-11-06  8:50       ` FFAP Eli Zaretskii
@ 2009-11-06 10:37         ` Juri Linkov
  0 siblings, 0 replies; 16+ messages in thread
From: Juri Linkov @ 2009-11-06 10:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, monnier, hober0

>> The idea is to put a file/URL from the text around the point into
>> the minibuffer's default values list.  So typing `C-x C-f M-n'
>> on a file name will bring in it from the current buffer into the
>> minibuffer.
>
> That's fine, but I don't think it should be the only possibility.  We
> should also provide a special key binding just for ffap, and if
> possible also an explicit prompt or tooltip for it.

We already have a special menu `Minibuf' for the minibuffer, so we
could add more minibuffer-related items to unconceal minibuffer
functionality.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: FFAP
  2009-11-06  4:45     ` FFAP Juri Linkov
  2009-11-06  8:50       ` FFAP Eli Zaretskii
@ 2009-11-06 15:18       ` Stefan Monnier
  2009-11-06 21:19         ` FFAP Juri Linkov
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2009-11-06 15:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Edward O'Connor, emacs-devel

> I had an idea for a long time how to do such an integration, but
> not implemented it yet because I currently don't see how to do this
> without loading the whole ffap.el by default.  Perhaps we should
> rewrite most of the ffap functionality and simplify it.

By "integration" I mostly mean the functionality, not necessarily
the code.  But if it means preloading ffap.el, that's not necessarily
a bad thing, although I think that by integrating it, we can make it
a lot simpler, so I expect that a complete rewrite will be preferable
(especially since we probably wouldn't provide every single last detail
of ffap's functionality).

> The idea is to put a file/URL from the text around the point into
> the minibuffer's default values list.  So typing `C-x C-f M-n'
> on a file name will bring in it from the current buffer into the
> minibuffer.

I thought about it but M-n is already used in some file prompts for
other purposes, so the user would then have to hit M-n more than once to
get the file-at-point, which makes it cumbersome.  I think a dedicated
keybinding would be better.

BTW, another possibility is to do what complete.el does: use a special
file name (complete.el uses "<>" but we could choose something else,
like " ") to mean file-at-point.  I think it's a worse solution (both
because it may collide with a real file name, and more importantly
because it makes it impossible/difficult to edit the file-at-point), but
I throw it out, for completeness's sake.


        Stefan




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

* Re: FFAP
  2009-11-06  4:41     ` FFAP Miles Bader
@ 2009-11-06 15:20       ` Stefan Monnier
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2009-11-06 15:20 UTC (permalink / raw)
  To: Miles Bader; +Cc: Juri Linkov, Edward O'Connor, emacs-devel

>> Or maybe we could have a keybinding in
>> minibuffer-local-filename-completion-map to bring in the
>> filename-at-point.

> That sounds most useful to me -- it seems more flexible for users, and
> it could immediately be used with (almost) all functions that want
> filename entry.

Another advantage is that minibuffer-local-filename-completion-map is
not nearly as crowded as the global map.  But still, we'd have to come
up with a good binding.


        Stefan




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

* Re: FFAP
  2009-11-06 15:18       ` FFAP Stefan Monnier
@ 2009-11-06 21:19         ` Juri Linkov
  2009-11-07  1:32           ` FFAP Stefan Monnier
  0 siblings, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2009-11-06 21:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Edward O'Connor, emacs-devel

> By "integration" I mostly mean the functionality, not necessarily
> the code.  But if it means preloading ffap.el, that's not necessarily
> a bad thing, although I think that by integrating it, we can make it
> a lot simpler, so I expect that a complete rewrite will be preferable
> (especially since we probably wouldn't provide every single last detail
> of ffap's functionality).

I forgot that we already have a clean and small counterpart of ffap
that can be preloaded instead of ffap.el.  It is thingatpt.el.
With (thing-at-point 'filename) it returns the filename at point,
and with (thing-at-point 'url) it returns the URL at point.

>> The idea is to put a file/URL from the text around the point into
>> the minibuffer's default values list.  So typing `C-x C-f M-n'
>> on a file name will bring in it from the current buffer into the
>> minibuffer.
>
> I thought about it but M-n is already used in some file prompts for
> other purposes,

Let's see what currently M-n does in file prompts (0. means the default
input, and 1. - the minibuffer's content after one M-n):

`C-x C-f' in a non-file buffer:
0. current directory name

`C-x C-f' in a file buffer:
0. current directory name
1. file name of the current buffer

`C-x C-v' in a file buffer:
0. file name of the current buffer
1. file name of the current buffer
(the last case has duplicates)

> so the user would then have to hit M-n more than once to get the
> file-at-point, which makes it cumbersome.

After adding a file name at point:

`C-x C-f' in a non-file buffer:
0. current directory name
1. file name at point

`C-x C-f' in a file buffer:
0. current directory name
1. file name of the current buffer
2. file name at point

`C-x C-v' in a file buffer:
0. file name of the current buffer
1. file name at point

So M-n more than once is only in a file buffer,
where we could add a file name at point before
the file name of the current buffer:

`C-x C-f' in a file buffer:
0. current directory name
1. file name at point
2. file name of the current buffer

> I think a dedicated keybinding would be better.

Of course, a dedicated keybinding would be good as well.
IIRC, the last time this has been discussed where Drew
proposed `M-.' to yank text at point into the minibuffer in:
http://thread.gmane.org/gmane.emacs.devel/50372

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: FFAP
  2009-11-06 21:19         ` FFAP Juri Linkov
@ 2009-11-07  1:32           ` Stefan Monnier
  2009-11-09  0:52             ` FFAP Juri Linkov
  0 siblings, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2009-11-07  1:32 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Edward O'Connor, emacs-devel

>> By "integration" I mostly mean the functionality, not necessarily
>> the code.  But if it means preloading ffap.el, that's not necessarily
>> a bad thing, although I think that by integrating it, we can make it
>> a lot simpler, so I expect that a complete rewrite will be preferable
>> (especially since we probably wouldn't provide every single last detail
>> of ffap's functionality).
> I forgot that we already have a clean and small counterpart of ffap
> that can be preloaded instead of ffap.el.  It is thingatpt.el.
> With (thing-at-point 'filename) it returns the filename at point,
> and with (thing-at-point 'url) it returns the URL at point.

I think it'd be important to make it mode-aware, so that when you're on
a (require 'foo) or on a #include "bar", it can find the relevant file.
So (thing-at-point 'filename) wouldn't quite cut it as it stands.


        Stefan




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

* Re: FFAP
@ 2009-11-07 18:18 MON KEY
  2009-11-09  0:56 ` FFAP Juri Linkov
  0 siblings, 1 reply; 16+ messages in thread
From: MON KEY @ 2009-11-07 18:18 UTC (permalink / raw)
  To: juri; +Cc: emacs-devel

> I forgot that we already have a clean and small counterpart of ffap
> that can be preloaded instead of ffap.el.  It is thingatpt.el.
> With (thing-at-point 'filename) it returns the filename at point,
> and with (thing-at-point 'url) it returns the URL at point.

Currently (thing-at-point 'url) will not reliably return the URL at point in a
good deal of corner cases; URL's containing `,' being a good case in point.

s_P




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

* Re: FFAP
  2009-11-07  1:32           ` FFAP Stefan Monnier
@ 2009-11-09  0:52             ` Juri Linkov
  2009-11-09  6:33               ` FFAP Stefan Monnier
  0 siblings, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2009-11-09  0:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Edward O'Connor, emacs-devel

>> I forgot that we already have a clean and small counterpart of ffap
>> that can be preloaded instead of ffap.el.  It is thingatpt.el.
>> With (thing-at-point 'filename) it returns the filename at point,
>> and with (thing-at-point 'url) it returns the URL at point.
>
> I think it'd be important to make it mode-aware, so that when you're on
> a (require 'foo) or on a #include "bar", it can find the relevant file.
> So (thing-at-point 'filename) wouldn't quite cut it as it stands.

FFAP is already mode-aware, but IMHO its code is ugly.  It puts
all supported modes into `ffap-alist'.  Maybe we should reimplement
this in `thing-at-point' exposing a generic interface for modes
to be able to add their mode-specific settings (like e.g. imenu does
with `imenu-generic-expression').

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: FFAP
  2009-11-07 18:18 FFAP MON KEY
@ 2009-11-09  0:56 ` Juri Linkov
  2009-11-09 18:14   ` FFAP MON KEY
  0 siblings, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2009-11-09  0:56 UTC (permalink / raw)
  To: MON KEY; +Cc: emacs-devel

> Currently (thing-at-point 'url) will not reliably return the URL at point in a
> good deal of corner cases; URL's containing `,' being a good case in point.

Like URL part of `ffap-string-at-point-mode-alist', it counterpart
`thing-at-point-url-path-regexp' contains `,' as well.  Indeed,
calling (thing-at-point 'url) on an URL with `,' like
"http://www.google.com/search?q=foo,bar" returns the complete URL.
Perhaps there are other differences, but the comma case seems to be
the same in both.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: FFAP
  2009-11-09  0:52             ` FFAP Juri Linkov
@ 2009-11-09  6:33               ` Stefan Monnier
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2009-11-09  6:33 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Edward O'Connor, emacs-devel

> FFAP is already mode-aware, but IMHO its code is ugly.  It puts
> all supported modes into `ffap-alist'.  Maybe we should reimplement
> this in `thing-at-point' exposing a generic interface for modes
> to be able to add their mode-specific settings (like e.g. imenu does
> with `imenu-generic-expression').

That sounds like a good way to attack the problem, yes.


        Stefan




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

* Re: FFAP
  2009-11-09  0:56 ` FFAP Juri Linkov
@ 2009-11-09 18:14   ` MON KEY
  2009-11-10  7:44     ` FFAP Juri Linkov
  0 siblings, 1 reply; 16+ messages in thread
From: MON KEY @ 2009-11-09 18:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

On Sun, Nov 8, 2009 at 7:56 PM, Juri Linkov <juri@jurta.org> wrote:
>> Currently (thing-at-point 'url) will not reliably return the URL at point in a
>> good deal of corner cases; URL's containing `,' being a good case in point.
>
> Like URL part of `ffap-string-at-point-mode-alist', it counterpart
> `thing-at-point-url-path-regexp' contains `,' as well.  Indeed,
> calling (thing-at-point 'url) on an URL with `,' like
> "http://www.google.com/search?q=foo,bar" returns the complete URL.
> Perhaps there are other differences, but the comma case seems to be
> the same in both.

Yes. You are correct. I am mistaking `thing-at-point' w/
`url-get-url-at-point' and var `url-get-url-filename-chars'
which do fail. Sorry for the noise.

,---- :FILE /url/url-util.el
| (eval-and-compile
|   (defvar url-get-url-filename-chars "-%.?@a-zA-Z0-9()_/:~=&"
|     "Valid characters in a URL."))
`----

(require 'url-util)
Then evaluate `url-get-url-at-point' for following:

http://www.google.com/search?q=foo,bar
http://www.vintagefashionguild.org/component/option,com_alphacontent/section,6/cat,59/task,view/id,496/Itemid,100/
http://apex.oracle.com/pls/otn/f?p=2400:1001:3681485306497103::NO::F2400_P1001_BACK_PAGE,F2400_P1001_PUB_MAIL_ID:1010,77177

:SEE-ALSO Sam Steingold's function `get-quotes-pf' with commented
gripes pertaining `,' in URL's:
(URL `http://clocc.cvs.sourceforge.net/*checkout*/clocc/clocc/src/cllib/gq.lisp')

>
>Juri Linkov
s_P




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

* Re: FFAP
  2009-11-09 18:14   ` FFAP MON KEY
@ 2009-11-10  7:44     ` Juri Linkov
  2009-11-10 14:03       ` FFAP Stefan Monnier
  0 siblings, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2009-11-10  7:44 UTC (permalink / raw)
  To: MON KEY; +Cc: emacs-devel

>> Like URL part of `ffap-string-at-point-mode-alist', it counterpart
>> `thing-at-point-url-path-regexp' contains `,' as well.  Indeed,
>> calling (thing-at-point 'url) on an URL with `,' like
>> "http://www.google.com/search?q=foo,bar" returns the complete URL.
>> Perhaps there are other differences, but the comma case seems to be
>> the same in both.
>
> Yes. You are correct. I am mistaking `thing-at-point' w/
> `url-get-url-at-point' and var `url-get-url-filename-chars'
> which do fail. Sorry for the noise.

So this is a third package to get an URL at point :)

> ,---- :FILE /url/url-util.el
> | (eval-and-compile
> |   (defvar url-get-url-filename-chars "-%.?@a-zA-Z0-9()_/:~=&"
> |     "Valid characters in a URL."))
> `----

Let's compare allowed URL characters for all of them:

ffap        "--:=&?$+@-Z_[:alpha:]~#,%;*"
thingatpt   "[^]\t\n \"'<>[^`{}]*[^]\t\n \"'<>[^`{}.,;]+"
url-util    "-%.?@a-zA-Z0-9()_/:~=&"

> Then evaluate `url-get-url-at-point' for following:
>
> http://www.vintagefashionguild.org/component/option,com_alphacontent/section,6/cat,59/task,view/id,496/Itemid,100/

This URL is from Joomla that uses commas to separate keywords.
Commas are also frequent in Drupal where they separate tags.
So I think a comma should be added to `url-get-url-filename-chars'.

> :SEE-ALSO Sam Steingold's function `get-quotes-pf' with commented
> gripes pertaining `,' in URL's:
> (URL `http://clocc.cvs.sourceforge.net/*checkout*/clocc/clocc/src/cllib/gq.lisp')

`,' in URLs are very common nowadays.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: FFAP
  2009-11-10  7:44     ` FFAP Juri Linkov
@ 2009-11-10 14:03       ` Stefan Monnier
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2009-11-10 14:03 UTC (permalink / raw)
  To: Juri Linkov; +Cc: MON KEY, emacs-devel

>> Yes. You are correct. I am mistaking `thing-at-point' w/
>> `url-get-url-at-point' and var `url-get-url-filename-chars'
>> which do fail. Sorry for the noise.

> So this is a third package to get an URL at point :)

If someone could consolidate those 3 into a single function, that would
be appreciated.


        Stefan




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

end of thread, other threads:[~2009-11-10 14:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-21 22:34 ffap Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2009-11-06  0:13 find-file-literally-at-point Edward O'Connor
2009-11-06  1:45 ` find-file-literally-at-point Juri Linkov
2009-11-06  4:20   ` FFAP (was: find-file-literally-at-point) Stefan Monnier
2009-11-06  4:41     ` FFAP Miles Bader
2009-11-06 15:20       ` FFAP Stefan Monnier
2009-11-06  4:45     ` FFAP Juri Linkov
2009-11-06  8:50       ` FFAP Eli Zaretskii
2009-11-06 10:37         ` FFAP Juri Linkov
2009-11-06 15:18       ` FFAP Stefan Monnier
2009-11-06 21:19         ` FFAP Juri Linkov
2009-11-07  1:32           ` FFAP Stefan Monnier
2009-11-09  0:52             ` FFAP Juri Linkov
2009-11-09  6:33               ` FFAP Stefan Monnier
2009-11-07 18:18 FFAP MON KEY
2009-11-09  0:56 ` FFAP Juri Linkov
2009-11-09 18:14   ` FFAP MON KEY
2009-11-10  7:44     ` FFAP Juri Linkov
2009-11-10 14:03       ` FFAP Stefan Monnier

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