all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Overlay after-string with cursor
@ 2019-08-07 22:32 otadmor .
  2019-08-09 22:02 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: otadmor . @ 2019-08-07 22:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,
I'm trying to extend ediff to show the pws aligned like bcompare and vim.
For this I am required to add "fake" lines (newlines) as the number of
missing lines on each side.
I managed to understand where to put the hook and how to calculate the
difference, but I have no clue of how to add the lines themselves.
I have thought of 2 options but they do not fit my needs.
1. Add real text to the buffer. This gives me correct cursor locations (it
is possible to put the cursor on a fake line) but it makes a mess when I
open this buffer on a different window than the comparison window. I can
see my padding, and I might save this newline paddings to the original file.
2. Setting after-string allows me to use the window property without see
these newlines on a different window. The problem is I cannot move my
cursor over the padding which is not convenient when comparing files.

Is it possible to add an overlay for one window without changing the
original buffer text and being able to put my cursor on it?

Thanks.


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

* Re: Overlay after-string with cursor
  2019-08-07 22:32 Overlay after-string with cursor otadmor .
@ 2019-08-09 22:02 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2019-08-09 22:02 UTC (permalink / raw)
  To: help-gnu-emacs

> Is it possible to add an overlay for one window without changing the
> original buffer text and being able to put my cursor on it?

You can control where the cursor is displayed in the after-string, with
the `cursor` property.  Doing in it such a way that it gives the
illusion that you can put the cursor "wherever you want" can be a bit
fiddly, so I think it's worth clarifying why exactly you want something
like that, so as to be better decide how to attack the problem.


        Stefan




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

end of thread, other threads:[~2019-08-09 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-07 22:32 Overlay after-string with cursor otadmor .
2019-08-09 22:02 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.