emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/ruler-mode.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/ruler-mode.el
Date: Fri, 14 Dec 2001 02:54:28 -0500

Index: emacs/lisp/ruler-mode.el
diff -c emacs/lisp/ruler-mode.el:1.3 emacs/lisp/ruler-mode.el:1.4
*** emacs/lisp/ruler-mode.el:1.3        Thu Dec 13 02:55:49 2001
--- emacs/lisp/ruler-mode.el    Fri Dec 14 02:54:28 2001
***************
*** 438,461 ****
    "Right margin %S"
    "Help string shown when mouse is over the right margin area.")
  
! (defun ruler-mode-extra-left-cols ()
!   "Return number of extra columns on the left side of selected frame.
! That is the number of columns occupied by the left fringe area and
! vertical scrollbar on the left side of the selected frame."
!   (let ((w  (frame-first-window))
!         (xy (cons 0 0)))
!     (with-current-buffer (window-buffer w)
!       (let (header-line-format)
!         (while (not (listp (coordinates-in-window-p xy w)))
!           (setcar xy (1+ (car xy))))
!         (car xy)))))
  
  (defun ruler-mode-ruler ()
    "Return a string ruler."
    (if ruler-mode
!       (let* ((j     (ruler-mode-extra-left-cols))
!              (k     (/ (or (frame-parameter nil 'right-fringe) 0)
!                        (frame-char-width)))
               (w     (+ (window-width) j))
               (m     (window-margins))
               (l     (or (car m) 0))
--- 438,472 ----
    "Right margin %S"
    "Help string shown when mouse is over the right margin area.")
  
! (defmacro ruler-mode-left-fringe-cols ()
!   "Return the width, measured in columns, of the left fringe area."
!   '(round (or (frame-parameter nil 'left-fringe) 0)
!           (frame-char-width)))
! 
! (defmacro ruler-mode-right-fringe-cols ()
!   "Return the width, measured in columns, of the right fringe area."
!   '(round (or (frame-parameter nil 'right-fringe) 0)
!           (frame-char-width)))
! 
! (defmacro ruler-mode-left-scroll-bar-cols ()
!   "Return the width, measured in columns, of the left vertical scrollbar."
!   '(if (eq (frame-parameter nil 'vertical-scroll-bars) 'left)
!        (round (or (frame-parameter nil 'scroll-bar-width) 0)
!               (frame-char-width))
!      0))
! 
! (defmacro ruler-mode-right-scroll-bar-cols ()
!   "Return the width, measured in columns, of the right vertical scrollbar."
!   '(if (eq (frame-parameter nil 'vertical-scroll-bars) 'right)
!        (round (or (frame-parameter nil 'scroll-bar-width) 0)
!               (frame-char-width))
!      0))
  
  (defun ruler-mode-ruler ()
    "Return a string ruler."
    (if ruler-mode
!       (let* ((j     (+ (ruler-mode-left-fringe-cols)
!                        (ruler-mode-left-scroll-bar-cols)))
               (w     (+ (window-width) j))
               (m     (window-margins))
               (l     (or (car m) 0))
***************
*** 466,473 ****
                       ;; unit graduations
                       (make-string w ruler-mode-basic-graduation-char)
                       ;; extra space to fill the header line
!                      (make-string k ?\ )))
!              c)
  
          ;; Setup default face and help echo.
          (put-text-property 0 (length ruler)
--- 477,486 ----
                       ;; unit graduations
                       (make-string w ruler-mode-basic-graduation-char)
                       ;; extra space to fill the header line
!                      (make-string (+ (ruler-mode-right-fringe-cols)
!                                      (ruler-mode-right-scroll-bar-cols))
!                                   ?\ )))
!              c k)
  
          ;; Setup default face and help echo.
          (put-text-property 0 (length ruler)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]