]> code.delx.au - gnu-emacs/commitdiff
(proced-header-line): Use the :align-to 0 feature
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 May 2008 20:41:55 +0000 (20:41 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 May 2008 20:41:55 +0000 (20:41 +0000)
rather than computing the corresponding position manually.
(proced-update): Don't hardcode point-min==1.

lisp/ChangeLog
lisp/proced.el

index 6f127f600bb7b89e1df135d5cfa20fc4bf5f6fbd..96f7bfeaee7ffe4dd097844ca6e653c1a0539009 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * proced.el (proced-header-line): Use the :align-to 0 feature
+       rather than computing the corresponding position manually.
+       (proced-update): Don't hardcode point-min==1.
+
 2008-05-24  Alan Mackenzie  <acm@muc.de>
 
        * progmodes/cc-mode.el (c-postprocess-file-styles): Throw an error
index 8496b837f81cb3fd586a06de8fdd97617b283c30..0a9827dc5ebc91d2d9f94cce58dd86498edd804c 100644 (file)
@@ -484,10 +484,7 @@ Returns count of hidden lines."
 ;; header line: code inspired by `ruler-mode-ruler'
 (defun proced-header-line ()
   "Return header line for Proced buffer."
-  (list "" (if (eq 'left (car (window-current-scroll-bars)))
-               (proced-header-space 'scroll-bar))
-        (proced-header-space 'left-fringe)
-        (proced-header-space 'left-margin)
+  (list (propertize " " 'display '(space :align-to 0))
         (replace-regexp-in-string
          "%" "%%" (substring proced-header-line (window-hscroll)))))
 
@@ -530,8 +527,9 @@ Returns count of hidden lines."
       (while (re-search-forward "\\([^ \t\n]+\\)[ \t]*\\($\\)?" lep t)
         (push (list (match-string-no-properties 1)
                     ;; take the column number starting from zero
-                    (1- (match-beginning 0)) (or (not (not (match-beginning 2)))
-                                                 (1- (match-end 0)))
+                    (- (match-beginning 0) (point-min))
+                    (or (not (not (match-beginning 2)))
+                        (- (match-end 0) (point-min)))
                     'left)
               proced-header-alist)))
     (let ((temp (regexp-opt (mapcar 'car proced-header-alist) t)))