unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space
@ 2021-02-27 16:30 Miguel V. S. Frasson
  2021-02-27 18:24 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel V. S. Frasson @ 2021-02-27 16:30 UTC (permalink / raw)
  To: 46814

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@gmail.com





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

* bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space
  2021-02-27 16:30 bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space Miguel V. S. Frasson
@ 2021-02-27 18:24 ` Eli Zaretskii
  2021-02-27 22:14   ` Kévin Le Gouguec
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-02-27 18:24 UTC (permalink / raw)
  To: Miguel V. S. Frasson; +Cc: 46814

> From: "Miguel V. S. Frasson" <mvsfrasson@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.





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

* bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space
  2021-02-27 18:24 ` Eli Zaretskii
@ 2021-02-27 22:14   ` Kévin Le Gouguec
  2021-02-28 17:39     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Kévin Le Gouguec @ 2021-02-27 22:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 46814, Miguel V. S. Frasson

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Miguel V. S. Frasson" <mvsfrasson@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@live.com>
    https://lists.gnu.org/archive/html/bug-gnu-emacs/2018-05/msg00894.html





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

* bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space
  2021-02-27 22:14   ` Kévin Le Gouguec
@ 2021-02-28 17:39     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2021-02-28 17:39 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 46814, mvsfrasson

merge 46814 31666
thanks

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: "Miguel V. S. Frasson" <mvsfrasson@gmail.com>,  46814@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.





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

end of thread, other threads:[~2021-02-28 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 16:30 bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space Miguel V. S. Frasson
2021-02-27 18:24 ` Eli Zaretskii
2021-02-27 22:14   ` Kévin Le Gouguec
2021-02-28 17:39     ` Eli Zaretskii

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