From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Removing rollback from VC mode - request for comment Date: Sun, 14 Dec 2014 21:34:38 +0200 Message-ID: <83h9wyxbxt.fsf@gnu.org> References: <20141211092138.6D5F6C008E@snark.thyrsus.com> <20141211123629.GA25499@thyrsus.com> <83fvcmtax5.fsf@gnu.org> <87wq5y9l4e.fsf@wanadoo.es> <83wq5yrr77.fsf@gnu.org> <83r3w5sy1g.fsf@gnu.org> <87bnn8hn62.fsf@yahoo.fr> <83sigkr7u5.fsf@gnu.org> <87iohe4eo7.fsf@bernoul.li> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1418585725 22321 80.91.229.3 (14 Dec 2014 19:35:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Dec 2014 19:35:25 +0000 (UTC) Cc: theonewiththeevillook@yahoo.fr, emacs-devel@gnu.org, john.b.mastro@gmail.com To: Jonas Bernoulli Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 14 20:35:17 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y0Ewm-0001wp-Rp for ged-emacs-devel@m.gmane.org; Sun, 14 Dec 2014 20:35:17 +0100 Original-Received: from localhost ([::1]:36949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Ewm-0006MR-CK for ged-emacs-devel@m.gmane.org; Sun, 14 Dec 2014 14:35:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0EwW-0006KD-To for emacs-devel@gnu.org; Sun, 14 Dec 2014 14:35:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0EwR-0008N5-VW for emacs-devel@gnu.org; Sun, 14 Dec 2014 14:35:00 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:42627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0EwR-0008N1-IE for emacs-devel@gnu.org; Sun, 14 Dec 2014 14:34:55 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NGL00E007CTJS00@mtaout29.012.net.il> for emacs-devel@gnu.org; Sun, 14 Dec 2014 21:32:26 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NGL00EL57M10N10@mtaout29.012.net.il>; Sun, 14 Dec 2014 21:32:26 +0200 (IST) In-reply-to: <87iohe4eo7.fsf@bernoul.li> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.185 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180104 Archived-At: > From: Jonas Bernoulli > Cc: Nicolas Richard , john.b.mastro@gmail.com, emacs-devel@gnu.org > Date: Sun, 14 Dec 2014 13:11:06 +0100 > > > Eli Zaretskii writes: > > >> Nicolas Richard 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 that. I hope this explains why I feel badly about that.