From fd3d8610b27e26107ba15070aba0d488152f8f4d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 20 Oct 2017 12:36:12 +0300 Subject: Make :align-to account for display-line-numbers These changes also update the various bundled packages to use new feature, and better support customizations of the line-number face. * src/xdisp.c (calc_pixel_width_or_height): Improve commentary. Make :align-to count from the end of the line-number display when the offset or the width form reference that of the text area. (Bug#28855) * src/indent.c (Fline_number_display_width): Implement support for the PIXELWISE argument being 'columns'. Update the doc string. (syms_of_indent): New symbol 'columns'. * lisp/ruler-mode.el (ruler-mode-window-col, ruler-mode-ruler): Call line-number-display-width with last argument 'columns'. * lisp/proced.el (proced-header-line): Call line-number-display-width with 2nd arg 'columns', which also fixes a problem when display-line-numbers is nil. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): Call line-number-display-width with 2nd arg 'columns. (tabulated-list-entry-lnum-width): Remove unneeded defvar. (tabulated-list-print, tabulated-list-print-entry): No need to account for the value of tabulated-list-entry-lnum-width. (tabulated-list--current-lnum-width): New defvar. (tabulated-list-watch-line-number-width): New function. (tabulated-list-mode): Bind tabulated-list--current-lnum-width locally, and set up tabulated-list-watch-line-number-width as pre-redisplay-functions hook. * doc/lispref/display.texi (Size of Displayed Text): Document the 'columns' value of the PIXELWISE argument. (Pixel Specification): Update and improve the documentation of the supported forms. --- lisp/proced.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/proced.el') diff --git a/lisp/proced.el b/lisp/proced.el index c9e851b7e05..aec54b59211 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -604,7 +604,8 @@ Important: the match ends just after the marker.") "Return header line for Proced buffer." (list (propertize " " 'display - (list 'space :align-to (+ 2 (line-number-display-width)))) + (list 'space :align-to + (line-number-display-width 'columns))) (if (<= (window-hscroll) (length proced-header-line)) (replace-regexp-in-string ;; preserve text properties "\\(%\\)" "\\1\\1" -- cgit v1.2.3