unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Bob Rogers <rogers@modulargenetics.com>
Cc: 25506@debbugs.gnu.org
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	[thread overview]
Message-ID: <87h94rmznv.fsf@gmail.com> (raw)
In-Reply-To: <22659.49630.215179.756533@gargle.gargle.HOWL> (Bob Rogers's message of "Sat, 21 Jan 2017 15:17:34 -0500")

Bob Rogers <rogers@modulargenetics.com> 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 <tino.calancha@gmail.com>
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






  reply	other threads:[~2017-01-22  5:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21 20:17 bug#25506: 26.0.50; Buffer-menu-bury gets (void-variable tabulated-list--near-rows) Bob Rogers
2017-01-22  5:28 ` Tino Calancha [this message]
2017-01-22  5:33   ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h94rmznv.fsf@gmail.com \
    --to=tino.calancha@gmail.com \
    --cc=25506@debbugs.gnu.org \
    --cc=rogers@modulargenetics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).