comparison lisp/ibuffer.el @ 51074:9765d874366d

(ibuffer-display-summary): New customizable variable. (ibuffer-update-title-and-summary): Respect it.
author John Paul Wallington <jpw@pobox.com>
date Sun, 18 May 2003 18:24:52 +0000
parents c2c47be7d704
children 09f746b0e209
comparison
equal deleted inserted replaced
51073:c088bf2c1f13 51074:9765d874366d
154 (defcustom ibuffer-default-shrink-to-minimum-size nil 154 (defcustom ibuffer-default-shrink-to-minimum-size nil
155 "If non-nil, minimize the size of the Ibuffer window by default." 155 "If non-nil, minimize the size of the Ibuffer window by default."
156 :type 'boolean 156 :type 'boolean
157 :group 'ibuffer) 157 :group 'ibuffer)
158 (defvar ibuffer-shrink-to-minimum-size nil) 158 (defvar ibuffer-shrink-to-minimum-size nil)
159
160 (defcustom ibuffer-display-summary t
161 "If non-nil, summarize Ibuffer columns."
162 :type 'boolean
163 :group 'ibuffer)
159 164
160 (defcustom ibuffer-truncate-lines t 165 (defcustom ibuffer-truncate-lines t
161 "If non-nil, do not display continuation lines." 166 "If non-nil, do not display continuation lines."
162 :type 'boolean 167 :type 'boolean
163 :group 'ibuffer) 168 :group 'ibuffer)
1924 (goto-char (point-max)) 1929 (goto-char (point-max))
1925 (if (get-text-property (1- (point-max)) 'ibuffer-summary) 1930 (if (get-text-property (1- (point-max)) 'ibuffer-summary)
1926 (delete-region (previous-single-property-change 1931 (delete-region (previous-single-property-change
1927 (point-max) 'ibuffer-summary) 1932 (point-max) 'ibuffer-summary)
1928 (point-max))) 1933 (point-max)))
1929 (add-text-properties 1934 (if ibuffer-display-summary
1930 (point) 1935 (add-text-properties
1931 (progn 1936 (point)
1932 (insert "\n") 1937 (progn
1933 (dolist (element format) 1938 (insert "\n")
1934 (insert 1939 (dolist (element format)
1935 (if (stringp element) 1940 (insert
1936 (make-string (length element) ? ) 1941 (if (stringp element)
1937 (let ((sym (car element))) 1942 (make-string (length element) ? )
1938 (let ((min (cadr element)) 1943 (let ((sym (car element)))
1939 ;; (max (caddr element)) 1944 (let ((min (cadr element))
1940 (align (cadddr element))) 1945 ;; (max (caddr element))
1941 ;; Ignore a negative min when we're inserting the title 1946 (align (cadddr element)))
1942 (when (minusp min) 1947 ;; Ignore a negative min when we're inserting the title
1943 (setq min (- min))) 1948 (when (minusp min)
1944 (let* ((summary (if (get sym 'ibuffer-column-summarizer) 1949 (setq min (- min)))
1945 (funcall (get sym 'ibuffer-column-summarizer) 1950 (let* ((summary (if (get sym 'ibuffer-column-summarizer)
1946 (get sym 'ibuffer-column-summary)) 1951 (funcall (get sym 'ibuffer-column-summarizer)
1947 (make-string (length (get sym 'ibuffer-column-name)) 1952 (get sym 'ibuffer-column-summary))
1948 ? ))) 1953 (make-string (length (get sym 'ibuffer-column-name))
1949 (len (length summary))) 1954 ? )))
1950 (if (< len min) 1955 (len (length summary)))
1951 (ibuffer-format-column summary 1956 (if (< len min)
1952 (- min len) 1957 (ibuffer-format-column summary
1953 align) 1958 (- min len)
1954 summary))))))) 1959 align)
1955 (point)) 1960 summary)))))))
1956 `(ibuffer-summary t)))) 1961 (point))
1962 `(ibuffer-summary t)))))
1957 1963
1958 (defun ibuffer-update-mode-name () 1964 (defun ibuffer-update-mode-name ()
1959 (setq mode-name (format "Ibuffer by %s" (if ibuffer-sorting-mode 1965 (setq mode-name (format "Ibuffer by %s" (if ibuffer-sorting-mode
1960 ibuffer-sorting-mode 1966 ibuffer-sorting-mode
1961 "view time"))) 1967 "view time")))