From: "Андрей Парамонов" <cmr.pent@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: fx@gnu.org, 7329@debbugs.gnu.org
Subject: bug#7329: [Patch] Enable completion in inferior-python-mode
Date: Tue, 16 Nov 2010 11:41:59 +0300 [thread overview]
Message-ID: <AANLkTimUGkv5MWQw0tgyBSN1N_-Cr-MEQYZNzYAHCkRE@mail.gmail.com> (raw)
In-Reply-To: <jwvy68yjknj.fsf-monnier+emacs@gnu.org>
2010/11/13 Stefan Monnier <monnier@iro.umontreal.ca>:
> That patch doesn't look bad at all. The \\= construct means "match
> point", i.e. (re-search-backward ">>> \\=" nil t) is very much like
> (looking-back ">>> "). So if that doesn't work it's probably because
> there is text between the ">>> " prompt and point.
> Do you happen to know what that text is, so we can assess whether we can
> just plainly ignore it as you do, or whether there's more to it.
The text between >>> and point is what I'm going to complete. I think
it can be anything.
> E.g. maybe we should use
> (re-search-backward "^>>> " (line-beginning-position) t)
Good idea. I missed that re-search-backward jumps over linebreaks by
default. Thinking a bit more, (re-search-backward "^\(>>>|...\) "
(line-beginning-position) t) is even better as it allows completion
inside loops.
> so that we won't be searching back for umpteen megabytes of output until
> we accidentally find some unrelated prompt.
> Then again, maybe the issue is simply that since we're always in the
> process-buffer in the first place, point is not at the expected place
> (the code currently expects point to stay put right after the prompt,
> whereas in the inferior-python case point may have simply been pushed
> down by the process's output), in which case the right solution may be
> to explicitly store the earlier position of point and don't expect that
> (with-current-buffer (process-buffer (or proc (python-proc))) will
> automatically place us back at the same position.
>
My understanding about these checks is to avoid interacting with
interpreter while we at something like
while True:
pass
or just doing a long processing. For completion we are using the same
interpreter. Requesting completion would freeze Emacs in such a case.
Thanks for your support,
Andrey Paramonov
next prev parent reply other threads:[~2010-11-16 8:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87iq0dhwwd.fsf@neo.paramonovs>
2010-11-04 17:11 ` bug#7329: Fwd: 23.2; inferior-python-mode: completion does not work Андрей Парамонов
2010-11-12 20:08 ` bug#7329: [Patch] Enable completion in inferior-python-mode Андрей Парамонов
2010-11-12 21:35 ` Stefan Monnier
2010-11-16 8:41 ` Андрей Парамонов [this message]
2010-11-16 8:43 ` Андрей Парамонов
2010-11-17 13:14 ` Stefan Monnier
2010-11-19 20:33 ` Андрей Парамонов
2010-11-28 16:14 ` Dave Love
2012-04-11 11:31 ` Lars Magne Ingebrigtsen
2012-04-11 11:47 ` Андрей Парамонов
2012-04-11 11:59 ` Lars Magne Ingebrigtsen
2012-04-11 12:08 ` Андрей Парамонов
2012-04-11 11:47 ` Leo
2012-04-11 16:26 ` Glenn Morris
2012-07-28 14:23 ` bug#7329: Fwd: 23.2; inferior-python-mode: completion does not work Chong Yidong
2012-07-28 15:10 ` Андрей Парамонов
2012-07-28 15:14 ` Chong Yidong
2012-07-28 15:35 ` Андрей Парамонов
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=AANLkTimUGkv5MWQw0tgyBSN1N_-Cr-MEQYZNzYAHCkRE@mail.gmail.com \
--to=cmr.pent@gmail.com \
--cc=7329@debbugs.gnu.org \
--cc=fx@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).