From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 29d1c72: Introduce new value t for compilation-context-lines to eliminate scrolling Date: Tue, 27 Aug 2019 15:59:27 -0400 Message-ID: References: <20190825102322.19558.22771@vcs0.savannah.gnu.org> <20190825102323.5080620CD5@vcs0.savannah.gnu.org> <20190825190637.GE4724@ACM> <838srhghoc.fsf@gnu.org> <20190827193652.GA20676@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="223851"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 27 21:59:48 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i2hd5-000w8W-0F for ged-emacs-devel@m.gmane.org; Tue, 27 Aug 2019 21:59:47 +0200 Original-Received: from localhost ([::1]:56460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2hd3-0003hx-O1 for ged-emacs-devel@m.gmane.org; Tue, 27 Aug 2019 15:59:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41683) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2hcu-0003hi-4i for emacs-devel@gnu.org; Tue, 27 Aug 2019 15:59:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2hcs-0005le-3H for emacs-devel@gnu.org; Tue, 27 Aug 2019 15:59:35 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:29225) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i2hcp-0005iD-Sr; Tue, 27 Aug 2019 15:59:32 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 97C7381180; Tue, 27 Aug 2019 15:59:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 40FBD810B2; Tue, 27 Aug 2019 15:59:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1566935969; bh=XQ28ovkCQTJYHM4BrdvLbTnFMPHcrwWDdM2pxIrsZI4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=nO5+vKWw+gOxtcbJ9Ba80UXJK6dTmzSimNfpz1s1w2g285MoS06hpkukNHwIu7nEs mrxUp+VSi5XoEINW2YB1og4nipcBF69zST0ht3bCy/KwkX3gcHdxgC7aIyY016Z0en bt4MOPpeddnx5/m7BghcwIEfQORbE0hkTLbY8DdqyTzJNxRr8g9m4ujq3EaBD2Nntn yVUEhC7xNK0Xk+XQmHb4mX4C1WrC7XYskzmSuuzaBnoa21rIDrB+XgEU2d6oLHwFbN OGD5j5MUmYqpzhD/TmFId2/noRxoi95lXenUqE7jq0RIdrrNi/H2bbtCzWO0dZ0D+O 9tAT7retQpsbQ== Original-Received: from pastel (unknown [45.72.142.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C70BB120442; Tue, 27 Aug 2019 15:59:28 -0400 (EDT) In-Reply-To: <20190827193652.GA20676@ACM> (Alan Mackenzie's message of "Tue, 27 Aug 2019 19:36:52 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:239625 Archived-At: Hi Alan, > +(defvar compilation-dummy-string ">" > + "A string which is only a placeholder for compilation-margin-string. > +It's actual value is never used, but must be one character long.") > +(put-text-property 0 1 'display > + `((margin left-margin) ,compilation-margin-string) > + compilation-dummy-string) I'd suggest you use a "compilation--" prefix here since this is supposed to be internal, IIUC. Also, I'd do it as (defvar compilation--dummy-string (propertize ">" 'display `((margin left-margin) ,compilation-margin-string)) "A string which is only a placeholder for `compilation-margin-string'. Its actual value is never used, but must be one character long.") so you can M-C-x it without ill-effect [note I also fixed "It's" to "Its" and added `...' around the var ref. ] > +(defun compilation-tear-down-arrow-spec-in-margin () > + "Restore compilation-arrow-overlay to not using the margin, which is removed." > + (overlay-put compilation-arrow-overlay 'before-string nil) > + (delete-overlay compilation-arrow-overlay) > + (setq compilation-arrow-overlay nil) I think this `setq` loses the overlay and there's no code to reconstruct it later on. > + (set-window-margins (selected-window) 0)) Of course, the main problem with this approach is that "margins don't compose": any other package using the margins (e.g. (n)linum) will tend to interfere with your own use. > + (with-selected-window w ; So the later `goto-char' will work. An alternative is to use `set-window-point` instead of `goto-char`. Stefan