Function: proced-header-line

proced-header-line is a byte-compiled function defined in proced.el.gz.

Signature

(proced-header-line)

Documentation

Return header line for Proced buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/proced.el.gz
(defun proced-header-line ()
  "Return header line for Proced buffer."
  (let ((base (line-number-display-width 'columns))
        (hl (if (<= (window-hscroll) (length proced-header-line))
                (substring proced-header-line (window-hscroll)))))
    (when hl
      ;; From buff-menu.el: Turn whitespace chars in the header into
      ;; stretch specs so they work regardless of the header-line face.
      (let ((pos 0))
	(while (string-match "[ \t\n]+" hl pos)
	  (setq pos (match-end 0))
	  (put-text-property (match-beginning 0) pos 'display
			     `(space :align-to (,(+ pos base) . width))
			     hl)))
      (setq hl (replace-regexp-in-string ;; preserve text properties
		"\\(%\\)" "\\1\\1"
		hl)))
    (list (propertize " " 'display `(space :align-to (,base . width)))
          hl)))