From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook Date: Sun, 15 Oct 2017 22:59:35 -0600 Message-ID: <87efq37knc.fsf@gmail.com> References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1508130080 27815 195.159.176.226 (16 Oct 2017 05:01:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 05:01:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 28844@debbugs.gnu.org To: Paul Rankin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 16 07:01:16 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xWW-0005ja-W7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 07:01:09 +0200 Original-Received: from localhost ([::1]:59357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3xWe-0001Kj-BQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 01:01:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3xWX-0001Iw-8r for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 01:01:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3xWQ-0001aC-TO for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 01:01:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3xWQ-0001a5-NQ for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 01:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e3xWQ-0003pa-FF for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 01:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Oct 2017 05:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28844 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28844-submit@debbugs.gnu.org id=B28844.150813000414569 (code B ref 28844); Mon, 16 Oct 2017 05:01:02 +0000 Original-Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 05:00:04 +0000 Original-Received: from localhost ([127.0.0.1]:42297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xVT-0003mu-Cn for submit@debbugs.gnu.org; Mon, 16 Oct 2017 01:00:03 -0400 Original-Received: from mail-it0-f43.google.com ([209.85.214.43]:55701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xVR-0003lr-5C for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 01:00:01 -0400 Original-Received: by mail-it0-f43.google.com with SMTP id l196so16655346itl.4 for <28844@debbugs.gnu.org>; Sun, 15 Oct 2017 22:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=SMFJssIZXhLnm2b/SJ9txM3Xwe7fgdpMRHIK3zKr9RU=; b=YhSDFTGso8flW2FJbz0Awy6qmT3QmdGjZ7hqx+nmo9NYeADyQmkvTlexu1MaK6fo+D 1dml7L4fVrf6eFv/SRiq5HDJXch86zWXDupHZr+7BJm1WlQm7QIlj9drTe6ueFLdDojs Pmg6HLpWMDdaIt98hCmsx4FC7DviRMrKtqAjMEQjYX4a/KK6xTb3HtWZbRzNRBvW8ibR kA544h9Noi76EKb3DYnbZ4CC/qyEeX6L3K+gtRdCfkXaNXT0WjgxrIepW1Fto/ZwuuVU HWYm9J2UT+upQDqFHrUm1vDOdJJYgXOYT4CcPfAZrjiidw1cFW1sIEXt/rAsd2BcORbB 5ZiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=SMFJssIZXhLnm2b/SJ9txM3Xwe7fgdpMRHIK3zKr9RU=; b=sEW3PVdCaGriXqpl686CgqFqfC7YKoK1GXfgyszbEjVdqCkJYvkKP6eVFaxQ5JUZPv ndl2bdEf4ge+B8qsRlGQg3MtgcgwRlZ9H38qYPK+r4jJ3eJIzTDYmnHo25XFwnznnTxL AUoTYfkSPuoSgoo0BeMplDZlxZ9BF9YYOeUnKarcXTCWTuRCnsHcyoHfhzFT4W9us298 q98WFCq/kqemUorXp+5/YHY0wqpBsqIXfRbOfL9bK7VtCL3/TqwBF39O61qIO8l49hGP 7OPmH+Lw29s676rPKvnBioMB0FHoHatpw4Wg3zsmA/7mXvbJNUsQj5+C5jQhpki4n6Rt Mntg== X-Gm-Message-State: AMCzsaU5kUW7NdfLRKPxEhR6vld4Bd4ghiGnsfhaj2n9WCv1xaigj1c0 P3AB8mZe5V4XW6CYveVcIX+BBA== X-Google-Smtp-Source: ABhQp+QSCAiavDyAHOC4TPeydD86q3ggTzi2DuCi98TiIbImPDH4Q9sgH4PdN2ZBJUSMNvCvHYglfQ== X-Received: by 10.36.34.11 with SMTP id o11mr12386160ito.70.1508129995111; Sun, 15 Oct 2017 21:59:55 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id b190sm3126771ioe.1.2017.10.15.21.59.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Oct 2017 21:59:54 -0700 (PDT) In-Reply-To: <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> (Paul Rankin's message of "Mon, 16 Oct 2017 13:22:00 +1000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:138497 Archived-At: Paul Rankin writes: > Because this doesn=E2=80=99t work. If it did I wouldn=E2=80=99t be postin= g it. Think about it; > your mode updates the display on its own without notifying Emacs. The bas= ic > conceptual problem is that =E2=80=9Cevery time you need the value=E2=80= =9D is predicated on when > display-line-numbers-mode changes the value. There=E2=80=99s no way for a= nother lisp > program to know when that is. I agree that Emacs should present a way to specify width that automatically takes line numbers into account. > Function featurep is enough to know if display-line-numbers is present (as > above). Actually, I'd recommend (boundp 'display-line-numbers), since the feature `display-line-numbers' isn't loaded automatically in Emacs. It should be noted that `display-line-numbers-mode' is just a minor mode wrapper around the variable `display-line-numbers', which actually does the work. This also means that the hook `display-line-numbers-hook' isn't actually enough to determine whether or not line numbers have been toggled (since one can just toggle the variable instead). I'd say its main use is in user configurations. To see if line numbers are present in a buffer (and to make it compatible with older Emacsen), you should use something like: (bound-and-true-p display-line-numbers)