Subject: bug#25506: closed (Re: bug#25506: 26.0.50; Buffer-menu-bury gets (void-variable tabulated-list--near-rows))

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 22 Jan 2017 05:34:01 +0000

Your bug report

#25506: 26.0.50; Buffer-menu-bury gets (void-variable tabulated-list--near-rows)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
25506: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25506
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#25506: 26.0.50; Buffer-menu-bury gets (void-variable tabulated-list--near-rows)
From: Tino Calancha <[email-masked]>
To: [email-masked]
Date: Sun, 22 Jan 2017 14:33:31 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Tino Calancha <[email-masked]> writes:

> Bob Rogers <[email-masked]> 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 <[email-masked]>
> 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
Pushed to master branch as commit ade0652cc2a7103cd910accda8165ff8ee7c719f

Subject: 26.0.50; Buffer-menu-bury gets (void-variable tabulated-list--near-rows)
From: Bob Rogers <[email-masked]>
To: [email-masked]
Date: Sat, 21 Jan 2017 15:17:34 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

   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.

   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.

					-- Bob Rogers
					   http://www.rgrjr.com/

------------------------------------------------------------------------
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 77b325f..27a00b9 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -595,7 +595,10 @@ Buffer-menu-bury
 	   (save-excursion
 	     (let ((elt (tabulated-list-delete-entry)))
 	       (goto-char (point-max))
-	       (apply 'tabulated-list-print-entry elt)))
+               (let ((tabulated-list--near-rows
+                       (list
+                         (tabulated-list-get-entry (point-at-bol 0)))))
+                 (apply 'tabulated-list-print-entry elt))))
 	   (message "Buffer buried."))
 	  (t
 	   (tabulated-list-delete-entry)
------------------------------------------------------------------------
In GNU Emacs 26.0.50.1 (x86_64-suse-linux-gnu, GTK+ Version 2.24.31)
 of 2017-01-21 built on orion
Repository revision: 07d15164271270d09464863d7ec2bfce62d65085
Windowing system distributor 'The X.Org Foundation', version 11.0.11601000
System Description:	openSUSE 13.2 (Harlequin) (x86_64)

Recent messages:
Read-Only mode disabled in current buffer
Mark set
Buffer-menu-bury
Buffer buried. [6 times]
Mark set
Auto-saving...
Undo! [14 times]
user-error: No further undo information
Buffer buried. [2 times]
Making completion list... [2 times]

Configured using:
 'configure --without-dbus --without-gsettings --without-gconf'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY GNUTLS FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/suse-start-vm hides /usr/share/emacs/site-lisp/vm/suse-start-vm
/usr/share/emacs/site-lisp/site-start hides /usr/local/share/emacs/site-lisp/site-start
/home/rogers/emacs/imported/loaddefs hides /usr/local/share/emacs/26.0.50/lisp/loaddefs

Features:
(shadow sort mail-extr emacsbug message subr-x puny seq rgr-dired dired
dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils warnings cl-indent misearch
multi-isearch jka-compr vc-git diff-mode easy-mmode debug rgr-diff-hacks
diff rgr-lisp-hacks rgr-elisp-hacks ilisp-possibilities
rgr-abbrev-completion rgr-mouse browse-url ilisp-mouse rgr-x11-hacks
ffap-local-url-patch ffap thingatpt url-parse auth-source password-cache
url-vars rgr-ffap rgr-hacks etags xref cl-seq project eieio byte-opt
bytecomp byte-compile cl-extra help-mode easymenu cconv eieio-core
cl-macs gv eieio-loaddefs cl-loaddefs pcase cl-lib ring time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript case-table
epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote inotify dynamic-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 122441 7102)
 (symbols 48 22686 1)
 (miscs 40 121 311)
 (strings 32 25910 4873)
 (string-bytes 1 813969)
 (vectors 16 17060)
 (vector-slots 8 497386 2281)
 (floats 8 257 266)
 (intervals 56 1147 247)
 (buffers 976 17)
 (heap 1024 25223 1302))