GNU bug report logs - #18244
24.3.92; Error with semantic-mode when python buffers are present.

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Mon, 11 Aug 2014 06:45:02 UTC

Severity: minor

Fixed in version 24.3.92

Done: fgallina <at> gnu.org (Fabián Ezequiel Gallina)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18244 in the body.
You can then email your comments to 18244 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 11 Aug 2014 06:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 11 Aug 2014 06:45:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.92; Error with semantic-mode when python buffers are present.
Date: Mon, 11 Aug 2014 08:43:21 +0200
1) Open some python files.
2) (semantic-mode 1)

Debugger entered--Lisp error: (file-error "Searching for program" "aucun fichier ou dossier de ce type" "nil")
  start-process("Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" #<buffer  *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*> "nil" "-i" "--autoindent")
  apply(start-process "Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" #<buffer  *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*> "nil" ("-i" "--autoindent"))
  start-file-process("Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" #<buffer  *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*> "nil" "-i" "--autoindent")
  apply(start-file-process "Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" #<buffer  *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*> "nil" ("-i" "--autoindent"))
  comint-exec-1("Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" #<buffer  *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*> "nil" ("-i" "--autoindent"))
  comint-exec(#<buffer  *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*> "Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" "nil" nil ("-i" "--autoindent"))
  make-comint-in-buffer("Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" " *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*" "nil" nil "-i" "--autoindent")
  apply(make-comint-in-buffer "Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" " *Python Internal [fab30fe3f846223fdafbc4e25eb683fd]*" "nil" nil ("-i" "--autoindent"))
  python-shell-make-comint("nil -i --autoindent" "Python Internal [fab30fe3f846223fdafbc4e25eb683fd]" nil t)
  run-python-internal()
  python-shell-internal-get-or-create-process()
  python-shell-internal-send-string("import sys;print ('\\n'.join(sys.path))")
  semantic-python-get-system-include-path()
  (progn (semantic-python-get-system-include-path))
  (if (and (featurep (quote python)) (not noninteractive)) (progn (semantic-python-get-system-include-path)))
  (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path))
  eval((when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)))
  byte-code("\303\304N\211.\203.	@\202.\n)!\207" [symbol sv exp eval saved-value] 4)
  custom-initialize-reset(semantic-python-dependency-system-include-path (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)))
  custom-declare-variable(semantic-python-dependency-system-include-path (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)) "The system include path used by Python language." :group python :group semantic :type (repeat (directory :tag "Directory")) :set #[(sym val) "\303	\"\210	.\304\305\nBC\306\307#\210\310\311\307\"\210\n\210)\312\313!\205\".\310\313\307\"\207" [sym val tmp0 set-default mode-local-bind semantic-dependency-system-include-path (mode-variable-flag t) python-mode mode-local-map-mode-buffers #[nil "\302\301!\210\211.\207" [tmp0 semantic-dependency-system-include-path make-local-variable] 2] fboundp semantic-decoration-unparsed-include-do-reset] 4])
  byte-code("\306\300\307\310\311\312\311\313\314\315\316\317&\210.\320\321	BC\322\323#\210\324\325\323\"\210	\210)\326\321\323.\327!\330.\n\204F.\211.\204F. ..\205E.\331..\".\n\203p.\f\204p.\n\332N\203_.\331.\n\332N\"\211.\204F.\n\211.\333N\206j.\n\334N)\211.\204J.\f,\335\336#\210\326\321\323\300#\207" [semantic-python-dependency-system-include-path tmp0 mode symbol bind name custom-declare-variable (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)) "The system include path used by Python language." :group python semantic :type (repeat (directory :tag "Directory")) :set #[(sym val) "\303	\"\210	.\304\305\nBC\306\307#\210\310\311\307\"\210\n\210)\312\313!\205\".\310\313\307\"\207" [sym val tmp0 set-default mode-local-bind semantic-dependency-system-include-path (mode-variable-flag t) python-mode mode-local-map-mode-buffers #[nil "\302\301!\210\211.\207" [tmp0 semantic-dependency-system-include-path make-local-variable] 2] fboundp semantic-decoration-unparsed-include-do-reset] 4] mode-local-bind semantic-dependency-system-include-path (mode-variable-flag t) python-mode mode-local-map-mode-buffers #[nil "\302\301!\210\211.\207" [tmp0 semantic-dependency-system-include-path make-local-variable] 2] put symbol-name nil intern-soft mode-local-symbol-table mode-local-parent derived-mode-parent variable-documentation "System path to search for include files." mode-local-active-mode major-mode] 12)
  wisent-python-default-setup()
  semantic-new-buffer-fcn()
  semantic-mode(1)
  eval((semantic-mode 1) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp)
  tv-eval-last-sexp-at-eol()
  call-interactively(tv-eval-last-sexp-at-eol nil nil)
  command-execute(tv-eval-last-sexp-at-eol)




In GNU Emacs 24.3.92.1 (x86_64-unknown-linux-gnu, X toolkit)
 of 2014-08-09 on dell-14z
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS

Configured using:
 `configure --with-x-toolkit=lucid --without-toolkit-scroll-bars
 --without-gconf --without-gsettings'

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  git-gutter-mode: t
  psession-mode: t
  golden-ratio-mode: t
  winner-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  auto-image-file-mode: t
  eldoc-in-minibuffer-mode: t
  show-paren-mode: t
  display-time-mode: t
  recentf-mode: t
  savehist-mode: t
  eldoc-mode: t
  minibuffer-depth-indicate-mode: t
  helm-mode: t
  helm-descbinds-mode: t
  shell-dirtrack-mode: t
  helm-adaptive-mode: t
  helm-match-plugin-mode: t
  helm-occur-match-plugin-mode: t
  tooltip-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<down> <down> <down> <f8> q M-x <down> <down> <return> 
M-p M-p M-p M-p M-p M-p M-p M-p M-p <return> 1 ) SPC 
O p e n SPC s o m e SPC p y t h o n SPC f i l e s . 
<return> 2 ) SPC M-( s e m a n t i c - m o d e SPC 
1 <right> <return> <return> M-y M-y M-y M-y <return> 
C-c C-c d n <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> M-< 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> C-c C-c ? r <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> C-c C-c <down> 
C-c C-k y C-< q C-< C-x C-² M-x <return>

Recent messages:
report-emacs-bug-hook: M-x report-emacs-bug was canceled, please read *Bug Help* buffer
Mark set [2 times]
NUL characters found, which may cause problems.  Continue sending? (d, r, s, e, ?):  [2 times]
Mark set
Sending...
message-send: No methods specified to send by
Mark set
Sending...
message-send: No methods specified to send by
Message modified; kill anyway? (y or n) y

Load-path shadows:
~/elisp/auctex/lpath hides ~/elisp/emacs-wget/lpath
/usr/local/share/emacs/24.3.92/lisp/emacs-lisp/tq hides ~/elisp/emms/lisp/tq

Features:
(help-mode mail-extr helm-ring cl-indent shadow epa-mail mule-util
emacsbug helm-command vc-rcs sh-script smie executable vc-git
naquadah-theme em-unix em-script em-prompt em-ls em-hist em-pred em-glob
em-dirs em-cmpl em-basic em-banner em-alias align-let git-gutter server
psession golden-ratio winner undo-tree diff slime-xref-browser
slime-banner slime-tramp slime-asdf slime-fancy slime-trace-dialog
slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
gud apropos etags arc-mode archive-mode image-file xdvi-search
preview-latex tex-site auto-loads pcomplete-extension pcmpl-unix
pcmpl-gnu em-term term disp-table ehelp helm-ipython helm-elisp
helm-eval python json eldoc-eval warnings whitespace paren time recentf
tree-widget savehist mu4e-config org-mu4e helm-mu mu4e-contrib mu4e
mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main mu4e-view
mu4e-headers mu4e-compose mu4e-draft mu4e-actions ido rfc2368 mu4e-mark
mu4e-message html2text mu4e-proc mu4e-utils mu4e-lists mu4e-about
mu4e-vars mu4e-meta gnus-dired nnir gnus-sum gnus-group gnus-undo nnmail
mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win nnoo
config-w3m w3m-search w3m doc-view jka-compr image-mode timezone
w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image
w3m-proc w3m-util w3m-load smtpmail-async smtpmail sendmail dired-async
iterator lacarte iedit-rect iedit iedit-lib smallurl mm-url gnus
gnus-ems nnheader wid-edit rectangle-utils rect ledger-config ledger
esh-var esh-io esh-cmd esh-opt esh-ext esh-proc eldoc esh-groups eshell
esh-module esh-mode esh-arg esh-util tv-utils async pcvs vc-cvs
pcvs-parse pcvs-info pcvs-defs pcvs-util ewoc mb-depth cl-info hyperspec
slime-autoloads esh-toggle flymake no-word htmlize cl dired-extension
emms-mpd-config emms-playlist-limit emms-volume emms-volume-amixer
emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon
emms-browser sort emms-playlist-sort emms-last-played emms-player-xine
emms-player-mpd tq emms-playing-time emms-lyrics emms-url hl-line
emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-ogginfo
emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mplayer
emms-info emms-streams later-do emms-source-playlist emms-source-file
emms-player-simple emms-setup emms emms-compat org-config-thierry ob-sh
org-crypt cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew
holidays hol-loaddefs appt diary-lib diary-loaddefs
org-annotation-helper addressbook-bookmark message rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader firefox-protocol
bookmark-firefox-handler bookmark-extensions org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob
ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs find-func cal-menu calendar cal-loaddefs init-helm-thierry
helm-mode helm-dictionary helm-ls-git helm-descbinds helm-ls-hg
helm-files image-dired tramp tramp-compat tramp-loaddefs trampver shell
pcomplete format-spec dired-x dired-aux ffap thingatpt helm-buffers
helm-elscreen helm-tags helm-bookmark helm-adaptive helm-info helm-net
browse-url xml url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse url-vars mailcap
helm-plugin bookmark pp helm-help helm-match-plugin helm-grep wgrep-helm
wgrep helm-regexp grep helm-external helm-utils dired compile comint
ansi-color ring helm-locate helm cl-macs gv vc vc-dispatcher helm-config
helm-aliases epa-file epa derived epg epg-config auth-source eieio
byte-opt bytecomp byte-compile cconv eieio-core gnus-util mm-util
mail-prsvr password-cache package time-date avoid cus-start cus-load
w3m-wget info easymenu edmacro kmacro advice help-fns net-utils
cl-loaddefs cl-lib tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting font-render-setting x-toolkit x multi-tty
emacs)

Memory information:
((conses 16 482044 40685)
 (symbols 48 54894 4)
 (miscs 40 386 1000)
 (strings 32 130267 14038)
 (string-bytes 1 3821416)
 (vectors 16 46164)
 (vector-slots 8 791234 24790)
 (floats 8 2153 314)
 (intervals 56 3232 0)
 (buffers 960 88)
 (heap 1024 34545 2356))
-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 11 Aug 2014 07:17:01 GMT) Full text and rfc822 format available.

Message #8 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 11 Aug 2014 03:16:44 -0400
Seems like you don't have "python" in your PATH.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 11 Aug 2014 13:19:01 GMT) Full text and rfc822 format available.

Message #11 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 11 Aug 2014 15:14:54 +0200
Glenn Morris <rgm <at> gnu.org> writes:

> Seems like you don't have "python" in your PATH.

I use ipython in my config, and indeed ipython is
not yet installed in my new OS. Now it is done, sorry for the noise,
maybe this should fail more gracefully ? Sending a useful error message
?

Thanks.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 11 Aug 2014 15:38:01 GMT) Full text and rfc822 format available.

Message #14 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 11 Aug 2014 11:37:52 -0400
Thierry Volpiatto wrote:

> I use ipython in my config, and indeed ipython is
> not yet installed in my new OS. Now it is done, sorry for the noise,
> maybe this should fail more gracefully ? Sending a useful error message
> ?

Yes, seems like an issue with both semantic and python.el
(which maybe does not need to call executable-find, and maybe does not
need its own special value for exec-path?).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Tue, 12 Aug 2014 05:39:02 GMT) Full text and rfc822 format available.

Message #17 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Tue, 12 Aug 2014 07:27:05 +0200
Glenn Morris <rgm <at> gnu.org> writes:

> Thierry Volpiatto wrote:
>
>> I use ipython in my config, and indeed ipython is
>> not yet installed in my new OS. Now it is done, sorry for the noise,
>> maybe this should fail more gracefully ? Sending a useful error message
>> ?
>
> Yes, seems like an issue with both semantic and python.el
> (which maybe does not need to call executable-find, and maybe does not
> need its own special value for exec-path?).

Also the (annoying) warning message about setting local vars while
let-bound can be easily avoided:

,----[ python.el, inferior-python-mode ]
|   (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))
|     [...]
`----


-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 18 Aug 2014 16:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: "Fabián E. Gallina" <fabian <at> anue.biz>
Cc: Glenn Morris <rgm <at> gnu.org>, 18244 <at> debbugs.gnu.org,
 Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 18 Aug 2014 12:20:13 -0400
Glenn said:
>> Yes, seems like an issue with both semantic and python.el
>> (which maybe does not need to call executable-find,

Haven't looked at the Semantic code, but I removed the executable-find
call in python.el since it was redundant anyway and hence ended up just
hiding the name of the program we're looking for.

I also added some FIXME comments in other code using executable-find
where several things look fishy.

Fabián, can you take a look at those FIXMEs?

>> and maybe does not need its own special value for exec-path?).

It does, in order to support Python's virtualenv.

BTW, Fabián, could you also rename python-shell-virtualenv-path to
something else (e.g python-shell-virtualenv-root or
python-shell-virtualenv-directory or python-shell-virtualenv-filename or
just python-shell-virtualenv?) since the GNU convention is to use "path"
only to mean "a list of directories in which we search", as in $PATH,
$MANPATH, load-path, ...

Thierry said:
> Also the (annoying) warning message about setting local vars while
> let-bound can be easily avoided:

I know the kind of message you're talking about, but I don't know when
it occurs.  Do you have a recipe?

> ,----[ python.el, inferior-python-mode ]
> |   (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))
> |     [...]
> `----

Not sure if someone installed your code already or what, but the above
looks identical to the current code.  Am I missing something?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 18 Aug 2014 16:37:01 GMT) Full text and rfc822 format available.

Message #23 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Glenn Morris <rgm <at> gnu.org>,
 Fabián E. Gallina <fabian <at> anue.biz>, 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 18 Aug 2014 18:24:34 +0200
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

> Thierry said:
>> Also the (annoying) warning message about setting local vars while
>> let-bound can be easily avoided:
>
> I know the kind of message you're talking about, but I don't know when
> it occurs.  Do you have a recipe?

It occur in the following code at beginning of `inferior-python-mode'

>
>
>> ,----[ python.el, inferior-python-mode ]
>> |   (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))
>> |     [...]
>> `----
>
> Not sure if someone installed your code already or what, but the above
> looks identical to the current code.  Am I missing something?

Yes :-) it is not my code but the current code where the change have to
occur.

IMO what you need is:

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)

But maybe I am wrong, I am not familiar with python.el.

@@ -2369,9 +2369,7 @@ variable.
-  (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))
+  (set (make-local-variable 'python-shell-interpreter) python-shell-interpreter)
+  (set (make-local-variable '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.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 18 Aug 2014 18:28:01 GMT) Full text and rfc822 format available.

Message #26 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>,
 "Fabián E. Gallina" <fabian <at> anue.biz>,
 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 18 Aug 2014 14:27:40 -0400
> 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.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Tue, 19 Aug 2014 05:48:02 GMT) Full text and rfc822 format available.

Message #29 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Glenn Morris <rgm <at> gnu.org>,
 Fabián E. Gallina <fabian <at> anue.biz>, 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Tue, 19 Aug 2014 07:44:41 +0200
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).

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Tue, 19 Aug 2014 14:28:01 GMT) Full text and rfc822 format available.

Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#18244: 24.3.92; Error with semantic-mode when python buffers
 are present.
Date: Tue, 19 Aug 2014 16:26:08 +0200
On 18.08.2014 20:27, Stefan Monnier wrote:
>> 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.
>
>
>          Stefan
>
>
>
>

Here some messages from M-x run-python RET

Get the first and second with latest pretest 24.3.93.1, but not before:

Making python-shell-interpreter local to *Python* while let-bound!
Making python-shell-interpreter-args local to *Python* while let-bound!
Sent python-shell-completion-setup-code
Sent python-ffap-setup-code
Sent python-eldoc-setup-code
You can run the command `run-python' with C-c C-p
Sent python-eldoc-setup-code
Mark set

Maybe of interest here?,

Andreas





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18244; Package emacs. (Mon, 18 May 2015 04:33:02 GMT) Full text and rfc822 format available.

Message #35 received at 18244 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Glenn Morris <rgm <at> gnu.org>,
 Fabián E. Gallina <fabian <at> anue.biz>, 18244 <at> debbugs.gnu.org
Subject: Re: bug#18244: 24.3.92;
 Error with semantic-mode when python buffers are present.
Date: Mon, 18 May 2015 06:31:50 +0200
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 




Reply sent to fgallina <at> gnu.org (Fabián Ezequiel Gallina):
You have taken responsibility. (Mon, 06 Jul 2015 05:37:02 GMT) Full text and rfc822 format available.

Notification sent to Thierry Volpiatto <thierry.volpiatto <at> gmail.com>:
bug acknowledged by developer. (Mon, 06 Jul 2015 05:37:03 GMT) Full text and rfc822 format available.

Message #40 received at 18244-done <at> debbugs.gnu.org (full text, mbox):

From: fgallina <at> gnu.org (Fabián Ezequiel Gallina)
To: 18244-done <at> debbugs.gnu.org
Subject: 24.3.92; Error with semantic-mode when python buffers are present.
Date: Mon, 06 Jul 2015 02:36:03 -0300
Fixed at f3400f4 in the master branch.

--
Thanks,
Fabián.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Aug 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.