From 78e9065e9f090ea9c10f89495eab9f8069597b74 Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Fri, 3 Nov 2017 15:49:51 +0200 Subject: * lisp/emacs-lisp/generator.el (iter-do): Add a debug declaration. --- lisp/emacs-lisp/generator.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 410e4edcc92..ef6cfba420c 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -718,7 +718,8 @@ is blocked." "Loop over values from an iterator. Evaluate BODY with VAR bound to each value from ITERATOR. Return the value with which ITERATOR finished iteration." - (declare (indent 1)) + (declare (indent 1) + (debug ((symbolp form) body))) (let ((done-symbol (cps--gensym "iter-do-iterator-done")) (condition-symbol (cps--gensym "iter-do-condition")) (it-symbol (cps--gensym "iter-do-iterator")) -- cgit v1.2.3 From 93818eed8ab9840095911be7b0ca0f2104320ea0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 16:28:25 +0200 Subject: Fix subtle problems in tabulated-list-mode with line numbers * lisp/emacs-lisp/tabulated-list.el (tabulated-list-watch-line-number-width): Call tabulated-list-init-header instead of tabulated-list-revert. (tabulated-list-window-scroll-function): New function. (tabulated-list-mode): Put 'tabulated-list-window-scroll-function' on the buffer-local 'window-scroll-functions' list. --- lisp/emacs-lisp/tabulated-list.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 73ddadfb805..3889ba8e587 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -603,7 +603,16 @@ With a numeric prefix argument N, sort the Nth column." (let ((lnum-width (tabulated-list-line-number-width))) (when (not (= tabulated-list--current-lnum-width lnum-width)) (setq-local tabulated-list--current-lnum-width lnum-width) - (tabulated-list-revert))))) + (tabulated-list-init-header))))) + +(defun tabulated-list-window-scroll-function (window _start) + (if display-line-numbers + (let ((lnum-width + (with-selected-window window + (line-number-display-width 'columns)))) + (when (not (= tabulated-list--current-lnum-width lnum-width)) + (setq-local tabulated-list--current-lnum-width lnum-width) + (tabulated-list-init-header))))) ;;; The mode definition: @@ -654,7 +663,9 @@ as the ewoc pretty-printer." ;; the line-number width needs to change due to scrolling. (setq-local tabulated-list--current-lnum-width 0) (add-hook 'pre-redisplay-functions - #'tabulated-list-watch-line-number-width nil t)) + #'tabulated-list-watch-line-number-width nil t) + (add-hook 'window-scroll-functions + #'tabulated-list-window-scroll-function nil t)) (put 'tabulated-list-mode 'mode-class 'special) -- cgit v1.2.3