Subject: bug#21025: tabulated-list.el: It should preserve header line set by derived modes. (Encl. a suggested PATCH)

From: Vaidheeswaran C <[email-masked]>
Date: Fri, 10 Jul 2015 00:02:09 +0530

tabulated-list.el: It should preserve header line set by derived
modes.  Also some fontification improvements.

1. Load the attached font-family.el.

2. M-x list-font-families.

3. Note that there is no header line when I explicitly request that I
   need a header line @ lines 25, 26 in font-family.el

      (setq tabulated-list-use-header-line nil)
      (setq header-line-format "Font families")

----------------------------------------------------------------

4. Apply the attached patch.

5. See that the header line is preserved (and stays put even when the
   columns are sorted and the buffer is refreshed).

6. Admire the revamped look of header columns.  (See the attached
   screenshot)

----------------------------------------------------------------

edictc.el -- my all new DICT client for Emacs -- uses header lines
when in tabulated list mode.  (See the attached screenshot.)  Btw, the
red strip is coming from whitespace mode.
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 9119c3a..34b46dc 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -241,7 +241,6 @@ Populated by `tabulated-list-init-header'.")
     (setq cols (apply 'concat (nreverse cols)))
     (if tabulated-list-use-header-line
 	(setq header-line-format cols)
-      (setq header-line-format nil)
       (setq-local tabulated-list--header-string cols))))
 
 (defun tabulated-list-print-fake-header ()
@@ -255,7 +254,8 @@ Do nothing if `tabulated-list--header-string' is nil."
           (move-overlay tabulated-list--header-overlay (point-min) (point))
         (setq-local tabulated-list--header-overlay
                     (make-overlay (point-min) (point))))
-      (overlay-put tabulated-list--header-overlay 'face 'underline))))
+      (overlay-put tabulated-list--header-overlay
+                   'face '(:overline t :underline t :weight bold)))))
 
 (defun tabulated-list-revert (&rest ignored)
   "The `revert-buffer-function' for `tabulated-list-mode'.