From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#18244: 24.3.92; Error with semantic-mode when python buffers are present. Date: Mon, 18 May 2015 06:31:50 +0200 Message-ID: <87r3qey095.fsf@gmail.com> References: <87ppg75xw4.fsf@gmail.com> <87mwbb5fms.fsf@gmail.com> <87sil2s27d.fsf@gmail.com> <877g25zre7.fsf@gmail.com> <87wqa5ghf1.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1431923604 22344 80.91.229.3 (18 May 2015 04:33:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 May 2015 04:33:24 +0000 (UTC) Cc: "=?UTF-8?Q?Fabi=C3=A1n?= E. Gallina" , 18244@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 18 06:33:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YuCjo-0005b1-JX for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 May 2015 06:33:12 +0200 Original-Received: from localhost ([::1]:39110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuCjn-0007d4-F6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 May 2015 00:33:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuCji-0007cz-UO for bug-gnu-emacs@gnu.org; Mon, 18 May 2015 00:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuCje-0000QT-S6 for bug-gnu-emacs@gnu.org; Mon, 18 May 2015 00:33:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuCje-0000QO-Nw for bug-gnu-emacs@gnu.org; Mon, 18 May 2015 00:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YuCje-0000hQ-Ai for bug-gnu-emacs@gnu.org; Mon, 18 May 2015 00:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 May 2015 04:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18244 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18244-submit@debbugs.gnu.org id=B18244.14319235262616 (code B ref 18244); Mon, 18 May 2015 04:33:02 +0000 Original-Received: (at 18244) by debbugs.gnu.org; 18 May 2015 04:32:06 +0000 Original-Received: from localhost ([127.0.0.1]:48483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YuCij-0000g7-Rp for submit@debbugs.gnu.org; Mon, 18 May 2015 00:32:06 -0400 Original-Received: from mail-wi0-f179.google.com ([209.85.212.179]:35837) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YuCii-0000fc-2z for 18244@debbugs.gnu.org; Mon, 18 May 2015 00:32:04 -0400 Original-Received: by wicmx19 with SMTP id mx19so63200122wic.0 for <18244@debbugs.gnu.org>; Sun, 17 May 2015 21:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; bh=OOKfIB0tFPZz2KehvG3OaOPVPYmY8EXLnNA5ct8Xfco=; b=iV5/7Ta4tBvoE/WP0WQGAks8g0dsp04nWYXnlS4KZrzFywsbKfTmmg1sl+A9kxbTRv sOX8eEU8LJyXcZyj5l/t3Xt1N/a9HynGYwvyGAurStLkcjS/wxFH+iGxMxNNGNCJKMzx 74BUAuKlU2SLjgHtSJIBIb61b1VfGC9Y221DvBRZvxAbUc9Qa8EQlPp9PpbG1A8rztrh I1tSKP8BnjuMRIb9YAsumXny/kUknUu+QSNPg5toxh7NNY7L2cymO45lXL/zbV5tjLtY wzqjD3EXf41xTOveZaF9h93WY1qhKrX2MsdN9qMuqwXCIjPWksbcJX+50oJV205E2DKE eeUw== X-Received: by 10.180.88.72 with SMTP id be8mr18497305wib.42.1431923518177; Sun, 17 May 2015 21:31:58 -0700 (PDT) Original-Received: from dell-14z ([37.163.151.230]) by mx.google.com with ESMTPSA id bm9sm14851357wjc.21.2015.05.17.21.31.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 21:31:56 -0700 (PDT) In-reply-to: <87wqa5ghf1.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102915 Archived-At: Thierry Volpiatto writes: > Stefan Monnier writes: > >>> Remove the let-binding completely and use only: >> >>> (set (make-local-variable 'python-shell-interpreter) python-shell-interpreter) >>> (set (make-local-variable 'python-shell-interpreter-args) python-shell-interpreter-args) >> >> I can't see why that would help. This removes let-bindings of `args' >> and `interpreter' but these vars are never made buffer-local >> (hopefully), so the warning can't be about these vars being made >> buffer-local while they're let-bound. > > Indeed yes, I will have another look (more carefully this time). I see this have not been fixed, still have warnings about python-shell-interpreter and python-shell-interpreter-args made local while let-bound when opening a python file. Using the following patch fix the problem, but as I am not familiar with pyhon.el, please review. Changes from HEAD to working tree 1 file changed, 6 insertions(+), 18 deletions(-) lisp/progmodes/python.el | 24 ++++++------------------ Modified lisp/progmodes/python.el diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 4b0a028..1b4cf2f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2496,15 +2496,8 @@ initialization of the interpreter via `python-shell-setup-codes' variable. \(Type \\[describe-mode] in the process buffer for a list of commands.)" - (let ((interpreter python-shell-interpreter) - (args python-shell-interpreter-args)) - (when python-shell--parent-buffer - (python-util-clone-local-variables python-shell--parent-buffer)) - ;; Users can override default values for these vars when calling - ;; `run-python'. This ensures new values let-bound in - ;; `python-shell-make-comint' are locally set. - (set (make-local-variable 'python-shell-interpreter) interpreter) - (set (make-local-variable 'python-shell-interpreter-args) args)) + (when python-shell--parent-buffer + (python-util-clone-local-variables python-shell--parent-buffer)) (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil) (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil) (python-shell-prompt-set-calculated-regexps) @@ -2553,16 +2546,11 @@ killed." (buffer (apply #'make-comint-in-buffer proc-name proc-buffer-name interpreter nil args)) (python-shell--parent-buffer (current-buffer)) - (process (get-buffer-process buffer)) - ;; As the user may have overridden default values for - ;; these vars on `run-python', let-binding them allows - ;; to have the new right values in all setup code - ;; that's is done in `inferior-python-mode', which is - ;; important, especially for prompt detection. - (python-shell-interpreter interpreter) - (python-shell-interpreter-args - (mapconcat #'identity args " "))) + (process (get-buffer-process buffer))) (with-current-buffer buffer + (set (make-local-variable 'python-shell-interpreter) interpreter) + (set (make-local-variable 'python-shell-interpreter-args) + (mapconcat #'identity args " ")) (inferior-python-mode)) (when show (display-buffer buffer)) (and internal (set-process-query-on-exit-flag process nil)))) -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997