unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Miha Rihtaršič" <miha@kamnitnik.top>
To: 43730@debbugs.gnu.org
Subject: bug#43730: 27.1; Running (visual-line-mode 1) twice
Date: Wed, 30 Sep 2020 21:02:39 +0200	[thread overview]
Message-ID: <86eemjdr5c.fsf@miha-pc> (raw)


Running (visual-line-mode 1) twice is inconsistent due to variable
visual-line--saved-state being set twice.

A real life example, producible with emacs -Q would be to run

(setq-default truncate-lines t)
(add-hook 'text-mode-hook 'visual-line-mode)
(add-hook 'prog-mode-hook 'visual-line-mode)

and visit a buffer in mhtml-mode, which runs both text-mode-hook and
prog-mode-hook.
visual-line-mode sets the local value of truncate-lines to nil as
expected but turning it off with
M-x visual-line-mode
fails to restore truncate-lines back to t, due to incorrect
visual-line--saved-state.

(My current work-around is to add
(lambda ()
  (unless visual-line-mode (visual-line-mode)))
to the hooks.)

Other minor modes relying on a '-saved-state' variable are possibly
affected as well. A quick grep lead me to:
refill-mode and cua-mode.


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-28 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Arch Linux

Recent messages:
Indenting region...done
Visual-Line mode disabled in current buffer
Mark saved where search started
Mark set
Replaced 7 occurrences
Mark set [3 times]
Undo
Mark set
Comint exited abnormally with code 1
Auto-saving...

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.utf8
  locale-coding-system: utf-8-unix

Memory information:
((conses 16 852933 497311)
 (symbols 48 45748 2)
 (strings 32 245922 68759)
 (string-bytes 1 7871697)
 (vectors 16 80403)
 (vector-slots 8 1800671 524204)
 (floats 8 724 2716)
 (intervals 56 43104 32951)
 (buffers 1000 27))





             reply	other threads:[~2020-09-30 19:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 19:02 Miha Rihtaršič [this message]
2020-10-01  2:15 ` bug#43730: 27.1; Running (visual-line-mode 1) twice Lars Ingebrigtsen
2020-10-01  2:27   ` Lars Ingebrigtsen
2020-10-01 16:50     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86eemjdr5c.fsf@miha-pc \
    --to=miha@kamnitnik.top \
    --cc=43730@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).