GNU bug report logs - #46814
26.3; Visual-line-mode produces fake newline if line begins with space

Previous Next

Package: emacs;

Reported by: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>

Date: Sat, 27 Feb 2021 16:32:01 UTC

Severity: normal

Found in version 26.3

To reply to this bug, email your comments to 46814 AT debbugs.gnu.org.

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#46814; Package emacs. (Sat, 27 Feb 2021 16:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 27 Feb 2021 16:32:02 GMT) Full text and rfc822 format available.

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

From: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; Visual-line-mode produces fake newline if line begins with space
Date: Sat, 27 Feb 2021 13:30:23 -0300
Hi.

In visual-line-mode, if after leading whitespace it follows very long
text without spaces, it occurs a visual line break after the leading
whitespace, creating an false blank line, annoying users because extra
blank lines may change the meaning of text.

It would be more sensible in visual-line-mode forbids visual line breaks
after leading whitespace, because they always create blank lines.

How to reproduce:

a) emacs -Q
b) type some text without spaces but *with leading spaces*, like

  1-Aaaaaaaaaa
  2-Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

c) M-x visual-line-moded.
d) Result: visual linebreak after "  " on line 2, creating blank
line. No gain, because one still gets long line displayed.

  1-Aaaaaaaaaa

2-Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

e) Proposal: keep leading space together with following long text.

Best regards

Miguel.


In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.13)
 of 2019-12-24 built on lcy01-amd64-029
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description:    Ubuntu 20.04.2 LTS

Recent messages:
Enviando para o Google Translate ... FEITO!
Mark set [3 times]
Auto-saving...done
Visual-Line mode disabled in current buffer
Visual-Line mode enabled in current buffer
Saving file /home/sme/Drive/livros/circulos-berkeley/AMS-volume2/mcl-impa/Chapter12ReflectionsAcrossLineIII.tex...
Wrote /home/sme/Drive/livros/circulos-berkeley/AMS-volume2/mcl-impa/Chapter12ReflectionsAcrossLineIII.tex
Quit
Sorting environment...done
Removing duplicates...done

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=26 --with-modules --with-file-notification=inotify
 --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets
 --with-lcms2 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs26-XQGPla/emacs26-26.3~1.git96dd019=.
-fstack-protector-strong
 -Wformat -Werror=format-security -no-pie' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro
 -no-pie''

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

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

Major mode: LaTeX/MPS

Minor modes in effect:
  LaTeX-math-mode: t
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  shell-dirtrack-mode: t
  reftex-mode: t
  show-paren-mode: t
  recentf-mode: t
  delete-selection-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
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/sme/Dropbox/.emacs.d/asy-mode hides /usr/share/emacs/site-lisp/asy-mode
/usr/share/emacs/site-lisp/latex-cjk-thai/thai-word hides
/usr/share/emacs/26.3/lisp/language/thai-word

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg 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 url-util reftex-parse misearch
multi-isearch copiar preview prv-emacs reftex-dcr reftex-auc noutline
outline tex-buf font-latex texmathp latex easy-mmode latex-flymake
flymake-proc flymake warnings thingatpt tex-ispell tex-style tex dbus
xml crm advice tex-mode compile shell pcomplete comint ansi-color ring
latexenc elec-pair reftex reftex-loaddefs reftex-vars texify
gregorio-mode server edmacro kmacro paren recentf tree-widget wid-edit
delsel cus-start cus-load finder-inf info tex-site 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 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 threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 392659 23400)
 (symbols 48 34817 2)
 (miscs 40 146 888)
 (strings 32 106550 3128)
 (string-bytes 1 2760077)
 (vectors 16 34854)
 (vector-slots 8 1477234 189742)
 (floats 8 455 1948)
 (intervals 56 9132 389)
 (buffers 992 17))


-- 
Miguel Vinicius Santini Frasson
mvsfrasson <at> gmail.com




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46814; Package emacs. (Sat, 27 Feb 2021 18:26:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>
Cc: 46814 <at> debbugs.gnu.org
Subject: Re: bug#46814: 26.3;
 Visual-line-mode produces fake newline if line begins with space
Date: Sat, 27 Feb 2021 20:24:57 +0200
> From: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>
> Date: Sat, 27 Feb 2021 13:30:23 -0300
> 
> In visual-line-mode, if after leading whitespace it follows very long
> text without spaces, it occurs a visual line break after the leading
> whitespace, creating an false blank line, annoying users because extra
> blank lines may change the meaning of text.
> 
> It would be more sensible in visual-line-mode forbids visual line breaks
> after leading whitespace, because they always create blank lines.

Patches are welcome to implement this.  Word of warning: the current
implementation of this is in C, as part of the display engine, and
it's very complex.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46814; Package emacs. (Sat, 27 Feb 2021 22:15:02 GMT) Full text and rfc822 format available.

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

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 46814 <at> debbugs.gnu.org, "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>
Subject: Re: 26.3; Visual-line-mode produces fake newline if line begins
 with space
Date: Sat, 27 Feb 2021 23:14:40 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>
>> Date: Sat, 27 Feb 2021 13:30:23 -0300
>> 
>> In visual-line-mode, if after leading whitespace it follows very long
>> text without spaces, it occurs a visual line break after the leading
>> whitespace, creating an false blank line, annoying users because extra
>> blank lines may change the meaning of text.
>> 
>> It would be more sensible in visual-line-mode forbids visual line breaks
>> after leading whitespace, because they always create blank lines.
>
> Patches are welcome to implement this.  Word of warning: the current
> implementation of this is in C, as part of the display engine, and
> it's very complex.

Should this be merged with bug#11759 and bug#31666?  Skimming [1], I get
the impression that this new report describes a similar problem, i.e.
visual-line-mode refusing to break a word preceded by whitespace.
Quoting Clément :

>                If breaking before a word doesn't prevent that word
> from being broken, it would seem better to not break before it.  In
> other words, assuming 9 columns:
>
> Here breaking at ' ' is useful:
> 
>   Input:
>   123456789
>   xxx aaaaaaa
> 
>   Visual-line mode (good)
>   123456789
>   xxx
>   aaaaaaa
> 
> But not here:
> 
>   Input
>   123456789
>   xxx aaaaaaaaaaaaa
> 
>   Visual-line mode (bad):
>   123456789
>   xxx
>   aaaaaaaaa
>   aaaa
> 
>   What I'd expect:
>   123456789
>   xxx aaaaa
>   aaaaaaaa

Apologies if I've missed some subtleties.


[1] bug#31666#11
    <99baa6b2-584f-789f-ecf8-d845aedd18ef <at> live.com>
    https://lists.gnu.org/archive/html/bug-gnu-emacs/2018-05/msg00894.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46814; Package emacs. (Sun, 28 Feb 2021 17:40:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 46814 <at> debbugs.gnu.org, mvsfrasson <at> gmail.com
Subject: Re: 26.3; Visual-line-mode produces fake newline if line begins
 with space
Date: Sun, 28 Feb 2021 19:39:11 +0200
merge 46814 31666
thanks

> From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
> Cc: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>,  46814 <at> debbugs.gnu.org
> Date: Sat, 27 Feb 2021 23:14:40 +0100
> 
> > Patches are welcome to implement this.  Word of warning: the current
> > implementation of this is in C, as part of the display engine, and
> > it's very complex.
> 
> Should this be merged with bug#11759 and bug#31666?

Yes, I think so.  But note that some of the issues reported there were
fixed meanwhile, and we nowadays have word-wrap that uses character
categories, not just whitespace.




This bug report was last modified 4 years and 108 days ago.

Previous Next


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