GNU bug report logs - #39398
26.3; `python-shell-buffer-substring` does not respect region

Previous Next

Package: emacs;

Reported by: Gaby Launay <gaby.launay <at> protonmail.com>

Date: Sun, 2 Feb 2020 21:14:01 UTC

Severity: normal

Tags: fixed

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 39398 in the body.
You can then email your comments to 39398 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#39398; Package emacs. (Sun, 02 Feb 2020 21:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gaby Launay <gaby.launay <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Feb 2020 21:14:01 GMT) Full text and rfc822 format available.

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

From: Gaby Launay <gaby.launay <at> protonmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; `python-shell-buffer-substring` does not respect region
Date: Sun, 02 Feb 2020 21:13:08 +0000
# Problem
With the current code in a `python-mode` buffer:
```
A = 44
B = 2

def foo(a, b):
    print(a, b)
    return(a + b)

C = (2 + foo(A, B))
```
evaluating the whole buffer once, then selecting the region `foo(A, B)`
and running `M-x python-shell-send-region` leads to a syntax error:
```
    C = (2 + foo(A, B)
                     ^
SyntaxError: unexpected EOF while parsing
```

# Cause
`python-shell-send-region` uses `python-shell-buffer-substring` to
determine which part of the buffer to send to the python interpreter. At
the moment, it does not respect the position of the beginning of the
region but instead use the beginning of the line. This is great to avoid
sending invalid pieces of lines, but does not allow to evaluate portion
of lines.

# Potential solution
Remove the region start normalization in `python-shell-buffer-substring`:
```
  (let* ((start (save-excursion
                  ;; Normalize start to the line beginning position.
                  (goto-char start)
                  (line-beginning-position)))
```



In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
 of 2019-08-29 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12007000
Recent messages:
Git finished
Running git push -v origin refs/heads/master:refs/heads/master
Press key for agenda command (unrestricted):
Git finished

Truncate long lines enabled
Quit
funcall-interactively: Text is read-only

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

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

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

Major mode: Org

