GNU bug report logs - #45922
27.1; Better auto-fill for strings in python-mode

Previous Next

Package: emacs;

Reported by: Акимжанчег <zelenaruta <at> gmail.com>

Date: Sat, 16 Jan 2021 22:49:02 UTC

Severity: normal

Tags: moreinfo, wontfix

Found in version 27.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 45922 in the body.
You can then email your comments to 45922 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#45922; Package emacs. (Sat, 16 Jan 2021 22:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Акимжанчег <zelenaruta <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Jan 2021 22:49:02 GMT) Full text and rfc822 format available.

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

From: Акимжанчег <zelenaruta <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; Better auto-fill for strings in python-mode
Date: Sun, 17 Jan 2021 03:49:16 +0600
[Message part 1 (text/plain, inline)]
Date: Sun, 17 Jan 2021 03:45:31 +0600
Message-ID: <875z3wd090.fsf <at> gmail.com>
--text follows this line--

Today I was making a program in Python for myself. One of the functions
required me to pass a long string to it, so I did that. Auto-fill-mode
got triggered when I pressed the space bar and the string was split from
this:
```
matrix = self.getprop("Coordinate Transformation Matrix").split(", ")
```
To this:
```
matrix = self.getprop("Coordinate Transformation
                                  Matrix").split(", ")
```
After that, I saw `SyntaxError: EOL while scanning string literal'.
This can be fixed with two different methods:
1. Adding a `+' between the strings, so that it looks like
```
matrix = self.getprop("Coordinate Transformation"
                     +"Matrix").split(", ")
```
2. Dividing the string to 2 separate strings:
```
matrix = self.getprop("Coordinate Transformation"
                      "Matrix").split(", ")


In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22,
cairo version 1.17.3)
 of 2020-08-29 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Arch Linux

Recent messages:
invalid syntax [2 times]
Auto-saving...
EOL while scanning string literal
Auto-saving...
EOL while scanning string literal
Mark set
invalid syntax
Auto-saving...
End of buffer
delete-backward-char: Text is read-only [2 times]

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int
 --with-modules --with-cairo --with-harfbuzz '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 CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON
PDUMPER LCMS2 GMP

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

Major mode: Python

Minor modes in effect:
  electric-pair-mode: t
  desktop-save-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  async-bytecomp-package-mode: t
  savehist-mode: t
  rainbow-delimiters-mode: t
  elpy-mode: t
  pyvenv-mode: t
  shell-dirtrack-mode: t
  which-key-mode: t
  marginalia-mode: t
  flycheck-mode: t
  gcmh-mode: t
  global-company-mode: t
  company-mode: t
  TeX-PDF-mode: t
  ctrlf-mode: t
  ctrlf-local-mode: t
  highlight-indent-guides-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  dired-async-mode: t
  selectrum-prescient-mode: t
  prescient-persist-mode: t
  selectrum-mode: t
  reverse-im-mode: t
  global-page-break-lines-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  override-global-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-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
  auto-fill-function: yas--auto-fill
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/veronika/.emacs.d/straight/build/org/org-feed hides
/usr/share/emacs/27.1/lisp/org/org-feed
/home/veronika/.emacs.d/straight/build/org/org-compat hides
/usr/share/emacs/27.1/lisp/org/org-compat
/home/veronika/.emacs.d/straight/build/org/ol-eshell hides
/usr/share/emacs/27.1/lisp/org/ol-eshell
/home/veronika/.emacs.d/straight/build/org/ob-shell hides
/usr/share/emacs/27.1/lisp/org/ob-shell
/home/veronika/.emacs.d/straight/build/org/ox-publish hides
/usr/share/emacs/27.1/lisp/org/ox-publish
/home/veronika/.emacs.d/straight/build/org/org-lint hides
/usr/share/emacs/27.1/lisp/org/org-lint
/home/veronika/.emacs.d/straight/build/org/ol-rmail hides
/usr/share/emacs/27.1/lisp/org/ol-rmail
/home/veronika/.emacs.d/straight/build/org/org-src hides
/usr/share/emacs/27.1/lisp/org/org-src
/home/veronika/.emacs.d/straight/build/org/org-keys hides
/usr/share/emacs/27.1/lisp/org/org-keys
/home/veronika/.emacs.d/straight/build/org/ob-groovy hides
/usr/share/emacs/27.1/lisp/org/ob-groovy
/home/veronika/.emacs.d/straight/build/org/org-id hides
/usr/share/emacs/27.1/lisp/org/org-id
/home/veronika/.emacs.d/straight/build/org/ob-dot hides
/usr/share/emacs/27.1/lisp/org/ob-dot
/home/veronika/.emacs.d/straight/build/org/ob-emacs-lisp hides
/usr/share/emacs/27.1/lisp/org/ob-emacs-lisp
/home/veronika/.emacs.d/straight/build/org/ob-vala hides
/usr/share/emacs/27.1/lisp/org/ob-vala
/home/veronika/.emacs.d/straight/build/org/ob-abc hides
/usr/share/emacs/27.1/lisp/org/ob-abc
/home/veronika/.emacs.d/straight/build/org/org-footnote hides
/usr/share/emacs/27.1/lisp/org/org-footnote
/home/veronika/.emacs.d/straight/build/org/ox-md hides
/usr/share/emacs/27.1/lisp/org/ox-md
/home/veronika/.emacs.d/straight/build/org/ob hides
/usr/share/emacs/27.1/lisp/org/ob
/home/veronika/.emacs.d/straight/build/org/ob-clojure hides
/usr/share/emacs/27.1/lisp/org/ob-clojure
/home/veronika/.emacs.d/straight/build/org/ob-ditaa hides
/usr/share/emacs/27.1/lisp/org/ob-ditaa
/home/veronika/.emacs.d/straight/build/org/ob-ref hides
/usr/share/emacs/27.1/lisp/org/ob-ref
/home/veronika/.emacs.d/straight/build/org/ox-texinfo hides
/usr/share/emacs/27.1/lisp/org/ox-texinfo
/home/veronika/.emacs.d/straight/build/org/ob-css hides
/usr/share/emacs/27.1/lisp/org/ob-css
/home/veronika/.emacs.d/straight/build/org/org-ctags hides
/usr/share/emacs/27.1/lisp/org/org-ctags
/home/veronika/.emacs.d/straight/build/org/org-mouse hides
/usr/share/emacs/27.1/lisp/org/org-mouse
/home/veronika/.emacs.d/straight/build/org/ob-io hides
/usr/share/emacs/27.1/lisp/org/ob-io
/home/veronika/.emacs.d/straight/build/org/ox-org hides
/usr/share/emacs/27.1/lisp/org/ox-org
/home/veronika/.emacs.d/straight/build/org/org-version hides
/usr/share/emacs/27.1/lisp/org/org-version
/home/veronika/.emacs.d/straight/build/org/org-capture hides
/usr/share/emacs/27.1/lisp/org/org-capture
/home/veronika/.emacs.d/straight/build/org/ob-lob hides
/usr/share/emacs/27.1/lisp/org/ob-lob
/home/veronika/.emacs.d/straight/build/org/ob-exp hides
/usr/share/emacs/27.1/lisp/org/ob-exp
/home/veronika/.emacs.d/straight/build/org/ob-js hides
/usr/share/emacs/27.1/lisp/org/ob-js
/home/veronika/.emacs.d/straight/build/org/org-duration hides
/usr/share/emacs/27.1/lisp/org/org-duration
/home/veronika/.emacs.d/straight/build/org/ob-eval hides
/usr/share/emacs/27.1/lisp/org/ob-eval
/home/veronika/.emacs.d/straight/build/org/org-attach-git hides
/usr/share/emacs/27.1/lisp/org/org-attach-git
/home/veronika/.emacs.d/straight/build/org/ob-lisp hides
/usr/share/emacs/27.1/lisp/org/ob-lisp
/home/veronika/.emacs.d/straight/build/org/ob-picolisp hides
/usr/share/emacs/27.1/lisp/org/ob-picolisp
/home/veronika/.emacs.d/straight/build/org/ol hides
/usr/share/emacs/27.1/lisp/org/ol
/home/veronika/.emacs.d/straight/build/org/org-indent hides
/usr/share/emacs/27.1/lisp/org/org-indent
/home/veronika/.emacs.d/straight/build/org/org-agenda hides
/usr/share/emacs/27.1/lisp/org/org-agenda
/home/veronika/.emacs.d/straight/build/org/ol-docview hides
/usr/share/emacs/27.1/lisp/org/ol-docview
/home/veronika/.emacs.d/straight/build/org/ob-stan hides
/usr/share/emacs/27.1/lisp/org/ob-stan
/home/veronika/.emacs.d/straight/build/org/ox-latex hides
/usr/share/emacs/27.1/lisp/org/ox-latex
/home/veronika/.emacs.d/straight/build/org/ob-R hides
/usr/share/emacs/27.1/lisp/org/ob-R
/home/veronika/.emacs.d/straight/build/org/ob-java hides
/usr/share/emacs/27.1/lisp/org/ob-java
/home/veronika/.emacs.d/straight/build/org/org-plot hides
/usr/share/emacs/27.1/lisp/org/org-plot
/home/veronika/.emacs.d/straight/build/org/ob-perl hides
/usr/share/emacs/27.1/lisp/org/ob-perl
/home/veronika/.emacs.d/straight/build/org/ol-eww hides
/usr/share/emacs/27.1/lisp/org/ol-eww
/home/veronika/.emacs.d/straight/build/org/ob-ocaml hides
/usr/share/emacs/27.1/lisp/org/ob-ocaml
/home/veronika/.emacs.d/straight/build/org/org-macro hides
/usr/share/emacs/27.1/lisp/org/org-macro
/home/veronika/.emacs.d/straight/build/org/org-install hides
/usr/share/emacs/27.1/lisp/org/org-install
/home/veronika/.emacs.d/straight/build/org/org-habit hides
/usr/share/emacs/27.1/lisp/org/org-habit
/home/veronika/.emacs.d/straight/build/org/ol-info hides
/usr/share/emacs/27.1/lisp/org/ol-info
/home/veronika/.emacs.d/straight/build/org/ob-asymptote hides
/usr/share/emacs/27.1/lisp/org/ob-asymptote
/home/veronika/.emacs.d/straight/build/org/ob-matlab hides
/usr/share/emacs/27.1/lisp/org/ob-matlab
/home/veronika/.emacs.d/straight/build/org/org-num hides
/usr/share/emacs/27.1/lisp/org/org-num
/home/veronika/.emacs.d/straight/build/org/org-attach hides
/usr/share/emacs/27.1/lisp/org/org-attach
/home/veronika/.emacs.d/straight/build/org/org-pcomplete hides
/usr/share/emacs/27.1/lisp/org/org-pcomplete
/home/veronika/.emacs.d/straight/build/org/ob-mscgen hides
/usr/share/emacs/27.1/lisp/org/ob-mscgen
/home/veronika/.emacs.d/straight/build/org/org-colview hides
/usr/share/emacs/27.1/lisp/org/org-colview
/home/veronika/.emacs.d/straight/build/org/ox-man hides
/usr/share/emacs/27.1/lisp/org/ox-man
/home/veronika/.emacs.d/straight/build/org/org-inlinetask hides
/usr/share/emacs/27.1/lisp/org/org-inlinetask
/home/veronika/.emacs.d/straight/build/org/org-tempo hides
/usr/share/emacs/27.1/lisp/org/org-tempo
/home/veronika/.emacs.d/straight/build/org/ob-sqlite hides
/usr/share/emacs/27.1/lisp/org/ob-sqlite
/home/veronika/.emacs.d/straight/build/org/ob-maxima hides
/usr/share/emacs/27.1/lisp/org/ob-maxima
/home/veronika/.emacs.d/straight/build/org/ob-plantuml hides
/usr/share/emacs/27.1/lisp/org/ob-plantuml
/home/veronika/.emacs.d/straight/build/org/ob-haskell hides
/usr/share/emacs/27.1/lisp/org/ob-haskell
/home/veronika/.emacs.d/straight/build/org/ol-bbdb hides
/usr/share/emacs/27.1/lisp/org/ol-bbdb
/home/veronika/.emacs.d/straight/build/org/ob-awk hides
/usr/share/emacs/27.1/lisp/org/ob-awk
/home/veronika/.emacs.d/straight/build/org/org-mobile hides
/usr/share/emacs/27.1/lisp/org/org-mobile
/home/veronika/.emacs.d/straight/build/org/org-protocol hides
/usr/share/emacs/27.1/lisp/org/org-protocol
/home/veronika/.emacs.d/straight/build/org/ob-table hides
/usr/share/emacs/27.1/lisp/org/ob-table
/home/veronika/.emacs.d/straight/build/org/org-archive hides
/usr/share/emacs/27.1/lisp/org/org-archive
/home/veronika/.emacs.d/straight/build/org/org-list hides
/usr/share/emacs/27.1/lisp/org/org-list
/home/veronika/.emacs.d/straight/build/org/ox hides
/usr/share/emacs/27.1/lisp/org/ox
/home/veronika/.emacs.d/straight/build/org/ox-icalendar hides
/usr/share/emacs/27.1/lisp/org/ox-icalendar
/home/veronika/.emacs.d/straight/build/org/ob-fortran hides
/usr/share/emacs/27.1/lisp/org/ob-fortran
/home/veronika/.emacs.d/straight/build/org/ob-makefile hides
/usr/share/emacs/27.1/lisp/org/ob-makefile
/home/veronika/.emacs.d/straight/build/org/org-element hides
/usr/share/emacs/27.1/lisp/org/org-element
/home/veronika/.emacs.d/straight/build/org/org-timer hides
/usr/share/emacs/27.1/lisp/org/org-timer
/home/veronika/.emacs.d/straight/build/org/ob-core hides
/usr/share/emacs/27.1/lisp/org/ob-core
/home/veronika/.emacs.d/straight/build/org/org-macs hides
/usr/share/emacs/27.1/lisp/org/org-macs
/home/veronika/.emacs.d/straight/build/org/ob-lua hides
/usr/share/emacs/27.1/lisp/org/ob-lua
/home/veronika/.emacs.d/straight/build/org/ob-processing hides
/usr/share/emacs/27.1/lisp/org/ob-processing
/home/veronika/.emacs.d/straight/build/org/ol-w3m hides
/usr/share/emacs/27.1/lisp/org/ol-w3m
/home/veronika/.emacs.d/straight/build/org/ob-ebnf hides
/usr/share/emacs/27.1/lisp/org/ob-ebnf
/home/veronika/.emacs.d/straight/build/org/ol-gnus hides
/usr/share/emacs/27.1/lisp/org/ol-gnus
/home/veronika/.emacs.d/straight/build/org/ob-latex hides
/usr/share/emacs/27.1/lisp/org/ob-latex
/home/veronika/.emacs.d/straight/build/org/ol-irc hides
/usr/share/emacs/27.1/lisp/org/ol-irc
/home/veronika/.emacs.d/straight/build/org/ob-coq hides
/usr/share/emacs/27.1/lisp/org/ob-coq
/home/veronika/.emacs.d/straight/build/org/ox-beamer hides
/usr/share/emacs/27.1/lisp/org/ox-beamer
/home/veronika/.emacs.d/straight/build/org/ox-odt hides
/usr/share/emacs/27.1/lisp/org/ox-odt
/home/veronika/.emacs.d/straight/build/org/ob-octave hides
/usr/share/emacs/27.1/lisp/org/ob-octave
/home/veronika/.emacs.d/straight/build/org/ob-comint hides
/usr/share/emacs/27.1/lisp/org/ob-comint
/home/veronika/.emacs.d/straight/build/org/ob-gnuplot hides
/usr/share/emacs/27.1/lisp/org/ob-gnuplot
/home/veronika/.emacs.d/straight/build/org/ob-J hides
/usr/share/emacs/27.1/lisp/org/ob-J
/home/veronika/.emacs.d/straight/build/org/ox-ascii hides
/usr/share/emacs/27.1/lisp/org/ox-ascii
/home/veronika/.emacs.d/straight/build/org/ob-screen hides
/usr/share/emacs/27.1/lisp/org/ob-screen
/home/veronika/.emacs.d/straight/build/org/ox-html hides
/usr/share/emacs/27.1/lisp/org/ox-html
/home/veronika/.emacs.d/straight/build/org/ol-mhe hides
/usr/share/emacs/27.1/lisp/org/ol-mhe
/home/veronika/.emacs.d/straight/build/org/ob-eshell hides
/usr/share/emacs/27.1/lisp/org/ob-eshell
/home/veronika/.emacs.d/straight/build/org/ob-sql hides
/usr/share/emacs/27.1/lisp/org/ob-sql
/home/veronika/.emacs.d/straight/build/org/org-clock hides
/usr/share/emacs/27.1/lisp/org/org-clock
/home/veronika/.emacs.d/straight/build/org/ob-forth hides
/usr/share/emacs/27.1/lisp/org/ob-forth
/home/veronika/.emacs.d/straight/build/org/ob-hledger hides
/usr/share/emacs/27.1/lisp/org/ob-hledger
/home/veronika/.emacs.d/straight/build/org/ob-C hides
/usr/share/emacs/27.1/lisp/org/ob-C
/home/veronika/.emacs.d/straight/build/org/ob-sed hides
/usr/share/emacs/27.1/lisp/org/ob-sed
/home/veronika/.emacs.d/straight/build/org/ob-scheme hides
/usr/share/emacs/27.1/lisp/org/ob-scheme
/home/veronika/.emacs.d/straight/build/org/org hides
/usr/share/emacs/27.1/lisp/org/org
/home/veronika/.emacs.d/straight/build/org/ol-bibtex hides
/usr/share/emacs/27.1/lisp/org/ol-bibtex
/home/veronika/.emacs.d/straight/build/org/ob-shen hides
/usr/share/emacs/27.1/lisp/org/ob-shen
/home/veronika/.emacs.d/straight/build/org/ob-calc hides
/usr/share/emacs/27.1/lisp/org/ob-calc
/home/veronika/.emacs.d/straight/build/org/org-faces hides
/usr/share/emacs/27.1/lisp/org/org-faces
/home/veronika/.emacs.d/straight/build/org/org-datetree hides
/usr/share/emacs/27.1/lisp/org/org-datetree
/home/veronika/.emacs.d/straight/build/org/ob-ruby hides
/usr/share/emacs/27.1/lisp/org/ob-ruby
/home/veronika/.emacs.d/straight/build/org/org-loaddefs hides
/usr/share/emacs/27.1/lisp/org/org-loaddefs
/home/veronika/.emacs.d/straight/build/org/org-crypt hides
/usr/share/emacs/27.1/lisp/org/org-crypt
/home/veronika/.emacs.d/straight/build/org/org-table hides
/usr/share/emacs/27.1/lisp/org/org-table
/home/veronika/.emacs.d/straight/build/org/org-goto hides
/usr/share/emacs/27.1/lisp/org/org-goto
/home/veronika/.emacs.d/straight/build/org/ob-lilypond hides
/usr/share/emacs/27.1/lisp/org/ob-lilypond
/home/veronika/.emacs.d/straight/build/org/ob-tangle hides
/usr/share/emacs/27.1/lisp/org/ob-tangle
/home/veronika/.emacs.d/straight/build/org/ob-sass hides
/usr/share/emacs/27.1/lisp/org/ob-sass
/home/veronika/.emacs.d/straight/build/org/ob-python hides
/usr/share/emacs/27.1/lisp/org/ob-python
/home/veronika/.emacs.d/straight/build/org/ob-org hides
/usr/share/emacs/27.1/lisp/org/ob-org
/home/veronika/.emacs.d/straight/build/org/ob-ledger hides
/usr/share/emacs/27.1/lisp/org/ob-ledger
/home/veronika/.emacs.d/straight/build/org/org-entities hides
/usr/share/emacs/27.1/lisp/org/org-entities
/home/veronika/.emacs.d/straight/build/eldoc/eldoc hides
/usr/share/emacs/27.1/lisp/emacs-lisp/eldoc
/home/veronika/.emacs.d/straight/build/faceup/faceup hides
/usr/share/emacs/27.1/lisp/emacs-lisp/faceup
/home/veronika/.emacs.d/straight/build/let-alist/let-alist hides
/usr/share/emacs/27.1/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug message rmc rfc822 mml mml-sec epa epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-print debug
backtrace cua-base viper viper-cmd viper-keym viper-ex viper-macs
viper-mous viper-init viper-util eieio-opt speedbar sb-image ezimage
dframe tabify two-column iso-transl char-fold mule-util autorevert
filenotify vc-git elec-pair desktop frameset paren delsel
display-line-numbers async-bytecomp savehist projectile ibuf-ext ibuffer
ibuffer-loaddefs projectile-autoloads avy avy-autoloads
rainbow-delimiters rainbow-delimiters-autoloads slime arc-mode
archive-mode hyperspec slime-autoloads macrostep-autoloads
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-cmake company-semantic company-template company-bbdb
highlight-indentation company-capf help-fns radix-tree elpy elpy-rpc
pyvenv eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util elpy-shell elpy-profile elpy-django s elpy-refactor
diff-mode python tramp-sh tramp tramp-loaddefs trampver
tramp-integration tramp-compat shell pcomplete parse-time iso8601
time-date ls-lisp format-spec files-x cus-edit cus-start cus-load
elpy-autoloads s-autoloads pyvenv-autoloads
highlight-indentation-autoloads which-key which-key-autoloads marginalia
marginalia-autoloads base16-google-light-theme base16-theme
base16-theme-autoloads consult-selectrum consult recentf tree-widget
wid-edit bookmark consult-selectrum-autoloads flycheck dash jka-compr
let-alist flycheck-autoloads let-alist-autoloads pkg-info-autoloads
epl-autoloads dash-autoloads flx flx-autoloads gcmh gcmh-autoloads vterm
face-remap term disp-table ehelp vterm-module vterm-autoloads
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
noutline outline etags fileloop generator dabbrev haskell-customize
haskell-mode-autoloads company-auctex company latex latex-flymake
flymake-proc flymake warnings tex-ispell tex-style tex dbus texmathp
company-math-autoloads math-symbol-lists-autoloads
company-auctex-autoloads auctex-autoloads tex-site company-autoloads
ctrlf hl-line ctrlf-autoloads highlight-indent-guides color
highlight-indent-guides-autoloads yasnippet-snippets yasnippet
yasnippet-snippets-autoloads yasnippet-autoloads dired-async advice
dired-aux dired dired-loaddefs async async-autoloads selectrum-prescient
selectrum minibuf-eldef crm prescient selectrum-prescient-autoloads
selectrum-autoloads prescient-autoloads reverse-im quail
reverse-im-autoloads page-break-lines page-break-lines-autoloads
eldoc-autoloads undo-tree diff undo-tree-autoloads use-package-diminish
sicp racket-mode derived racket-bug-report package url-handlers
racket-collection tq racket-repl-buffer-name racket-stepper
racket-logger racket-profile racket-smart-open racket-xp
racket-xp-complete racket-show pcase pos-tip racket-imenu imenu
racket-edit hideshow racket-repl semantic/symref/grep grep
semantic/symref semantic/util-modes semantic/util semantic pp
semantic/tag semantic/lex semantic/fw mode-local find-func cedet compile
racket-eldoc racket-describe shr text-property-search url-cookie
url-domsuf url-util url-parse auth-source password-cache json map
url-vars puny svg xml dom browse-url racket-visit xref project eieio
eieio-core eieio-loaddefs racket-complete racket-common racket-parens
racket-indent racket-font-lock racket-ppss racket-keywords-and-builtins
thingatpt ido comint ansi-color ring racket-doc racket-cmd racket-util
racket-browse-url racket-custom sh-script smie executable rx
racket-mode-autoloads pos-tip-autoloads faceup-autoloads edmacro kmacro
windmove finder-inf use-package-bind-key bind-key easy-mmode cl-seq
use-package-core early-init use-package-autoloads bind-key-autoloads
straight-autoloads info cl-extra help-mode easymenu seq byte-opt
straight subr-x cl-macs gv cl-loaddefs cl-lib bytecomp byte-compile
cconv 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 tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer 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
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
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 998382 583405)
 (symbols 48 52020 35)
 (strings 32 166975 30774)
 (string-bytes 1 4861732)
 (vectors 16 64196)
 (vector-slots 8 1028063 287354)
 (floats 8 796 1311)
 (intervals 56 66038 16961)
 (buffers 1000 41))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45922; Package emacs. (Sun, 17 Jan 2021 11:59:02 GMT) Full text and rfc822 format available.

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

From: Tomas Nordin <tomasn <at> posteo.net>
To: Акимжанчег <zelenaruta <at> gmail.com>,
 45922 <at> debbugs.gnu.org
Subject: Re: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sun, 17 Jan 2021 12:58:38 +0100
Hello Акимжанчег

Акимжанчег <zelenaruta <at> gmail.com> writes:

> Date: Sun, 17 Jan 2021 03:45:31 +0600
> Message-ID: <875z3wd090.fsf <at> gmail.com>
> --text follows this line--
>
> Today I was making a program in Python for myself. One of the functions
> required me to pass a long string to it, so I did that. Auto-fill-mode
> got triggered when I pressed the space bar and the string was split from
> this:
> ```
> matrix = self.getprop("Coordinate Transformation Matrix").split(", ")
> ```
> To this:
> ```
> matrix = self.getprop("Coordinate Transformation
>                                   Matrix").split(", ")
> ```
> After that, I saw `SyntaxError: EOL while scanning string literal'.
> This can be fixed with two different methods:
> 1. Adding a `+' between the strings, so that it looks like
> ```
> matrix = self.getprop("Coordinate Transformation"
>                      +"Matrix").split(", ")
> ```
> 2. Dividing the string to 2 separate strings:
> ```
> matrix = self.getprop("Coordinate Transformation"
>                       "Matrix").split(", ")

From the recepie it would seem like fill-column is set to something low.
But probably you have some indentation there prior to 'matrix = ...'?

I don't think there is something in python mode that do what you are
suggesting as of now. For curiosity, do you see this kind of support in
other editors?

nit: the 2 suggestions would loose a space in the string




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45922; Package emacs. (Sun, 17 Jan 2021 20:19:02 GMT) Full text and rfc822 format available.

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

From: Tomas Nordin <tomasn <at> posteo.net>
To: Акимжанчег <zelenaruta <at> gmail.com>
Cc: 45922 <at> debbugs.gnu.org
Subject: Re: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sun, 17 Jan 2021 21:18:40 +0100
Акимжанчег <zelenaruta <at> gmail.com> writes:

>>
>>
>> From the recepie it would seem like fill-column is set to something low.
>> But probably you have some indentation there prior to 'matrix = ...'?
>>
> Yes there were 8 spaces before that
>
>> I don't think there is something in python mode that do what you are
>> suggesting as of now. For curiosity, do you see this kind of support in
>> other editors?
>>
> Emacs is the only editor I ever used, but when I write a comment and reach
> the fill-column auto-fill-mode opens a new line and puts the comment
> character there, so I thought if it does it for comments then it might as
> well do it for strings.

The one and true editor. I /think/ the filling of comments gets handled
by fill.el. Filling of one-line strings would have to be handled by
python.el. I was looking to see if it tries to support that but couldn't
find indications it does. Cannot find that it documents to support it.

I agree it could be convenient and understand the expectation based on
the comment filling. Might be difficult to implement tho.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45922; Package emacs. (Sat, 07 May 2022 15:52:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Акимжанчег <zelenaruta <at> gmail.com>
Cc: 45922 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sat, 07 May 2022 17:51:14 +0200
Акимжанчег <zelenaruta <at> gmail.com> writes:

> Today I was making a program in Python for myself. One of the functions
> required me to pass a long string to it, so I did that. Auto-fill-mode
> got triggered when I pressed the space bar and the string was split from
> this:
> ```
> matrix = self.getprop("Coordinate Transformation Matrix").split(", ")
> ```
> To this:
> ```
> matrix = self.getprop("Coordinate Transformation
>                                   Matrix").split(", ")
> ```
> After that, I saw `SyntaxError: EOL while scanning string literal'.

I can reproduce this in Emacs 29, too.

The Python auto fill basically just calls `do-auto-fill', so I wondered
whether there was something simple to tell that function to not consider
any points where ppss-string-terminator is non-nil as a break point, but
apparently not?  (It seems like such an obvious thing to have, so
perhaps there's a good reason we don't have that.)

I've added Stefan to the CCs; perhaps he has some comments.

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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 07 May 2022 15:52:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45922; Package emacs. (Sat, 07 May 2022 16:26:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Акимжанчег <zelenaruta <at> gmail.com>,
 45922 <at> debbugs.gnu.org
Subject: Re: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sat, 07 May 2022 12:25:21 -0400
> The Python auto fill basically just calls `do-auto-fill', so I wondered
> whether there was something simple to tell that function to not consider
> any points where ppss-string-terminator is non-nil as a break point, but
> apparently not?

`fill-nobreak-predicate`?


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45922; Package emacs. (Sat, 07 May 2022 16:58:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Акимжанчег <zelenaruta <at> gmail.com>,
 45922 <at> debbugs.gnu.org
Subject: Re: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sat, 07 May 2022 18:56:51 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> The Python auto fill basically just calls `do-auto-fill', so I wondered
>> whether there was something simple to tell that function to not consider
>> any points where ppss-string-terminator is non-nil as a break point, but
>> apparently not?
>
> `fill-nobreak-predicate`?

Ah, yes, perfect.  With this, it works like the original bug reporter
wanted:

              (setq-local fill-nobreak-predicate
              (lambda ()
                (ppss-string-terminator (syntax-ppss))))

But this reminds me that auto-fill-mode in programming modes is a bad
idea in general: Even if it doesn't chop anything inside the string,
it'll still lead to invalid code.

So I think the answer to this bug report is really -- don't use
auto-fill in python-mode, and I'm closing it as a wontfix.

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




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 07 May 2022 16:58:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 45922 <at> debbugs.gnu.org and Акимжанчег <zelenaruta <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 07 May 2022 16:58:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45922; Package emacs. (Sat, 07 May 2022 17:29:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Акимжанчег <zelenaruta <at> gmail.com>,
 45922 <at> debbugs.gnu.org
Subject: Re: bug#45922: 27.1; Better auto-fill for strings in python-mode
Date: Sat, 07 May 2022 13:28:15 -0400
> But this reminds me that auto-fill-mode in programming modes is a bad
> idea in general:

Or at least, it needs to be custom-tailored (as in `smie-auto-fill` or
things along these lines).

In many/most programming languages the only real trouble is
inserting/adding newlines inside strings or newline-terminated comments.

> So I think the answer to this bug report is really -- don't use
> auto-fill in python-mode, and I'm closing it as a wontfix.

Yup, in python-mode (and other programming modes where LF is not always
treated as whitespace) it does need a lot more care.


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 05 Jun 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year 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.