unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode
@ 2017-08-11 17:24 evgeniy.sharapov
  2017-08-11 18:19 ` bug#28051: " Evgeniy Sharapov
  2017-08-19 14:45 ` bug#28051: 25.2; " npostavs
  0 siblings, 2 replies; 11+ messages in thread
From: evgeniy.sharapov @ 2017-08-11 17:24 UTC (permalink / raw)
  To: 28051


Having simple init.el file like this

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
  (add-to-list 'package-archives (cons "melpa" url) t))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile
  (require 'use-package))

(use-package company
  :ensure t
  :init
  (setq company-idle-delay 0.1
	company-tooltip-limit 20
	company-show-numbers t
	company-selection-wrap-around t
	company-minimum-prefix-length 2
	company-tooltip-align-annotations t
	company-echo-delay 0)
  :config
  ;; default `company-backends'
  (setq company-backends '(company-capf
			   (company-dabbrev-code
			    company-gtags
			    company-etags
			    company-keywords)
			   company-files
			   company-dabbrev))

  (defun ffe-add-company-backends (&rest backends)
    "Adds BACKENDS to the beginning of the buffer-local version of `company-backends' list"
    (set (make-local-variable 'company-backends)
	 (append backends company-backends)))

  (global-company-mode 1))

(use-package python
  :defer t
  :commands python-mode
  :config
  (add-hook 'python-mode-hook #'eldoc-mode))

(use-package anaconda-mode
  :ensure t
  :init (progn
          (add-hook 'python-mode-hook #'anaconda-mode)
          (add-hook 'python-mode-hook #'anaconda-eldoc-mode)))

(use-package company-anaconda
  :defer t
  :ensure t
  :init (with-eval-after-load 'company
          (add-hook 'python-mode-hook (lambda () (ffe-add-company-backends 'company-anaconda)))))


leads to IndentationError once I try to enter multi-line statements in
the Inferior python mode. 

Steps:

1. Start Emacs
2. M-x run-python
3. try to enter something simple like

   for x in range(10):<RET>
   <TAB>print x<RET>

4. The following error occurs:

File "<stdin>", line 1
    print x
    ^
IndentationError: unexpected indent

If `company-mode' is disabled in the Inferior Python Mode via M-x company-mode
then entering multi-line statements work as expected. Using C-M-i or
`complete-symbol' works. 

Also at the start of the Inferior Pyhon Mode following Warnings have
been shown


Warning (python): Python shell prompts cannot be detected.
If your emacs session hangs when starting python shells
recover with ‘keyboard-quit’ and then try fixing the
interactive flag for your interpreter by adjusting the
‘python-shell-interpreter-interactive-arg’ or add regexps
matching shell prompts in the directory-local friendly vars:
  + ‘python-shell-prompt-regexp’
  + ‘python-shell-prompt-block-regexp’
  + ‘python-shell-prompt-output-regexp’
Or alternatively in:
  + ‘python-shell-prompt-input-regexps’
  + ‘python-shell-prompt-output-regexps’
Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native-enable’ was t and "python" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally. 

Howver at the start it said:

Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded


Corresponding issue for the `company-mode' on github.com 
https://github.com/company-mode/company-mode/issues/603


In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
 of 2017-04-24 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 10.0.14393
Configured using:
 'configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: Inferior Python

Minor modes in effect:
  shell-dirtrack-mode: t
  global-company-mode: t
  override-global-mode: t
  compilation-shell-minor-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Saving file c:/Users/esharapov/.emacs.d/init.el...
Wrote c:/Users/esharapov/.emacs.d/init.el [2 times]
For information about GNU Emacs and the GNU system, type C-h C-a.
(New file)
Can’t guess python-indent-offset, using defaults: 4
Shell native completion is disabled, using fallback
Company mode disabled in current buffer
Mark set
Making completion list...
Type "q" in help window to restore previous buffer.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail eieio-opt speedbar sb-image
ezimage dframe tramp-cache company-anaconda pp cus-edit cus-start
cus-load wid-edit anaconda-mode derived pythonic f python tramp-sh tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
advice json map dash s company-files company-keywords company-etags
company-gtags company-dabbrev-code company-capf tempo warnings ispell
etags xref project find-func company-dabbrev company-template company
edmacro kmacro tar-mode use-package diminish bind-key easy-mmode cl
compile comint ansi-color ring autoload lisp-mnt mm-archive message
dired format-spec rfc822 mml mml-sec mailabbrev gmm-utils mailheader
mm-decode mm-bodies mm-encode mail-utils network-stream nsm starttls
url-http tls gnutls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw
url-cache url-auth url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs gnus-util mm-util
help-fns mail-prsvr password-cache url-vars epg finder-inf package
epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode
easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded 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 w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 16 353292 42268)
 (symbols 56 34067 0)
 (miscs 48 165 297)
 (strings 32 68207 11339)
 (string-bytes 1 1877375)
 (vectors 16 55331)
 (vector-slots 8 1659539 79071)
 (floats 8 320 326)
 (intervals 56 1115 2875)
 (buffers 976 70))





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-08-27 18:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-11 17:24 bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode evgeniy.sharapov
2017-08-11 18:19 ` bug#28051: " Evgeniy Sharapov
2017-08-12 17:50   ` Glenn Morris
2017-08-14 23:59     ` npostavs
2017-08-21 12:17       ` npostavs
2017-08-22  1:36         ` npostavs
2017-08-27 16:42           ` Dmitry Gutov
2017-08-27 18:28             ` npostavs
2017-08-19 14:45 ` bug#28051: 25.2; " npostavs
2017-08-25  2:50   ` Evgeniy Sharapov
2017-08-25 12:20     ` npostavs

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).