diff options
author | Stephen Berman <[email protected]> | 2011-07-19 23:31:26 +0200 |
---|---|---|
committer | Lars Magne Ingebrigtsen <[email protected]> | 2011-07-19 23:31:26 +0200 |
commit | 92e15d10a641b7877b91436ab215acb9d9c16f22 (patch) | |
tree | 0774c6da125d2656a15694e0da57ae250555a7ad | |
parent | 590bd46743151a55ba68a7d211f82b2485c57d3a (diff) |
(proced-format): Make header lines align with the text
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/proced.el | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0699a93ac9..069dbb2922 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Stephen Berman <[email protected]> + + * proced.el (proced-format): Make header lines align with the text + (bug#1779). + 2011-07-19 Lars Magne Ingebrigtsen <[email protected]> * view.el (view-buffer): Allow running in `special' modes if we're diff --git a/lisp/proced.el b/lisp/proced.el index 11598d7350..cc1856060b 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -1509,6 +1509,16 @@ Replace newline characters by \"^J\" (two characters)." (if (string-match "[ \t]+$" proced-header-line) (setq proced-header-line (substring proced-header-line 0 (match-beginning 0)))) + (setq proced-header-line (concat " " proced-header-line)) + ;; 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) + (header proced-header-line)) + (while (string-match "[ \t\n]+" header pos) + (setq pos (match-end 0)) + (put-text-property (match-beginning 0) pos 'display + (list 'space :align-to pos) + header))) ;; (delete-trailing-whitespace) (goto-char (point-min)) (while (re-search-forward "[ \t\r]+$" nil t) @@ -1602,7 +1612,6 @@ After updating a displayed Proced buffer run the normal hook (while (not (eobp)) (insert " ") (forward-line)) - (setq proced-header-line (concat " " proced-header-line)) (if revert (set-buffer-modified-p nil)) ;; set `goal-column' |