Minor modes in effect:
  global-evil-visualstar-mode: t
  evil-visualstar-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-ring-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-pcomplete-mode: t
  erc-notify-mode: t
  erc-networks-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-autojoin-mode: t
  erc-notifications-mode: t
  erc-match-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  show-paren-mode: t
  drag-stuff-global-mode: t
  pyvenv-mode: t
  pdf-occur-global-minor-mode: t
  global-company-mode: t
  company-mode: t
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  global-magit-file-mode: t
  magit-file-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  global-git-commit-mode: t
  projectile-mode: t
  dired-async-mode: t
  org-autolist-mode: t
  recentf-mode: t
  helm-flx-mode: t
  delete-selection-mode: t
  helm-mode: t
  async-bytecomp-package-mode: t
  evil-traces-mode: t
  evil-lion-mode: t
  global-evil-matchit-mode: t
  evil-matchit-mode: t
  global-evil-collection-unimpaired-mode: t
  evil-collection-unimpaired-mode: t
  evil-escape-mode: t
  helm-autoresize-mode: t
  helm--remap-mouse-mode: t
  global-fasd-mode: t
  minibuffer-electric-default-mode: t
  savehist-mode: t
  evil-leader-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  semantic-mode: t
  visual-fill-column-mode: t
  adaptive-wrap-prefix-mode: t
  save-place-mode: t
  doom-modeline-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  global-hl-line-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  override-global-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-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
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/glaunay/.emacs.d/elpa/auth-source-pass-20191126.1242/auth-source-pass hides /usr/share/emacs/26.3/lisp/auth-source-pass
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-colview hides /usr/share/emacs/26.3/lisp/org/org-colview
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-ditaa hides /usr/share/emacs/26.3/lisp/org/ob-ditaa
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-footnote hides /usr/share/emacs/26.3/lisp/org/org-footnote
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-org hides /usr/share/emacs/26.3/lisp/org/ox-org
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-vala hides /usr/share/emacs/26.3/lisp/org/ob-vala
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-lob hides /usr/share/emacs/26.3/lisp/org/ob-lob
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-perl hides /usr/share/emacs/26.3/lisp/org/ob-perl
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-odt hides /usr/share/emacs/26.3/lisp/org/ox-odt
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-matlab hides /usr/share/emacs/26.3/lisp/org/ob-matlab
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-plot hides /usr/share/emacs/26.3/lisp/org/org-plot
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-protocol hides /usr/share/emacs/26.3/lisp/org/org-protocol
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-table hides /usr/share/emacs/26.3/lisp/org/org-table
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-core hides /usr/share/emacs/26.3/lisp/org/ob-core
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-asymptote hides /usr/share/emacs/26.3/lisp/org/ob-asymptote
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-latex hides /usr/share/emacs/26.3/lisp/org/ox-latex
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-gnuplot hides /usr/share/emacs/26.3/lisp/org/ob-gnuplot
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-groovy hides /usr/share/emacs/26.3/lisp/org/ob-groovy
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-faces hides /usr/share/emacs/26.3/lisp/org/org-faces
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-inlinetask hides /usr/share/emacs/26.3/lisp/org/org-inlinetask
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-coq hides /usr/share/emacs/26.3/lisp/org/ob-coq
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-latex hides /usr/share/emacs/26.3/lisp/org/ob-latex
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-sqlite hides /usr/share/emacs/26.3/lisp/org/ob-sqlite
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-ctags hides /usr/share/emacs/26.3/lisp/org/org-ctags
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-entities hides /usr/share/emacs/26.3/lisp/org/org-entities
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-indent hides /usr/share/emacs/26.3/lisp/org/org-indent
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-io hides /usr/share/emacs/26.3/lisp/org/ob-io
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-ascii hides /usr/share/emacs/26.3/lisp/org/ox-ascii
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-emacs-lisp hides /usr/share/emacs/26.3/lisp/org/ob-emacs-lisp
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-shen hides /usr/share/emacs/26.3/lisp/org/ob-shen
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-octave hides /usr/share/emacs/26.3/lisp/org/ob-octave
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-list hides /usr/share/emacs/26.3/lisp/org/org-list
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-mouse hides /usr/share/emacs/26.3/lisp/org/org-mouse
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-J hides /usr/share/emacs/26.3/lisp/org/ob-J
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-src hides /usr/share/emacs/26.3/lisp/org/org-src
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-timer hides /usr/share/emacs/26.3/lisp/org/org-timer
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-eval hides /usr/share/emacs/26.3/lisp/org/ob-eval
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-ruby hides /usr/share/emacs/26.3/lisp/org/ob-ruby
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-comint hides /usr/share/emacs/26.3/lisp/org/ob-comint
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-crypt hides /usr/share/emacs/26.3/lisp/org/org-crypt
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-R hides /usr/share/emacs/26.3/lisp/org/ob-R
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-publish hides /usr/share/emacs/26.3/lisp/org/ox-publish
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-md hides /usr/share/emacs/26.3/lisp/org/ox-md
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-sed hides /usr/share/emacs/26.3/lisp/org/ob-sed
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org hides /usr/share/emacs/26.3/lisp/org/org
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-table hides /usr/share/emacs/26.3/lisp/org/ob-table
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-habit hides /usr/share/emacs/26.3/lisp/org/org-habit
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-hledger hides /usr/share/emacs/26.3/lisp/org/ob-hledger
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-processing hides /usr/share/emacs/26.3/lisp/org/ob-processing
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-id hides /usr/share/emacs/26.3/lisp/org/org-id
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-css hides /usr/share/emacs/26.3/lisp/org/ob-css
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-stan hides /usr/share/emacs/26.3/lisp/org/ob-stan
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-archive hides /usr/share/emacs/26.3/lisp/org/org-archive
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-C hides /usr/share/emacs/26.3/lisp/org/ob-C
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-clojure hides /usr/share/emacs/26.3/lisp/org/ob-clojure
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-agenda hides /usr/share/emacs/26.3/lisp/org/org-agenda
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-icalendar hides /usr/share/emacs/26.3/lisp/org/ox-icalendar
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-lilypond hides /usr/share/emacs/26.3/lisp/org/ob-lilypond
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-java hides /usr/share/emacs/26.3/lisp/org/ob-java
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-texinfo hides /usr/share/emacs/26.3/lisp/org/ox-texinfo
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox hides /usr/share/emacs/26.3/lisp/org/ox
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-awk hides /usr/share/emacs/26.3/lisp/org/ob-awk
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-ledger hides /usr/share/emacs/26.3/lisp/org/ob-ledger
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-fortran hides /usr/share/emacs/26.3/lisp/org/ob-fortran
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-shell hides /usr/share/emacs/26.3/lisp/org/ob-shell
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-man hides /usr/share/emacs/26.3/lisp/org/ox-man
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-mscgen hides /usr/share/emacs/26.3/lisp/org/ob-mscgen
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-sql hides /usr/share/emacs/26.3/lisp/org/ob-sql
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-macs hides /usr/share/emacs/26.3/lisp/org/org-macs
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-forth hides /usr/share/emacs/26.3/lisp/org/ob-forth
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-install hides /usr/share/emacs/26.3/lisp/org/org-install
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-calc hides /usr/share/emacs/26.3/lisp/org/ob-calc
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-picolisp hides /usr/share/emacs/26.3/lisp/org/ob-picolisp
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-attach hides /usr/share/emacs/26.3/lisp/org/org-attach
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-ocaml hides /usr/share/emacs/26.3/lisp/org/ob-ocaml
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-exp hides /usr/share/emacs/26.3/lisp/org/ob-exp
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-beamer hides /usr/share/emacs/26.3/lisp/org/ox-beamer
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-capture hides /usr/share/emacs/26.3/lisp/org/org-capture
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-plantuml hides /usr/share/emacs/26.3/lisp/org/ob-plantuml
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-duration hides /usr/share/emacs/26.3/lisp/org/org-duration
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-haskell hides /usr/share/emacs/26.3/lisp/org/ob-haskell
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-lua hides /usr/share/emacs/26.3/lisp/org/ob-lua
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-ref hides /usr/share/emacs/26.3/lisp/org/ob-ref
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-abc hides /usr/share/emacs/26.3/lisp/org/ob-abc
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-datetree hides /usr/share/emacs/26.3/lisp/org/org-datetree
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-sass hides /usr/share/emacs/26.3/lisp/org/ob-sass
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-python hides /usr/share/emacs/26.3/lisp/org/ob-python
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-element hides /usr/share/emacs/26.3/lisp/org/org-element
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-loaddefs hides /usr/share/emacs/26.3/lisp/org/org-loaddefs
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-ebnf hides /usr/share/emacs/26.3/lisp/org/ob-ebnf
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob hides /usr/share/emacs/26.3/lisp/org/ob
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-maxima hides /usr/share/emacs/26.3/lisp/org/ob-maxima
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-feed hides /usr/share/emacs/26.3/lisp/org/org-feed
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-scheme hides /usr/share/emacs/26.3/lisp/org/ob-scheme
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-lisp hides /usr/share/emacs/26.3/lisp/org/ob-lisp
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-lint hides /usr/share/emacs/26.3/lisp/org/org-lint
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-pcomplete hides /usr/share/emacs/26.3/lisp/org/org-pcomplete
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-mobile hides /usr/share/emacs/26.3/lisp/org/org-mobile
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-tangle hides /usr/share/emacs/26.3/lisp/org/ob-tangle
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-org hides /usr/share/emacs/26.3/lisp/org/ob-org
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-screen hides /usr/share/emacs/26.3/lisp/org/ob-screen
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-makefile hides /usr/share/emacs/26.3/lisp/org/ob-makefile
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-compat hides /usr/share/emacs/26.3/lisp/org/org-compat
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-version hides /usr/share/emacs/26.3/lisp/org/org-version
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-js hides /usr/share/emacs/26.3/lisp/org/ob-js
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ox-html hides /usr/share/emacs/26.3/lisp/org/ox-html
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-clock hides /usr/share/emacs/26.3/lisp/org/org-clock
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/org-macro hides /usr/share/emacs/26.3/lisp/org/org-macro
/home/glaunay/.emacs.d/elpa/org-plus-contrib-20191230/ob-dot hides /usr/share/emacs/26.3/lisp/org/ob-dot
/home/glaunay/.emacs.d/elpa/nadvice-0.3/nadvice hides /usr/share/emacs/26.3/lisp/emacs-lisp/nadvice
/home/glaunay/.emacs.d/elpa/let-alist-1.0.6/let-alist hides /usr/share/emacs/26.3/lisp/emacs-lisp/let-alist

