unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: emacs-devel@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extracted from etags.el
Date: Wed, 26 Dec 2018 05:34:56 +0200	[thread overview]
Message-ID: <c816639e-bec9-5ea4-fe30-4c9c6109411d@yandex.ru> (raw)
In-Reply-To: <20180922154640.9D58220310@vcs0.savannah.gnu.org>

Hi Stefan,

I've only noticed this change recently, hence this late email.

On 22.09.2018 18:46, Stefan Monnier wrote:

> +(cl-defgeneric project-files (project &optional dirs)
> +  "Return a list of files in directories DIRS in PROJECT.
> +DIRS is a list of absolute directories; it should be some
> +subset of the project roots and external roots."
> +  ;; This default implementation only works if project-file-completion-table
> +  ;; returns a "flat" completion table.

That sounds like a fair concern, never thought about it. Do we want to 
have both as generic functions, though? People will have to take care to 
keep them in sync.

> +  ;; FIXME: Maybe we should do the reverse: implement the default
> +  ;; `project-file-completion-table' on top of `project-files'.

Originally I figured that having the completion table be a basic part of 
the propocol gives some benefits:

* If there's a background process that filters files faster than Emacs, 
then it could actually provide faster file completion.
* Completion table is a "lazy" value, which can be handy.

Not sure if item 1 is ever going to materialize, and it would only help 
in certain cases. But since file listing can be slow sometimes, should 
we consider having some other kind of return value, for performance?

Say, a stream of some kind. It could be handy for multifile-based 
commands, since they only show one file at a time. Ideally, though, the 
stream should be easily composable with external tools like Grep.

Ideas?

> +  (all-completions
> +   "" (project-file-completion-table
> +       project (or dirs (project-roots project)))))
> +
>   (defgroup project-vc nil
>     "Project implementation using the VC package."
>     :version "25.1"
> @@ -389,12 +401,17 @@ recognized."
>     ;; removing it when it has no matches.  Neither seems natural
>     ;; enough.  Removal is confusing; early expansion makes the prompt
>     ;; too long.
> -  (let* ((new-prompt (if default
> +  (let* (;; (initial-input
> +         ;;  (let ((common-prefix (try-completion "" collection)))
> +         ;;    (if (> (length common-prefix) 0)
> +         ;;        (file-name-directory common-prefix))))

Interesting suggestion if we only want to use this function in 
project-find-file. I see the same effect, though, if I just press TAB.

Or I can right away type a unique file name, press TAB and see it 
completed to the full file name. I wonder what other people think; I 
still haven't managed to get off Ido, personally.

> +;;;###autoload
> +(defun project-search (regexp)

> +;;;###autoload
> +(defun project-query-replace (from to)

I'm not a fan of these names. I know they kind of mirror what we already 
have in the dired- namespace, but can't we do better? Maybe rename 
dired-do-search and dired-do-query-replace-regexp later as well.

I think it's going to be hard for a user to differentiate between 
project-find-regexp and project-search. And that they might also have a 
guess that the latter "searches" for a project among the opened ones.

Should we move both commands to the multifile package and name them, for 
instance, multifile-project-find-regexp (or multifile-project-search) 
and multifile-project-query-replace-regexp?

Originally we thought that this kind of UI preference would be enacted 
using xref-show-xrefs-function, but apparently that's not so easy to do.



       reply	other threads:[~2018-12-26  3:34 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180922154639.23195.66360@vcs0.savannah.gnu.org>
     [not found] ` <20180922154640.9D58220310@vcs0.savannah.gnu.org>
2018-12-26  3:34   ` Dmitry Gutov [this message]
2018-12-26 20:13     ` [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extracted from etags.el Stefan Monnier
2018-12-27  1:49       ` Dmitry Gutov
2018-12-27 14:39         ` Stefan Monnier
2018-12-28  3:45           ` Dmitry Gutov
2018-12-31 11:42             ` Dmitry Gutov
2018-12-31 15:12               ` Eli Zaretskii
2019-01-02 23:47                 ` Dmitry Gutov
2019-01-02  1:49               ` Stefan Monnier
2019-01-03  0:41                 ` Dmitry Gutov
2019-01-02 21:53               ` Juri Linkov
2019-01-02 23:02                 ` Dmitry Gutov
2019-01-03  0:37                   ` Juri Linkov
2019-01-03 11:45                     ` Dmitry Gutov
2019-01-03 20:53                       ` Juri Linkov
2019-01-06  1:22                         ` Dmitry Gutov
2019-01-07 23:22                           ` Dmitry Gutov
2019-01-07 23:27                             ` Dmitry Gutov
2019-01-08 14:21                             ` Michael Albinus
2019-01-08 23:06                               ` Dmitry Gutov
2019-01-09  8:10                                 ` Michael Albinus
2019-01-09 15:24                                   ` Dmitry Gutov
2019-01-09 14:57                             ` Dmitry Gutov
2019-01-09 23:15                               ` Juri Linkov
2019-01-10 10:20                                 ` Dmitry Gutov
2019-01-10 21:41                                   ` Juri Linkov
2019-01-12  1:48                                     ` Dmitry Gutov
2019-01-18  3:52                 ` Dmitry Gutov
2019-01-18 12:49                   ` Stefan Monnier
2019-01-18 19:28                     ` Dmitry Gutov
2019-01-18 21:11                       ` Stefan Monnier
2019-01-18 22:53                         ` Dmitry Gutov
2018-12-29  0:27           ` Dmitry Gutov
2018-12-29 17:09             ` Dmitry Gutov
2018-12-29 21:54               ` Juri Linkov
2018-12-30 23:06                 ` Dmitry Gutov
2019-01-02  1:48                 ` Stefan Monnier
2019-01-02 22:05                   ` Juri Linkov
2019-01-03  3:44                     ` Stefan Monnier
2019-01-03 20:45                       ` Juri Linkov
2019-01-12  1:10           ` Making project-files the "canonical" generic, was: " Dmitry Gutov
2019-01-12 18:53             ` Making project-files the "canonical" generic Stephen Leake
2019-01-13  0:54               ` Dmitry Gutov
2019-01-15  1:14                 ` Stephen Leake
2019-01-16 16:38                   ` Stefan Monnier
2019-01-17  2:23                     ` Dmitry Gutov
2019-01-17 13:25                       ` Stefan Monnier
2019-01-18  1:00                         ` Dmitry Gutov
2019-01-16 19:02                   ` project--completing-read-strict breaks ada-mode project completion table Stephen Leake
2019-01-16 22:02                     ` Stephen Leake
2019-01-17 23:17                       ` Stephen Leake
2019-01-18  2:04                         ` Dmitry Gutov
2019-01-19  3:35                           ` Stephen Leake
2019-01-19 22:05                             ` Dmitry Gutov
2019-01-20 19:34                         ` Stephen Leake
2019-01-17  2:21                     ` Dmitry Gutov
2019-01-17 13:55                       ` Stefan Monnier
2019-01-17 21:35                         ` John Yates
2019-01-18  2:19                         ` Dmitry Gutov
2019-01-18  3:05                           ` Stefan Monnier
2019-01-19  0:26                             ` Dmitry Gutov
2019-01-21 19:32                           ` Stephen Leake
2019-01-22  0:09                             ` Dmitry Gutov
2019-02-07  1:20                             ` Stephen Leake
2019-02-11 21:50                               ` Stefan Monnier
2019-02-12  1:31                                 ` Stephen Leake
2019-02-15 15:50                                   ` Stephen Leake
2019-02-15 22:47                                     ` Stephen Leake
2019-02-15 23:38                                       ` Stephen Leake
2019-04-19 17:49                                     ` Stephen Leake
2019-05-03  0:48                                       ` Dmitry Gutov
2019-05-04 10:39                                         ` Stephen Leake
2019-05-07 18:02                                           ` Stephen Leake
2019-05-07 22:35                                             ` Dmitry Gutov
2019-05-08  1:53                                               ` Stefan Monnier
2019-05-14  2:14                                                 ` Dmitry Gutov
2019-05-14  2:13                                             ` Dmitry Gutov
2019-02-19 17:45                                   ` Stefan Monnier
2019-02-20 19:58                                     ` Stephen Leake
2019-02-21  2:00                                       ` Stefan Monnier
2019-01-21 19:36                           ` Stephen Leake
2019-01-22  0:20                             ` Dmitry Gutov
2019-01-17  3:04                   ` Making project-files the "canonical" generic Dmitry Gutov
2018-12-27 20:33         ` [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extracted from etags.el Juri Linkov
2018-12-27 23:31           ` Dmitry Gutov
2018-12-27 23:45             ` Juri Linkov
2018-12-28  6:04               ` Dmitry Gutov
2018-12-28 18:07           ` Stefan Monnier
2018-12-29  0:31             ` Dmitry Gutov
2018-12-29 22:02             ` Juri Linkov
2018-12-30 23:13               ` Dmitry Gutov
2019-01-02 22:11                 ` Juri Linkov
2019-01-02 23:23                   ` Dmitry Gutov
2019-01-03  0:44                     ` Juri Linkov
2019-01-03 11:52                       ` Dmitry Gutov
2019-01-03 15:35                         ` Stefan Monnier
2019-01-03 23:06                           ` Dmitry Gutov
2019-02-07 12:23                             ` Dmitry Gutov
2019-02-07 13:05                               ` Stefan Monnier
2019-02-14  1:11                                 ` Dmitry Gutov
2019-01-03 20:57                         ` Juri Linkov
2019-01-03 23:21                           ` Dmitry Gutov
2019-01-05 22:12                             ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=c816639e-bec9-5ea4-fe30-4c9c6109411d@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 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).