emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Chris Findeisen <cfindeisen7@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] Emacs tries to recenter / rescroll when it hits hidden org emphasis [9.4.6 (9.4.6-798-g738759.dirty-elpaplus @ .emacs.d/elpa/develop/org-plus-contrib-20210929/)]
Date: Tue, 4 Jan 2022 12:11:43 -0600	[thread overview]
Message-ID: <CA+FzMhahT16w5KPi3hgq8Gn7wnb+PjcNuS_ULk_jroGLHBVBaw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See


Your bug report will be posted to the Org mailing list.

To reproduce this:
1. Load the repro emacs settings.
2. Scroll down in a buffer, such that top of buffer is not visible on
3. Create an emphasized word at the beginning of the 2nd visual-line in a
visually-wrapped line.
4. Move your point to the start of that emphasized word

It's a little difficult to describe, so I'll give an example. Assume
that the visual-line wrapping is happening at the place indicated by

So, if this were one long line, then this is the first visual line,$
/whereas/ this is the second visual line in the paragraph, and you'd place$
point on the italicized "w" in the word "whereas". That triggers the bug.

What happens next is that emacs thinks the point is no longer on screen
and tries to scroll to fix that. Under vanilla emacs, it will just
recenter the point. This still is misbehaving but not terribly. However,
smooth-scrolling as mentioned above, the behavior is worse. The window
scrolls up and point jumps to the top of the window.

Reproed this with the following: emacs -Q
with the following:
(setq org-hide-emphasis-markers t)

(visual-line-mode 1)

;; Without this, emacs will still show bug by calling recenter, but the
effect is particularly egregious with these settings (i.e. smooth scrolling)
(setq scroll-conservatively 101
      scroll-preserve-screen-position t
      scroll-margin 0)

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5,
cairo version 1.16.0)
 of 2021-02-09, modified by Debian
Package: Org mode version 9.4.6 (9.4.6-798-g738759.dirty-elpaplus @

[-- Attachment #2: Type: text/html, Size: 2250 bytes --]

             reply	other threads:[~2022-01-08  4:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 18:11 Chris Findeisen [this message]
2022-10-26  8:03 ` [BUG] Emacs tries to recenter / rescroll when it hits hidden org emphasis [9.4.6 (9.4.6-798-g738759.dirty-elpaplus @ .emacs.d/elpa/develop/org-plus-contrib-20210929/)] Ihor Radchenko
2022-10-28  4:09   ` Ihor Radchenko
2022-12-25 22:58     ` Chris Findeisen

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:

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CA+FzMhahT16w5KPi3hgq8Gn7wnb+PjcNuS_ULk_jroGLHBVBaw@mail.gmail.com \
    --to=cfindeisen7@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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