Features:
(shadow emacsbug evil-collection-woman woman evil-collection-man man
bug-reference semantic/tag-file semantic/db-file data-debug cedet-files
semantic/wisent/python semantic/decorate/include semantic/db-find
semantic/db-ref semantic/decorate/mode semantic/decorate pulse
semantic/dep semantic/wisent/python-wy hideshow evil-visualstar
helm-semantic helm-imenu image-file misearch multi-isearch org-clock
diary-lib diary-loaddefs cal-iso helm-command cal-move org-eldoc ffap
ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus nnir ol-docview ol-bibtex
ol-bbdb ol-w3m helm-x-files helm-for-files helm-bookmark helm-adaptive
helm-external helm-net shr-color winner helm-sys evil-collection-view
view checkdoc company-oddmuse company-keywords company-etags
company-gtags company-dabbrev-code company-dabbrev company-files
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-bbdb elpy elpy-rpc elpy-shell elpy-profile
elpy-django elpy-refactor hydra-examples memory-usage camcorder names
emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit
emms-volume emms-volume-mixerctl emms-volume-pulse 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 emms-playing-time emms-lyrics emms-url emms-show-all
emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-opusinfo
emms-info-ogginfo emms-info-mp3info emms-info later-do
emms-playlist-mode emms-player-vlc emms-player-mpv emms-player-mplayer
emms-player-simple emms-source-playlist emms-source-file locate
emms-streams emms-setup evil-collection-emms emms emms-compat elfeed-org
evil-collection-elfeed elfeed-show elfeed-search elfeed-csv elfeed
elfeed-curl elfeed-log elfeed-db elfeed-lib xml-query erc-youtube
erc-image evil-collection-image-dired image-dired url-queue epa-file
erc-list erc-menu erc-ring erc-button erc-fill erc-stamp erc-netsplit
erc-pcomplete erc-notify erc-networks erc-track erc-join
erc-desktop-notifications erc-match notifications erc-goodies erc
erc-backend erc-compat org-mu4e helm-mu evil-collection-mu4e mu4e
mu4e-org mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-context
mu4e-draft mu4e-actions rfc2368 smtpmail sendmail mu4e-mark mu4e-message
flow-fill mu4e-proc mu4e-utils evil-collection-doc-view doc-view
mu4e-lists mu4e-vars mu4e-meta helm-pass evil-collection-pass pass
password-store auth-source-pass eshell-prompt-extras em-dirs em-ls
sane-term dap-mode dap-overlays company-lsp lsp-java lsp lsp-mode
network-stream starttls markdown-mode inline ewoc em-glob bindat asx shr
svg expand-region text-mode-expansions cc-mode-expansions
the-org-mode-expansions python-el-fgallina-expansions
nxml-mode-expansions latex-mode-expansions web-mode-expansions
html-mode-expansions er-basic-expansions expand-region-core
expand-region-custom company-capf files-x yasnippet elec-pair
evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk
paren drag-stuff ialign align package-lint-flymake package-lint finder
systemd yaml-mode evil-collection-slime slime evil-collection-arc-mode
arc-mode archive-mode hyperspec browse-url haskell-mode haskell-cabal
haskell-utils haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support etags evil-collection-xref
xref project dabbrev haskell-customize ghci-completion cython-mode
evil-collection-python python highlight-indentation find-file-in-project
find-lisp pyvenv esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg
esh-groups evil-collection-eshell em-prompt eshell esh-module esh-mode
esh-util company-shell multi-term evil-collection-term term ehelp
bash-completion modelica-mode scad-preview scad-mode cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
company-web-html web-mode disp-table css-eldoc css-eldoc-hash-table
helm-css-scss company-web company-css web-completion-data pandoc-mode
pandoc-mode-utils word-stats helm-flyspell guess-language
academic-phrases synosaurus ido wordnut wordnut-history wordnut-u
define-word rng-nxml rng-valid nxml-mode nxml-outln nxml-rap url-http
url-auth url-gw nsm pdf-occur evil-collection-tablist tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent pdf-isearch pdf-misc pdf-tools pdf-view
magit-bookmark evil-collection-bookmark bookmark pdf-cache pdf-info tq
pdf-util company-math evil-collection-ebib ebib evil-collection-ivy ivy
colir ivy-overlay ebib-reading-list ebib-notes ebib-filters
ebib-keywords ebib-utils ebib-db company-reftex helm-company helm-elisp
helm-eval helm-info company-quickhelp pos-tip company-tng
evil-collection-company company evil-collection-reftex reftex-cite
reftex-ref reftex-parse reftex reftex-loaddefs reftex-vars
auctex-latexmk math-symbol-lists preview prv-emacs reporter desktop
frameset tex-buf latex latex-flymake evil-collection-flymake
flymake-proc flymake warnings tex-ispell tex-style auctex-custom tex
dbus evil-collection-git-timemachine git-timemachine
evil-collection-vc-git vc-git helm-gitignore request url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util json map gitignore-mode conf-mode evil-magit
evil-collection-magit magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func magit-diff smerge-mode
evil-collection-diff-mode diff-mode magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
magit-mode git-commit magit-git magit-section magit-utils crm
evil-collection-log-edit log-edit pcvs-util add-log with-editor server
transient helm-projectile-open-with helm-projectile projectile ibuf-ext
evil-collection-ibuffer ibuffer ibuffer-loaddefs dired-async dired-aux
dired-subtree dired-narrow dired-hacks-utils gnus-dired helm-org-rifle
org-msg xml htmlize gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime dig mailcap gnus-sum gnus-group gnus-undo gnus-start gnus-cloud
nnimap nnmail mail-source tls gnutls utf7 netrc nnoo gnus-spec gnus-int
gnus-range message rmc puny rfc822 mml mml-sec evil-collection-epa epa
epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader gnus-win evil-collection-gnus gnus nnheader
gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils
mm-util mail-prsvr ox-extra poly-org polymode poly-lock polymode-base
polymode-weave polymode-export polymode-compat polymode-methods
polymode-core polymode-classes eieio-custom color ox-pandoc ht ox-org
ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn
nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar
ox-html table ox-ascii ox-publish ox ob-latex ob-shell ob-python
org-ebib org-agenda org-depend org-autolist org-element avl-tree
generator org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities time-date evil-collection-outline noutline outline
org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys
org-compat org-macs org-loaddefs evil-collection-calendar cal-menu
calendar cal-loaddefs tramp-cache tramp-sh recentf tree-widget helm-flx
flx delsel helm-mode helm-files helm-buffers helm-occur helm-tags
helm-locate helm-grep helm-regexp helm-utils helm-help helm-types
helm-config async-bytecomp evil-traces evil-multiedit iedit help-macro
iedit-lib sgml-mode dom evil-lion evil-args evil-exchange evil-matchit
evil-matchit-sdk evil-collection-unimpaired evil-collection-wgrep
evil-collection-vlf evil-collection-simple evil-collection-package-menu
evil-collection-occur evil-collection-minibuffer evil-collection-info
evil-collection-image image-mode evil-collection-helpful
evil-collection-help evil-collection-grep evil-collection-elisp-refs
evil-collection-elisp-mode evil-collection-edebug evil-collection-dired
evil-collection-custom evil-collection-compile evil-collection-comint
evil-collection-buff-menu evil-collection annalist evil-escape helpful
imenu trace edebug info-look dash-functional help-fns elisp-refs loop
helm-tramp helm helm-source eieio-compat helm-multi-match helm-lib async
tramp tramp-compat tramp-loaddefs trampver ucs-normalize parse-time
format-spec fasd todos minibuf-eldef savehist face-remap paradox
paradox-menu paradox-commit-list derived hydra lv cus-edit cus-start
cus-load wid-edit paradox-execute let-alist paradox-github paradox-core
spinner evil-leader vlf vlf-base vlf-tune vlf-setup shut-up
semantic/db-mode semantic/db eieio-base semantic/idle semantic/format
ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
find-func cedet wgrep-helm wgrep grep compile visual-fill-column
adaptive-wrap saveplace delight doom-modeline doom-modeline-segments
doom-modeline-env doom-modeline-core shrink-path all-the-icons
all-the-icons-faces data-material data-weathericons data-octicons
data-fileicons data-faicons data-alltheicons memoize evil-anzu evil
evil-integration undo-tree diff evil-maps evil-commands reveal flyspell
ispell evil-jumps evil-command-window evil-types evil-search evil-ex
shell pcomplete comint ansi-color evil-macros evil-repeat evil-states
evil-core evil-common windmove rect evil-digraphs evil-vars ring anzu
thingatpt xterm-color hl-line linum darktooth-theme el-get-bundle
autothemer edmacro kmacro f dash parsebib bibtex jka-compr s
auto-compile packed pcase el-get el-get-autoloading el-get-list-packages
el-get-dependencies el-get-build el-get-status pp el-get-methods
el-get-fossil el-get-svn el-get-pacman el-get-github-zip
el-get-github-tar el-get-http-zip el-get-http-tar el-get-hg el-get-go
el-get-git-svn el-get-fink el-get-emacswiki el-get-http el-get-notify
el-get-emacsmirror el-get-github el-get-git el-get-elpa el-get-darcs
el-get-cvs el-get-bzr el-get-brew el-get-builtin el-get-apt-get
el-get-recipes el-get-byte-compile subr-x el-get-custom el-get-core
autoload radix-tree lisp-mnt cl dired dired-loaddefs cl-extra help-mode
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
tex-site helm-easymenu advice slime-autoloads rx info package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib 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 threads 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 1793523 222369)
 (symbols 48 113370 3)
 (miscs 40 4254 3543)
 (strings 32 407158 88501)
 (string-bytes 1 11902087)
 (vectors 16 170958)
 (vector-slots 8 4118247 100788)
 (floats 8 1243 909)
 (intervals 56 24100 3574)
 (buffers 992 92))

