From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20674: linum-mode overwrites existing margin width Date: Thu, 28 May 2015 17:36:35 +0300 Message-ID: <83d21kydjg.fsf@gnu.org> References: <1432713363.1473906.279104713.451ED6BC@webmail.messagingengine.com> <83vbfexbo5.fsf@gnu.org> <1432787576.1045910.280092697.36DC47ED@webmail.messagingengine.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432823852 5397 80.91.229.3 (28 May 2015 14:37:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 May 2015 14:37:32 +0000 (UTC) Cc: 20674@debbugs.gnu.org To: "Paul W. Rankin" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 28 16:37:20 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Yxyvo-0002Eh-Eb for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 May 2015 16:37:12 +0200 Original-Received: from localhost ([::1]:59361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxyvn-000666-Ep for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 May 2015 10:37:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxyvk-00065S-3m for bug-gnu-emacs@gnu.org; Thu, 28 May 2015 10:37:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxyve-0006g5-UV for bug-gnu-emacs@gnu.org; Thu, 28 May 2015 10:37:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxyve-0006g1-Qa for bug-gnu-emacs@gnu.org; Thu, 28 May 2015 10:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Yxyve-0006ib-Ab for bug-gnu-emacs@gnu.org; Thu, 28 May 2015 10:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 May 2015 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20674 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20674-submit@debbugs.gnu.org id=B20674.143282381325807 (code B ref 20674); Thu, 28 May 2015 14:37:02 +0000 Original-Received: (at 20674) by debbugs.gnu.org; 28 May 2015 14:36:53 +0000 Original-Received: from localhost ([127.0.0.1]:59674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxyvU-0006iA-1O for submit@debbugs.gnu.org; Thu, 28 May 2015 10:36:52 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:39550) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxyvQ-0006hv-87 for 20674@debbugs.gnu.org; Thu, 28 May 2015 10:36:49 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NP200300DFYKY00@mtaout24.012.net.il> for 20674@debbugs.gnu.org; Thu, 28 May 2015 17:28:12 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NP20033ZDIZYR00@mtaout24.012.net.il>; Thu, 28 May 2015 17:28:12 +0300 (IDT) In-reply-to: <1432787576.1045910.280092697.36DC47ED@webmail.messagingengine.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103265 Archived-At: > From: "Paul W. Rankin" > Cc: 20674@debbugs.gnu.org > Date: Thu, 28 May 2015 14:32:56 +1000 > > > I think linum-mode is incompatible with any other means of putting > > anything inside the display margins, because it actually writes > > there. The width of the margin is just the tip of the iceberg, > > because at best you will have margins whose contents are overwritten > > by linum-mode. > > The incompatibility was found in a minor mode I maintain called > olivetti.el, which only sets the window margin widths in order to centre > the text body, it does not display anything within the margins. > > In theory, linum-mode.el should be compatible with because it should > only require increasing the margin width on an as-needed basis. Linum-mode is evil: it wants total control of the left margin. Not only does it enlarge the margin width as it sees fit, it also makes it smaller and even resets it back to zero upon certain events, such as changing the buffer's major mode. So making linum-mode compatible with other modes that change the margin width would require to record, in every buffer (or maybe even every window) the value of the margin width before linum-mode was turned on, and then take that value in consideration when linum-mode wants to make any change to the margin width. And then we will no doubt hear from someone who has linum-mode turned on by default, in which case there's no opportunity to record the initial margin width, and we will have to make set-window-margins be aware of linum-mode in some way, so it could do what you want. Is this hassle justified for covering only use cases like yours, where the "other" mode puts nothing in the margins? We are clearly talking about making a subset of margin users somewhat less incompatible with linum-mode, and we are building that on very shaky foundations. And even if we decide these complications are worthwhile, there will be problems when linum-mode wants a margin that is wider than what your mode sets, because linum-mode only changes the left margin, so your mode will then be unable to keep the text centered and of the required width, right? So your mode will be semi-broken by linum-mode anyway. Bottom line: this makes very little sense to me. May I suggest that you switch olivetti.el to using other display features, such as line-prefix and wrap-prefix, instead? (You can keep the right margin, if you want, since linum-mode does not try to usurp that one.) Or just declare that your mode is incompatible with linum-mode.