# HG changeset patch # User John Paul Wallington # Date 1046922713 0 # Node ID cd78fe221607aad520319aaf6f434c483c127cfb # Parent c919f0375a3ec35efd92de85e2f20b340b9370d9 (Buffer-menu-mode-map): Add docstring. (Buffer-menu-buffer): Fix indentation. (list-buffers-noselect): Calculate header-line spacing to take into account width of left fringe and left scrollbar. diff -r c919f0375a3e -r cd78fe221607 lisp/buff-menu.el --- a/lisp/buff-menu.el Thu Mar 06 01:54:17 2003 +0000 +++ b/lisp/buff-menu.el Thu Mar 06 03:51:53 2003 +0000 @@ -96,7 +96,8 @@ (defconst Buffer-menu-buffer-column 4) -(defvar Buffer-menu-mode-map nil "") +(defvar Buffer-menu-mode-map nil + "Local keymap for `Buffer-menu-mode' buffers.") (if Buffer-menu-mode-map () @@ -199,8 +200,8 @@ (error "No buffer named `%s'" name) nil)) (or (and buf (buffer-name buf) buf) - (if error-if-non-existent-p - (error "No buffer on this line") + (if error-if-non-existent-p + (error "No buffer on this line") nil))))) (defun buffer-menu (&optional arg) @@ -556,7 +557,6 @@ (let* ((old-buffer (current-buffer)) (standard-output standard-output) (mode-end (make-string (- Buffer-menu-mode-width 2) ? )) - ;; Fixme: This is wrong for left-hand scroll-bars. (header (concat "CRM " (Buffer-menu-buffer+size "Buffer" "Size") " Mode" mode-end "File\n")) list desired-point name file mode) @@ -639,8 +639,15 @@ (princ "\n")) (Buffer-menu-mode) (when Buffer-menu-use-header-line - (set (make-local-variable 'Buffer-menu-header-line) - (concat " " header)) + (let ((spaces + (/ (+ (or (frame-parameter nil 'left-fringe) 0) + (or (if (eq (frame-parameter nil 'vertical-scroll-bars) + 'left) + (frame-parameter nil 'scroll-bar-width)) + 0)) + (frame-char-width)))) + (set (make-local-variable 'Buffer-menu-header-line) + (concat (make-string spaces ? ) header))) (setq header-line-format 'Buffer-menu-header-line)) ;; DESIRED-POINT doesn't have to be set; it is not when the ;; current buffer is not displayed for some reason.