--





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39398; Package emacs. (Tue, 27 Oct 2020 19:31:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gaby Launay <gaby.launay <at> protonmail.com>
Cc: 39398 <at> debbugs.gnu.org
Subject: Re: bug#39398: 26.3; `python-shell-buffer-substring` does not
 respect region
Date: Tue, 27 Oct 2020 20:30:28 +0100
Gaby Launay <gaby.launay <at> protonmail.com> writes:

> `python-shell-send-region` uses `python-shell-buffer-substring` to
> determine which part of the buffer to send to the python interpreter. At
> the moment, it does not respect the position of the beginning of the
> region but instead use the beginning of the line. This is great to avoid
> sending invalid pieces of lines, but does not allow to evaluate portion
> of lines.

Yes, that seems rather odd -- as far as I can see, the command is not
documented to behave in this way, but says it's sending the region.

So I've changed it as you suggested, and I guess we'll see whether
there's any protests.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 27 Oct 2020 19:31:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 39398 <at> debbugs.gnu.org and Gaby Launay <gaby.launay <at> protonmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 27 Oct 2020 19:31:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39398; Package emacs. (Wed, 28 Oct 2020 00:55:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Gaby Launay <gaby.launay <at> protonmail.com>, 39398 <at> debbugs.gnu.org
Subject: Re: bug#39398: 26.3;
 `python-shell-buffer-substring` does not respect region
Date: Tue, 27 Oct 2020 20:54:45 -0400
This causes the tests that were added for https://debbugs.gnu.org/21086
to fail.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39398; Package emacs. (Wed, 28 Oct 2020 08:36:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Gaby Launay <gaby.launay <at> protonmail.com>, 39398 <at> debbugs.gnu.org
Subject: Re: bug#39398: 26.3; `python-shell-buffer-substring` does not
 respect region
Date: Wed, 28 Oct 2020 09:34:48 +0100
Glenn Morris <rgm <at> gnu.org> writes:

> This causes the tests that were added for https://debbugs.gnu.org/21086
> to fail.

This should now be fixed.

It's debatable, I guess, whether the old or the new `C-c C-r' behaviour
makes sense.  I think the command should do what it says: Send the
region to the python process...  but that means that the region should
be valid.  For instance:

if 1:
    print foo()

Sending "print foo()" is not valid; you need the entire line (because of
the True wrapping).  But that means that it's impossible to send
something later on the line, like just "foo()" (which is valid).

So we could revert the new patch and go back to the "send the entire
line" behaviour, but then we should actually document it at least.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Nov 2020 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 124 days ago.

Previous Next


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