From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#25506: 26.0.50; Buffer-menu-bury gets (void-variable tabulated-list--near-rows) Date: Sun, 22 Jan 2017 14:28:20 +0900 Message-ID: <87h94rmznv.fsf@gmail.com> References: <22659.49630.215179.756533@gargle.gargle.HOWL> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485062974 6931 195.159.176.226 (22 Jan 2017 05:29:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Jan 2017 05:29:34 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 25506@debbugs.gnu.org To: Bob Rogers Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 22 06:29:27 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 1cVAiH-00084S-2I for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jan 2017 06:29:13 +0100 Original-Received: from localhost ([::1]:34504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVAiI-0000NN-Vy for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jan 2017 00:29:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVAiB-0000NH-Bu for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2017 00:29:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVAi6-0001Lv-F5 for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2017 00:29:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cVAi6-0001LU-AZ for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2017 00:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cVAi5-0005Qu-SQ for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2017 00:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jan 2017 05:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25506 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25506-submit@debbugs.gnu.org id=B25506.148506291320848 (code B ref 25506); Sun, 22 Jan 2017 05:29:01 +0000 Original-Received: (at 25506) by debbugs.gnu.org; 22 Jan 2017 05:28:33 +0000 Original-Received: from localhost ([127.0.0.1]:37906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVAhd-0005QC-Cx for submit@debbugs.gnu.org; Sun, 22 Jan 2017 00:28:33 -0500 Original-Received: from mail-pg0-f68.google.com ([74.125.83.68]:35841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVAha-0005Px-6h for 25506@debbugs.gnu.org; Sun, 22 Jan 2017 00:28:31 -0500 Original-Received: by mail-pg0-f68.google.com with SMTP id 75so10587921pgf.3 for <25506@debbugs.gnu.org>; Sat, 21 Jan 2017 21:28:30 -0800 (PST) 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; bh=8+a+h1WGq9TqjBMuHhuggpnxbasoiIJs+sGRBerKx8U=; b=DuZ6eO9b/obsJ0qUkvOI/0zLB5OsWlDXpwN5BcuNW8GGHX7KQE4iYPQoGZQiZyhR4t l1rxzLPLQ3U0bQltTLSR0BWw3VVMOK2o7+JSsfWO1z9l0r0I+gyJZ+LzPw0mwa+K6R6/ G6ea/Lm7ZJKkixyCLkzXCc5gePzUuzBIjaHYk7fGtcL+00a/C1+KaLX62q9phLpEaPoI olwL71Jfj2BRMpXWV887iGRhf3v28vC4T7boasXEoVJl765eorgCcovQ84CAQVnGcqf8 3TddUDV5DkFkHf2rjdKoDtyoc0rQG3OG0ugla77QCqpaft+vrqMxJgZhhNImeIsZ2wCE Acvw== 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; bh=8+a+h1WGq9TqjBMuHhuggpnxbasoiIJs+sGRBerKx8U=; b=n9Z4ygQTh44s/k5ObZqTmb4Kj8/T1x7/UJaEGJK23jQQZJ1CWWA/dGiKh+/C7AuulI Qg1npPzlD3GvLnBzC/Y0nkofFlnfT/BtGneQJjeMlgntXcuiQBFXGm7F+WDED2KXYxdq Ki2DqfEacWL+F+28hj8CeXxJ0XrZ97wrdbyq6HK6JDf5yHl90fshAKTayvG7dE3Fd7ch ghHVffP8HUDF9RZcefmDJpqNqoWW/1g+u60KFjMyxVevK6Qo7kZKDs30Hd8U1hxfIqcw Cha9zIBlhcH9l4DbEiISnsXT+8FP2LuTwDhrKHu6alAnRDmP7hSRGKDzgaRqXp9g4BW+ Lqbg== X-Gm-Message-State: AIkVDXLXOw6dJ7Kf1k4eLmYYTHN++pTYNnRfqIzttw4KfTq6B7A4gTAp2FnZvCMRlI8oJA== X-Received: by 10.99.245.21 with SMTP id w21mr25688253pgh.117.1485062904253; Sat, 21 Jan 2017 21:28:24 -0800 (PST) Original-Received: from calancha-pc (33.94.100.220.dy.bbexcite.jp. [220.100.94.33]) by smtp.gmail.com with ESMTPSA id b83sm27393403pfe.12.2017.01.21.21.28.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Jan 2017 21:28:23 -0800 (PST) In-Reply-To: <22659.49630.215179.756533@gargle.gargle.HOWL> (Bob Rogers's message of "Sat, 21 Jan 2017 15:17:34 -0500") 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:128308 Archived-At: Bob Rogers writes: > This has been happening for a while now in master, but not in the > 25.1 release. To reproduce: > > 1. emacs -Q > > 2. "C-x C-b" (which shows the buffer menu with *scratch* and > *Messages* in a new window), and "C-x o" (which moves the cursor into > this window in front of *scratch*). > > 3. "b" to invoke Buffer-menu-bury. The line with the *scratch* > buffer should move below *Messages*; instead, it is erased and only > partly redrawn in the new location, and the error message "Symbol s > value as variable is void: tabulated-list--near-rows" is displayed. Thank you very much for report this bug! Such `tabulated-list--near-rows' must be bound before a call to `tabulated-list-print-col', because the latter use the former via `tabulated-list--col-local-max-widths'. > The patch below restores the expected behavior, but it's a kludge to > require buff-menu.el to know so much about tabulated-list.el innards. I agree with you. The variable `tabulated-list--near-rows' is intended just for internal use in tabulated-list.el. I am going to apply the following patch: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From ade0652cc2a7103cd910accda8165ff8ee7c719f Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sun, 22 Jan 2017 14:23:45 +0900 Subject: [PATCH] Prevent to use tabulated-list--near-rows unbound * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Make sure 'tabulated-list--near-rows' is bound before use it (Bug#25506). --- lisp/emacs-lisp/tabulated-list.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index eadf79ffd4..b6b49b1bfa 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -412,8 +412,13 @@ tabulated-list-print-entry (inhibit-read-only t)) (if (> tabulated-list-padding 0) (insert (make-string x ?\s))) - (dotimes (n ncols) - (setq x (tabulated-list-print-col n (aref cols n) x))) + (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506). + (or (bound-and-true-p tabulated-list--near-rows) + (list (or (tabulated-list-get-entry (point-at-bol 0)) + cols) + cols)))) + (dotimes (n ncols) + (setq x (tabulated-list-print-col n (aref cols n) x)))) (insert ?\n) ;; Ever so slightly faster than calling `put-text-property' twice. (add-text-properties -- 2.11.0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.6) of 2017-01- Repository revision: ad29e145b16cf2966e3a9df884cbc234f1ae3e51