Subject: bug#56808: 29.0.50; Elusive display problem on macOS

From: Gerd Möllmann <[email-masked]>
Date: Thu, 28 Jul 2022 07:09:34 +0200

In GNU Emacs 29.0.50 (build 6, aarch64-apple-darwin21.5.0, NS appkit-2113.60 Version 12.5 (Build 21G72))
 of 2022-07-27 built on Mini.fritz.box
Repository revision: de863f70aa905d3a7feaedb58b65bd7f9776853b
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.5

I am meeing a display problem on macOS.  I am looking at code like this:

(dap-register-debug-template
 (list :name "LLDB Emacs"
       :type "lldb-vscode"

When the problem happens, the display looks like

(dap-register-debug-template
 (list :name "LLDB Emacs"
        :type "lldb-vscode"

I.e. :name and :type don't align anymore.

I haven't been able to find the cause of this, or even been able to make
it reproducible.

Observations I made so far

- The problem might somehow depend on something happening at startup.
  When the problem happens after startup, it sticks.  When the problem
  does not happens, it also remains that way.
  
- The problem occurs like every 20th Emacs start.  Maybe it's even less
  frequent.
  
- I've not been able to reproduce this with -Q.

- The indentation of the :type line above consists of spaces only, which
  I mention because there was a recent commit involving stretch glyphs
  on macOS.  TABs are not present in that line.

- The spaces of the indentation all have default face.

- The mis-indentation increases with the depth of indentation.  It's not
  a constant offset.

- Curiously, it looks to me like the end position of the indentation
  lines up with character boundaries on the line above, but I can't see
  the individual pixels here, so that may be wrong.

- Font is Monaco 12.

- Theme is modus-operandi.

- I can't say 100% sure but I might have seen that already last week?  I
  was looking at a multi-line C function call, where the second line of
  arguments wasn't aligned under the ( of the function call.  ISTR
  wondering slightly why some functions were consistently aligned in a
  strange way.

Someone else seeing this, who has another observation to share?
Maybe the same happening with a different font?