[Top][All Lists]

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

Re: Removing rollback from VC mode - request for comment

From: Eli Zaretskii
Subject: Re: Removing rollback from VC mode - request for comment
Date: Sun, 14 Dec 2014 21:34:38 +0200

> From: Jonas Bernoulli <address@hidden>
> Cc: Nicolas Richard <address@hidden>, address@hidden, address@hidden
> Date: Sun, 14 Dec 2014 13:11:06 +0100
> Eli Zaretskii <address@hidden> writes:
> >> Nicolas Richard <address@hidden> writes:
> >> 
> >> I don't know what Eli has in mind, but perhaps magit-make-margin-overlay
> >> is one such thing ?
> >
> > Yes, it's one of them.
> `elisp(Displaying in the Margins)' states that, "to display something in
> the margin _in association with_ certain buffer text, without altering
> or preventing the display of that text, put a `before-string' property
> on the text and put the margin display specification on the contents of
> the before-string."
> That's what `magit-make-margin-overlay' does:
>   (defun magit-make-margin-overlay (&rest strings)
>     (let ((o (make-overlay (point) (line-end-position) nil t)))
>       (overlay-put o 'evaporate t)
>       (overlay-put o 'before-string
>                    (propertize "o" 'display
>                                (list '(margin right-margin)
>                                      (apply #'concat strings))))))
> It seems to me that Magit is doing it the way it is supposed to be doing
> it.  Is there another undocumented way?  Am I missing something?

I didn't say that magit uses some undocumented feature, or uses it
contrary to documentation.  That's not the issue.

The issue is that magit uses these features too much, at times almost
completely obscuring the buffer text with display and overlay
strings.  The Emacs display engine was never meant to cope with such
massive usage of these features.  I think magit also uses a lot of
overlay/display strings with newlines, or maybe it did in the past.
That is one of the nastiest thing to do with Emacs display.  (I can
explain if you are interested.)

And frankly, I don't understand why this kind of design was necessary:
it's not like magit shows some file whose contents it can't control.
It presents a buffer that is entirely created out of thin air by Git.
If what Git generates doesn't fit what magit wants to show the user,
what prevents magit from massaging the text it gets from Git to its
heart's content, when creating the buffer?  Instead of overlaying
buffer text with display and overlay strings, it could simply format
the buffer text any way it likes, and then avoid the need to do all

I hope this explains why I feel badly about that.

reply via email to

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