all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file
Date: Thu, 28 Jan 2016 04:11:56 -0600	[thread overview]
Message-ID: <86si1i813n.fsf@stephe-leake.org> (raw)
In-Reply-To: <56A9DDA8.9080504@yandex.ru> (Dmitry Gutov's message of "Thu, 28 Jan 2016 12:21:44 +0300")

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/28/2016 04:04 AM, Stephen Leake wrote:
>> Any objections to the attached patch?
>
> A couple:
>
> - IIRC, using INITIAL-INPUT argument is semi-deprecated. Using DEFAULT
> is preferable, 

I was not aware of M-n (more below).

> and then you don't need to make that value depend on
> current-prefix-arg. 

Actually, I did not intend to make it depend on current-prefix-arg, as
the doc string does not mention that; I forgot to fix that when I copied
from my current code.

On the other hand, it makes sense to give the user some control over
whether the file at point is used.

In any case, we can call `thing-at-point' in the
completing-read call for either INITIAL-INPUT or DEFAULT.

> We can always set the default input, and if the user wants to use it,
> they will press M-n. 

I was not aware of that use of M-n; that is a good alternative to
current-prefix-arg.

However, the default still does not show anywhere;
we should add it to the prompt.

> And I see no good reason to thread it through the command's function
> arguments. Why not do it like in the patch at the bottom?

Because there are also times when calling `project-find-file' from lisp
with a filename makes sense. But that code can call
project--find-file-in, instead of project-find-file.

> - More importantly, the new generic function should not do too much.
> It should return a completion table, which can dispatch to ede,
> ada-mode, or any other facility. I believe we've went over this a
> couple of times already.

So instead of computing `table' in project--find-file-in, it would
call (project--file-completion-table dirs project). The default
implementation of `project--file-completion-table' would be the code
using `find-program'.

I'll give that a try.

-- 
-- Stephe



  reply	other threads:[~2016-01-28 10:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  1:04 make project--find-in-file generic, add interactive filename to project-find-file Stephen Leake
2016-01-28  9:21 ` Dmitry Gutov
2016-01-28 10:11   ` Stephen Leake [this message]
2016-01-28 10:36     ` Dmitry Gutov
2016-01-28 13:14       ` Stefan Monnier
2016-01-28 19:32         ` Dmitry Gutov
2016-01-28 21:11           ` Stefan Monnier
2016-01-28 21:22             ` Dmitry Gutov
2016-01-28 22:44               ` Stefan Monnier
2016-01-29  2:10                 ` Dmitry Gutov
2016-01-29  2:57                   ` Stefan Monnier
2016-01-29  4:20                     ` Dmitry Gutov
2016-01-29 14:05                       ` Stefan Monnier
2016-01-29 21:53                         ` Dmitry Gutov
2016-01-31  6:18                           ` Stefan Monnier
2016-01-31 14:02                             ` Dmitry Gutov
2016-01-31 14:23                               ` Stefan Monnier
2016-02-01  8:08                                 ` Dmitry Gutov
2016-02-01 13:40                                   ` Stefan Monnier
2016-01-29  2:05             ` Dmitry Gutov
2016-01-29  2:55               ` Stefan Monnier
2016-01-29  4:11                 ` Dmitry Gutov
2016-01-29 14:03                   ` Stefan Monnier
2016-01-29 21:35                     ` Dmitry Gutov
2016-01-30  2:07                       ` Stefan Monnier
2016-01-30 23:32               ` Juri Linkov
2016-01-31  0:40                 ` Dmitry Gutov
2016-01-28 11:06     ` Stephen Leake
2016-01-28 11:11       ` Stephen Leake
2016-01-29  2:18       ` Dmitry Gutov
2016-01-29 23:55         ` Stephen Leake
2016-01-30  0:15           ` Dmitry Gutov

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=86si1i813n.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /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.