help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redisplaying text in both display margins?


From: Eli Zaretskii
Subject: Re: Redisplaying text in both display margins?
Date: Wed, 27 Jan 2021 17:59:23 +0200

> Date: Mon, 25 Jan 2021 18:28:11 +1000
> From: "Paul W. Rankin" <pwr@bydasein.com>
> Cc: help-gnu-emacs@gnu.org
> 
> emacs -Q
> (erase-buffer)
> (set-window-margins nil 20)
> (insert "foobarbaz")
> (put-text-property 4 7 'display '((margin left-margin) (space :width (- 
> left-margin 2))))
> (put-text-property 7 10 'display '((margin left-margin) "1"))
> 
> This should result in a window with something like:
> 
>            1 foo
> 
> Then assuming a frame of 80 columns and `truncate-lines' is nil (or 
> visual-line-mode is enabled):
> 
> (goto-char (point-min))
> (insert (make-string 45 ?x))
> 
> The "1" will appear to get pushed towards the left as more text is added 
> until the line wraps the window:
> 
> So my question becomes, how should I apply these display text properties 
> such that they will not be affected by line wrapping?

It's a bug.  Two bugs, actually.  And from the looks of that, it
sounds like no one has ever tried to display stretches of whitespace
in the display margins.

I've now fixed that on the master branch, see commit ff03411.

Alan, could you please see if something similar is needed in nsterm.m
(my reading of the code indicates that it is already okay, but I'm not
sure).  The symptom of the problem I fixed in xterm.c and w32term.c is
that when you execute the first part of the recipe in a single progn,
the first 2 lines are not cleared in the left margin area, you still
see portions of the comment originally displayed in the *scratch*
buffer.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]