unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement
@ 2018-01-28 22:42 Ola Nilsson
  2018-01-29 21:09 ` Noam Postavsky
  2018-02-01 12:28 ` Dmitry Gutov
  0 siblings, 2 replies; 5+ messages in thread
From: Ola Nilsson @ 2018-01-28 22:42 UTC (permalink / raw)
  To: 30277

The infinite recursion is triggered when the first line of a
python-mode buffer starts with space and ends with a backslash.

With emacs -Q

* create a new buffer
* M-x python-mode
* Insert SPACE \ ENTER

=> Lisp nesting exceeds ‘max-lisp-eval-depth’

The infinite recursion is also triggered if the first line of a narrowed
region starts with space and ends on a backslash.


I ran into this problem using mmm-mode with python submode regions.
The file format (bitbake from the Yocto Project) uses this style of
python function:

python foo() {
    # Python code here
    ...
}

mmm-mode narrows to the function content for fontification and if the
first line is properly indented Python code that ends with a backslash,
I see a list nesting error.

-- 
Ola

In GNU Emacs 26.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-01-23 built on blue
Repository revision: 1fc98ed073a2d26ad941748ecb13aa6f47dd7b01
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:    Debian GNU/Linux 9.3 (stretch)

Recent messages:
Desktop lazily opening font-lock.el.gz (2 remaining)...
uncompressing font-lock.el.gz...done
Desktop lazily opening font-lock.el.gz (2 remaining)...done
Desktop lazily opening mmm-mason.el (1 remaining)...done
Lazy desktop load complete
Sun Jan 28 19:48:27 2018: saving desktop file
Desktop saved in ~/.emacs.d/
Reverting buffer ‘useradd.bbclass’.
GNU Emacs 26.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2018-01-23
Making completion list...

Configured using:
 'configure --prefix=/opt/emacs/26.1 --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS LCMS2

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

Major mode: Dired by name

Minor modes in effect:
  jabber-activity-mode: t
  desktop-save-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  diff-auto-refine-mode: t
  which-function-mode: t
  show-paren-mode: t
  display-time-mode: t
  global-auto-revert-mode: t
  override-global-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t

Load-path shadows:
/home/olani/.emacs.d/custom hides
/opt/emacs/26.1/share/emacs/26.0.91/lisp/custom

Features:
(shadow sort mail-extr emacsbug sendmail kconfig-mode ffap misearch
multi-isearch url-http-ntlm ntlm calc calc-loaddefs calc-macs hmac-md5
hex-util md4 network-stream url-http url-gw nsm url-cache url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util conf-bitbake-mode-test bitbake-verify bitbake-test testcover
edebug bitbake-functions-test bitbake-font-lock-test ert debug faceup
bb-test-common bitbake-modes bitbake generic bitbake-ff
bitbake-build-dir wks-mode scc find-file conf-bitbake-mode bitbake-mmm
bitbake-insert bitbake-functions bitbake-electric bitbake-compat
dired-aux coan-dired sh-script smie executable web-mode disp-table
yaml-mode coan-gmake make-mode coan-jabber jabber jabber-notifications
notifications jabber-libnotify dbus jabber-awesome jabber-osd
jabber-wmii jabber-xmessage jabber-festival jabber-sawfish
jabber-ratpoison jabber-tmux jabber-screen jabber-socks5
jabber-ft-server jabber-si-server jabber-ft-client jabber-ft-common
jabber-si-client jabber-si-common jabber-feature-neg jabber-truncate
jabber-time jabber-autoaway jabber-vcard-avatars jabber-chatstates
jabber-events jabber-vcard jabber-avatar mailcap jabber-activity
jabber-watch jabber-modeline jabber-ahc-presence jabber-ahc
jabber-version jabber-ourversion jabber-muc-nick-completion hippie-exp
jabber-browse jabber-search jabber-register jabber-roster
jabber-presence jabber-muc jabber-bookmarks jabber-private
jabber-muc-nick-coloring hexrgb jabber-widget jabber-disco jabber-chat
jabber-history jabber-chatbuffer jabber-alert jabber-iq jabber-core
jabber-console sgml-mode dom ewoc jabber-keymap jabber-sasl sasl
sasl-anonymous sasl-login sasl-plain fsm jabber-logon jabber-conn srv
dns starttls tls gnutls jabber-xml xml jabber-menu jabber-util mmm-mode
mmm-univ mmm-class mmm-region mmm-utils python tramp-sh pcase coan
eieio-opt speedbar sb-image ezimage dframe ibuf-ext ibuffer
ibuffer-loaddefs loadhist help-fns warnings checkdoc thingatpt
coan-elisp skeleton autoload radix-tree lisp-mnt elec-pair coan-desktop
init dired-rainbow dired-hacks-utils autoinsert mmm-sample mmm-auto
mmm-vars mmm-compat t32-auto midnight coan-list desktop frameset compile
flycheck-flawfinder flycheck-cstyle flycheck json map find-func rx
subr-x python-info git-commit with-editor server magit-git magit-section
magit-utils crm magit-popup async-bytecomp async log-edit message rmc
puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
pcvs-util add-log dash cl-extra help-mode gitignore-mode conf-mode
vc-git diff-mode macrostep pp edmacro kmacro coan-26.0.91-autoloads
which-func imenu coan-system finder-inf url-auth info paren time avoid
autorevert filenotify jka-compr use-package bind-key easy-mmode package
easymenu epg-config url-handlers url-parse url-vars seq cl tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
comint ansi-color ring parse-time format-spec advice auth-source cl-seq
eieio byte-opt bytecomp byte-compile cconv eieio-core cl-macs gv
eieio-loaddefs password-cache gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr
wid-edit cl-loaddefs cl-lib cus-start cus-load time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors 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 composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray 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 dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 1454695 160534)
 (symbols 48 46290 1)
 (miscs 40 12851 9766)
 (strings 32 150094 21708)
 (string-bytes 1 4851415)
 (vectors 16 77899)
 (vector-slots 8 2033924 157722)
 (floats 8 195 694)
 (intervals 56 145635 72)
 (buffers 992 1264))





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

* bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement
  2018-01-28 22:42 bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement Ola Nilsson
@ 2018-01-29 21:09 ` Noam Postavsky
  2018-02-01 12:28 ` Dmitry Gutov
  1 sibling, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2018-01-29 21:09 UTC (permalink / raw)
  To: Ola Nilsson; +Cc: 30277

found 30277 24.4
tag 30277 confirmed
quit

On Sun, Jan 28, 2018 at 5:42 PM, Ola Nilsson <ola.nilsson@gmail.com> wrote:
> The infinite recursion is triggered when the first line of a
> python-mode buffer starts with space and ends with a backslash.
>
> With emacs -Q
>
> * create a new buffer
> * M-x python-mode
> * Insert SPACE \ ENTER
>
> => Lisp nesting exceeds ‘max-lisp-eval-depth’
>
> The infinite recursion is also triggered if the first line of a narrowed
> region starts with space and ends on a backslash.

Happens back to 24.4, but not in 24.3.





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

* bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement
  2018-01-28 22:42 bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement Ola Nilsson
  2018-01-29 21:09 ` Noam Postavsky
@ 2018-02-01 12:28 ` Dmitry Gutov
  2018-02-10 11:26   ` Eli Zaretskii
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2018-02-01 12:28 UTC (permalink / raw)
  To: Ola Nilsson, 30277

Hi!

On 1/29/18 1:42 AM, Ola Nilsson wrote:
> The infinite recursion is triggered when the first line of a
> python-mode buffer starts with space and ends with a backslash.
> 
> With emacs -Q
> 
> * create a new buffer
> * M-x python-mode
> * Insert SPACE \ ENTER
> 
> => Lisp nesting exceeds ‘max-lisp-eval-depth’
> 
> The infinite recursion is also triggered if the first line of a narrowed
> region starts with space and ends on a backslash.

This seems to fix it for me. Please test thoroughly, I rarely ever use 
python-mode myself.

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 5baf6e0f80..ff8269d970 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1474,7 +1474,7 @@ python-nav-forward-defun
  (defun python-nav-beginning-of-statement ()
    "Move to start of current statement."
    (interactive "^")
-  (back-to-indentation)
+  (forward-line 0)
    (let* ((ppss (syntax-ppss))
           (context-point
            (or
@@ -1489,6 +1489,7 @@ python-nav-beginning-of-statement
               (python-info-line-ends-backslash-p))
             (forward-line -1)
             (python-nav-beginning-of-statement))))
+  (back-to-indentation)
    (point-marker))

  (defun python-nav-end-of-statement (&optional noend)





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

* bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement
  2018-02-01 12:28 ` Dmitry Gutov
@ 2018-02-10 11:26   ` Eli Zaretskii
  2018-02-12  0:28     ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-02-10 11:26 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: ola.nilsson, 30277

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Thu, 1 Feb 2018 15:28:36 +0300
> 
> On 1/29/18 1:42 AM, Ola Nilsson wrote:
> > The infinite recursion is triggered when the first line of a
> > python-mode buffer starts with space and ends with a backslash.
> > 
> > With emacs -Q
> > 
> > * create a new buffer
> > * M-x python-mode
> > * Insert SPACE \ ENTER
> > 
> > => Lisp nesting exceeds ‘max-lisp-eval-depth’
> > 
> > The infinite recursion is also triggered if the first line of a narrowed
> > region starts with space and ends on a backslash.
> 
> This seems to fix it for me. Please test thoroughly, I rarely ever use 
> python-mode myself.

Please push to the master branch, and thanks.





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

* bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement
  2018-02-10 11:26   ` Eli Zaretskii
@ 2018-02-12  0:28     ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2018-02-12  0:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ola.nilsson, 30277-done

Version: 27.1

On 2/10/18 2:26 PM, Eli Zaretskii wrote:

> Please push to the master branch, and thanks.

OK, done.






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

end of thread, other threads:[~2018-02-12  0:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-28 22:42 bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement Ola Nilsson
2018-01-29 21:09 ` Noam Postavsky
2018-02-01 12:28 ` Dmitry Gutov
2018-02-10 11:26   ` Eli Zaretskii
2018-02-12  0:28     ` Dmitry Gutov

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