emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: patch: add-log.el: changelog find file under poin


From: Drew Adams
Subject: RE: patch: add-log.el: changelog find file under poin
Date: Mon, 21 Jan 2008 17:17:17 -0800

> > Yes, really.  ffap is a global mode which not everyone wants.
> > (I don't use it.)  This feature makes sense in Change Log mode.
>
> Actually this feature makes sense not only in Change Log mode,
> but in any buffer that contains a file name.  For everyone who
> doesn't want using ffap, I think it would be good to implement
> a feature that will always add a file name under point to the
> list of minibuffer's default values for C-x C-f.  So C-x C-f
> will keep its current behavior, and additionally will provide
> a file name under point available via M-n.

We went through this discusion at least once. See the thread "key to yank
text at point into minibuffer" of late Feb 2006.

* This post is the last one on-topic, and it reviews the arguments and use
cases:
http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg01074.html

* This mid-thread post is specifically about your argument to use `M-n' for
this vs my proposal to use another key:
http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg00664.html.

There are various ways to interpret the thingie at point - it could be a
file name or URL, but it could be other things also.

I would reserve `M-n' for things that the particular command deems would
make appropriate default values. That could include, in some cases,
something from the text at point - but it is the command that decides. That
is very different from always including a file name under point "in any
buffer".

I would prefer something like what we discussed in that 2006 thread, a
minibuffer key (I use `M-.') that is specifically for yanking text from the
buffer into the minibuffer.

That doesn't prohibit a particular command from also putting the file or URL
at point onto the future history list (`M-n'), but it separates the two:
general purpose yanking vs command-specific defaults. It doesn't always make
sense, for all commands in all buffers, for `M-n' to contain the file name
at point as one of its default values.

A general mechanism to yank buffer text to the minibuffer is useful. It
would be available for all commands in all buffers, and it would be
available at any time during minibuffer input. But it shouldn't be
confounded with minibuffer history/defaults.

You even agreed in the previous thread that we should separate the two:

 D> I'd prefer to keep the default-value list separate
 D> from this text-grabbing feature.

 J> Yes, they are separate features.

In the mechanism we discussed earlier, `M-.' has two possible modes (choice
via option): it either (1) cycles among alternative interpretations of the
thingie at point or (2) accumulates successive thingies (e.g. words) at
point, in either or both directions. In #1, each alternative replaces the
minibuffer input; in #2, the successive thingies are added to the input.

This approach, with option choice #1, provides the same cycling that you are
proposing via `M-n', but it doesn't mess up the set of default values
(`M-n'), which should be command-specific. A general mechanism to yank
buffer text should be on a different key.

I've been using this approach for a couple of years. It complements the
`M-n' history/defaults.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]