From: "João Távora" <joaotavora@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: master e1d24f3 1/2: New fido-mode, emulates ido-mode with icomplete-mode
Date: Mon, 9 Dec 2019 00:59:19 +0100 [thread overview]
Message-ID: <CALDnm52v65h0OicX1p9gx2vHNp6ciCYBk9asFWGBUini+qR8Gw@mail.gmail.com> (raw)
In-Reply-To: <fe412552-a7d2-a2a6-3e89-b9f93430cffe@yandex.ru>
On Mon, Dec 9, 2019 at 12:45 AM Dmitry Gutov <dgutov@yandex.ru> wrote:
>
> Hi Joao!
>
> > New fido-mode, emulates ido-mode with icomplete-mode
>
> This looks pretty rad!
Thanks Dmitry, really glad you like it.
And I'm also glad you mention the missing bits, because it gives me the
opportunity to add some more things to that list.
1. Yes it probably needs those two things (though the current idle delay
seems OK for me).
2. Another thing it needs is to simplify how you display the already
matched candidate. Sometimes some weird {...} will show up that I can't
interpret. Again, I just want it to work like ido.
3. It needs to remember entered directory history, again just like ido
(or at least I remember ido used to do that).
Don't have a good plan how to do this yet.
4. it needs to be able to C-x f history-fragment M-p M-p ...
This last one is proving extremely challenging. I want to do it with
reverse isearch, instead of reinvent the wheel, of course. It seems
within reach because if I do C-x f C-M-r history-fragment C-r C-r I get
what i want. But of course fido's mission is to do it just like ido.
The problem I'm having is how to simulate pasting the history-fragment
bit after I start a reverse isearch. There are no hook., I've tried
timers, internal isearch variables, always failed.
Who can help me? Here's what I have:
(defun icomplete--category ()
(let* ((beg (icomplete--field-beg))
(md (completion--field-metadata beg)))
(alist-get 'category (cdr md))))
(defun icomplete-fido-previous-input (n)
"Recall previous input or start a reverse-isearch."
(interactive "p")
(let* ((field-string (icomplete--field-string))
(isearch-initial-string (and (eobp)
(if (eq (icomplete--category) 'file)
(file-name-nondirectory field-string)
field-string))))
(cond ((or (null isearch-initial-string)
(string-empty-p isearch-initial-string))
(previous-history-element n))
(t
(delete-region (- (point-max) (length isearch-initial-string))
(point-max))
;; How to I make `isearch-backward' start with
;; `isearch-initial-string'????
(isearch-backward)))))
João
next prev parent reply other threads:[~2019-12-08 23:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191105230155.6240.32765@vcs0.savannah.gnu.org>
[not found] ` <20191105230157.6BEC120C06@vcs0.savannah.gnu.org>
2019-12-08 23:45 ` master e1d24f3 1/2: New fido-mode, emulates ido-mode with icomplete-mode Dmitry Gutov
2019-12-08 23:59 ` João Távora [this message]
2019-12-10 0:42 ` 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=CALDnm52v65h0OicX1p9gx2vHNp6ciCYBk9asFWGBUini+qR8Gw@mail.gmail.com \
--to=joaotavora@gmail.com \
--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.