Mercurial > emacs
comparison lisp/proced.el @ 95286:3680efd5ada2
(proced-header-line): Use the :align-to 0 feature
rather than computing the corresponding position manually.
(proced-update): Don't hardcode point-min==1.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 24 May 2008 20:41:55 +0000 |
parents | a031e38a88d4 |
children | cf89ac5d2869 |
comparison
equal
deleted
inserted
replaced
95285:a4912ef0d32f | 95286:3680efd5ada2 |
---|---|
482 (propertize " " 'display (list 'space :width width))) | 482 (propertize " " 'display (list 'space :width width))) |
483 | 483 |
484 ;; header line: code inspired by `ruler-mode-ruler' | 484 ;; header line: code inspired by `ruler-mode-ruler' |
485 (defun proced-header-line () | 485 (defun proced-header-line () |
486 "Return header line for Proced buffer." | 486 "Return header line for Proced buffer." |
487 (list "" (if (eq 'left (car (window-current-scroll-bars))) | 487 (list (propertize " " 'display '(space :align-to 0)) |
488 (proced-header-space 'scroll-bar)) | |
489 (proced-header-space 'left-fringe) | |
490 (proced-header-space 'left-margin) | |
491 (replace-regexp-in-string | 488 (replace-regexp-in-string |
492 "%" "%%" (substring proced-header-line (window-hscroll))))) | 489 "%" "%%" (substring proced-header-line (window-hscroll))))) |
493 | 490 |
494 (defun proced-update (&optional quiet) | 491 (defun proced-update (&optional quiet) |
495 "Update the `proced' process information. Preserves point and marks." | 492 "Update the `proced' process information. Preserves point and marks." |
528 (setq proced-header-alist nil) | 525 (setq proced-header-alist nil) |
529 ;; FIXME: handle left/right justification properly | 526 ;; FIXME: handle left/right justification properly |
530 (while (re-search-forward "\\([^ \t\n]+\\)[ \t]*\\($\\)?" lep t) | 527 (while (re-search-forward "\\([^ \t\n]+\\)[ \t]*\\($\\)?" lep t) |
531 (push (list (match-string-no-properties 1) | 528 (push (list (match-string-no-properties 1) |
532 ;; take the column number starting from zero | 529 ;; take the column number starting from zero |
533 (1- (match-beginning 0)) (or (not (not (match-beginning 2))) | 530 (- (match-beginning 0) (point-min)) |
534 (1- (match-end 0))) | 531 (or (not (not (match-beginning 2))) |
532 (- (match-end 0) (point-min))) | |
535 'left) | 533 'left) |
536 proced-header-alist))) | 534 proced-header-alist))) |
537 (let ((temp (regexp-opt (mapcar 'car proced-header-alist) t))) | 535 (let ((temp (regexp-opt (mapcar 'car proced-header-alist) t))) |
538 (setq proced-sorting-schemes-re | 536 (setq proced-sorting-schemes-re |
539 (concat "\\`" temp "\\(," temp "\\)*\\'"))) | 537 (concat "\\`" temp "\\(," temp "\\)*\\'"))) |