From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.devel Subject: Re: Removing rollback from VC mode - request for comment Date: Sun, 14 Dec 2014 13:11:06 +0100 Message-ID: <87iohe4eo7.fsf@bernoul.li> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418559281 22403 80.91.229.3 (14 Dec 2014 12:14:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Dec 2014 12:14:41 +0000 (UTC) Cc: Nicolas Richard , emacs-devel@gnu.org, john.b.mastro@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 14 13:14:34 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 1Y084I-0005Rx-A5 for ged-emacs-devel@m.gmane.org; Sun, 14 Dec 2014 13:14:34 +0100 Original-Received: from localhost ([::1]:35730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y084H-0000wF-7A for ged-emacs-devel@m.gmane.org; Sun, 14 Dec 2014 07:14:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y083z-0000up-CF for emacs-devel@gnu.org; Sun, 14 Dec 2014 07:14:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y083u-0008N3-9l for emacs-devel@gnu.org; Sun, 14 Dec 2014 07:14:15 -0500 Original-Received: from mail.hostpark.net ([212.243.197.30]:54352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y083o-0008Lz-FP; Sun, 14 Dec 2014 07:14:04 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 59BD217025; Sun, 14 Dec 2014 13:14:01 +0100 (CET) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id lSvSUz_wHfHS; Sun, 14 Dec 2014 13:14:01 +0100 (CET) Original-Received: from lem (80-218-85-1.dclient.hispeed.ch [80.218.85.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 1DC5F16DFA; Sun, 14 Dec 2014 13:14:01 +0100 (CET) In-reply-to: <83sigkr7u5.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.243.197.30 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:180066 Archived-At: 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? The documentation above does not explicitly mention that an overlay has to be used, but I could not get it to work otherwise. There is only one builtin package which uses `(margin [left|right]-margin)`, Linum-Mode, and it also uses overlays, in pretty much the same way. (There is one small difference in that Linum-Mode uses (make-overlay (point) (point) ...) while Magit uses (make-overlay (point) (line-end-position)) which is kinda pointless because it unfortunately does not have the desired effect of keeping to display the margin's text even when `line-beginning-position' is scrolled of the window. So yeah, I could change that). In summary, yeah this is ugly, but it ain't Magit's fault. Or do you frown upon Magit making the margin "buffer-local" using `magit-set-buffer-margin'? Ps: I am only interested in constructive criticism of Magit's next branch. Neither broad "it's all wrong", nor wards which used to existed in 1.2.* or master interest me.