From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24110: [PATCH] Fix python.el completion with IPython 5.0 and python 2 Date: Mon, 03 Jul 2017 11:15:11 -0400 Message-ID: <8760f9k0w0.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499095602 4375 195.159.176.226 (3 Jul 2017 15:26:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2017 15:26:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 24110@debbugs.gnu.org To: James Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 03 17:26:38 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS3FE-0000pa-Je for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 17:26:36 +0200 Original-Received: from localhost ([::1]:35849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS3FK-000394-2Q for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 11:26:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS337-00010T-Sr for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 11:14:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS334-0001iC-JX for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 11:14:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS334-0001i3-Fx for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 11:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dS334-0007JE-B0 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 11:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jul 2017 15:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24110 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24110-submit@debbugs.gnu.org id=B24110.149909482428063 (code B ref 24110); Mon, 03 Jul 2017 15:14:02 +0000 Original-Received: (at 24110) by debbugs.gnu.org; 3 Jul 2017 15:13:44 +0000 Original-Received: from localhost ([127.0.0.1]:50489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS32m-0007IU-5Y for submit@debbugs.gnu.org; Mon, 03 Jul 2017 11:13:44 -0400 Original-Received: from mail-io0-f181.google.com ([209.85.223.181]:35822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS32j-0007I8-Kq; Mon, 03 Jul 2017 11:13:42 -0400 Original-Received: by mail-io0-f181.google.com with SMTP id h134so58345863iof.2; Mon, 03 Jul 2017 08:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/yd9DHeaTcsO4qnD9X+4TvnR0J+s0kJbtFLuMnNfmRE=; b=CEfDm/F1N1KLQGF8aepr/PEnrwEMwoTb8ztTjXFbiMIqMn7J6WNVJvUpTqWLxK3HA6 Vjz8XAKhBFWEGQbhVNSyzQZTJHSkQexOjTBmtu1Db10dSPPCIPDLlVWUbtt8F7aqZkDu 4Ato3j/9WbkNv4ZW54tUwUiPuHmhUQvVwV063+btGpQYQsrFqd0bCfPtJHTAqzL+YoYp SYouQn6ZUQxeKJ21mXZLHuVuhQC/Rt2i5Ug7Ohoq5/do4/se/qg0fDC9JRecp/sODje0 T3mHH3yDsjtFEWRLqHsvhk88A7tjrIr0dSlayltgmkPQewr6ameGA7oclHOAWSrhNiOD /hAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/yd9DHeaTcsO4qnD9X+4TvnR0J+s0kJbtFLuMnNfmRE=; b=IWSrGwEUqt65j4SWvZITYIn7d1X01zdFDh71Sc54STagZkT8JTINLZBzBtfU4yadTR hryWv9OSwLOq2ubSd6h7sLlk0hDx46Lg4bFmmSf1epa2aHVoIBq40P84zuEvceEOG3gr 6iS65Kre47XmpzIE3iwI4uh3b2XNIp1hqJHphUGW+Jw53CT+l4YKgP4wscA6vXVIqAGp 77uqi4xFpfWdsmlei7jniQ+fGiLyw/G3uWMkFkKdUSzoupt6FifeDdSj8LjnVfwkDr7c S95ZZdNFLYyufK2AsM4znOjUrVqvksH/1lNNlphZYwWysgBSOQVyZBlIPbGMQe647LUE /HJA== X-Gm-Message-State: AKS2vOybfxvUCrUqfDnTAKSGscSKf8Ef/CocEBV/nhW4Ysu0d/DI/IsS EyTJ03Df8VWMoQiE X-Received: by 10.107.137.152 with SMTP id t24mr36452789ioi.218.1499094815659; Mon, 03 Jul 2017 08:13:35 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id j76sm8523968ioi.14.2017.07.03.08.13.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2017 08:13:34 -0700 (PDT) In-Reply-To: (James Porter's message of "Fri, 29 Jul 2016 21:01:16 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134128 Archived-At: close 24110 quit James Porter writes: > (defcustom python-shell-completion-string-code > - "';'.join(__PYTHON_EL_get_completions('''%s'''))" > + "print(';'.join(__PYTHON_EL_get_completions('''%s''')))" This patch is no longer applicable, in 25.1 there is already a 'print' added by python-shell-completion-get-completions. (defun python-shell-completion-get-completions (process import input) "Do completion at point using PROCESS for IMPORT or INPUT. When IMPORT is non-nil takes precedence over INPUT for completion." (setq input (or import input)) (with-current-buffer (process-buffer process) (let ((completions (python-util-strip-string (python-shell-send-string-no-output (format (concat python-shell-completion-setup-code "\nprint (" python-shell-completion-string-code ")") input) process)))) (when (> (length completions) 2) (split-string completions "^'\\|^\"\\|;\\|'$\\|\"$" t)))))