GNU bug report logs -
#18244
24.3.92; Error with semantic-mode when python buffers are present.
Previous Next
Full log
View this message in rfc822 format
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:
> Stefan Monnier <monnier <at> IRO.UMontreal.CA> 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
This bug report was last modified 10 years and 12 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.