From 6d11a78b0951d4bda23fb4ea5c3462bc9164ee18 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 11 Feb 2008 18:39:22 +0000 Subject: [PATCH] (ibuffer-header-line-format): New var. (ibuffer-mode): Set it instead of header-line-format. (ibuffer-update): Use it to set header-line-format. --- lisp/ChangeLog | 4 ++++ lisp/ibuffer.el | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e52057bb9b8..7bacad73ca7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2008-02-11 Stefan Monnier + * ibuffer.el (ibuffer-header-line-format): New var. + (ibuffer-mode): Set it instead of header-line-format. + (ibuffer-update): Use it to set header-line-format. + * international/mule-cmds.el (ucs-insert): Inherit surrounding properties like self-insert-command. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 7c6da00cf0f..59f8c96af2e 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -49,6 +49,7 @@ (defvar ibuffer-filter-group-kill-ring) (defvar ibuffer-filter-groups) (defvar ibuffer-filtering-qualifiers) +(defvar ibuffer-header-line-format) (defvar ibuffer-hidden-filter-groups) (defvar ibuffer-inline-columns) (defvar ibuffer-show-empty-filter-groups) @@ -2164,7 +2165,14 @@ If optional arg SILENT is non-nil, do not display progress messages." (ibuffer-shrink-to-fit t) (when ibuffer-shrink-to-minimum-size (ibuffer-shrink-to-fit))) - (ibuffer-forward-line 0)) + (ibuffer-forward-line 0) + ;; I tried to update this automatically from the mode-line-process format, + ;; but changing nil-ness of header-line-format while computing + ;; mode-line-format is asking a bit too much it seems. --Stef + (setq header-line-format + (and ibuffer-use-header-line + ibuffer-filtering-qualifiers + ibuffer-header-line-format))) (defun ibuffer-sort-bufferlist (bmarklist) (let* ((sortdat (assq ibuffer-sorting-mode @@ -2537,14 +2545,14 @@ will be inserted before the group at point." (:eval (if (functionp 'ibuffer-format-qualifier) (mapconcat 'ibuffer-format-qualifier ibuffer-filtering-qualifiers "")))))) - (setq header-line-format - (if ibuffer-use-header-line - ;; Display the part that won't be in the mode-line. - (list* "" mode-name - (mapcar (lambda (elem) - (if (eq (car-safe elem) 'header-line-format) - (nth 2 elem) elem)) - mode-line-process)))) + ;; `ibuffer-update' puts this on header-line-format when needed. + (setq ibuffer-header-line-format + ;; Display the part that won't be in the mode-line. + (list* "" mode-name + (mapcar (lambda (elem) + (if (eq (car-safe elem) 'header-line-format) + (nth 2 elem) elem)) + mode-line-process))) (setq buffer-read-only t) (buffer-disable-undo) -- 2.11.4.GIT