emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Jonathan Yavner
Subject: [Emacs-diffs] Changes to emacs/lisp/ses.el
Date: Sun, 02 Feb 2003 14:16:23 -0500

Index: emacs/lisp/ses.el
diff -c emacs/lisp/ses.el:1.1 emacs/lisp/ses.el:1.2
*** emacs/lisp/ses.el:1.1       Sat Sep 28 14:45:54 2002
--- emacs/lisp/ses.el   Sun Feb  2 14:16:23 2003
***************
*** 1605,1631 ****
       (message (error-message-string err))))
    nil) ;Make coverage-tester happy
  
  (defun ses-create-header-string ()
    "Sets up `header-string' as the buffer's header line, based on the
  current set of columns and window-scroll position."
!   (let ((totwidth (- 1 (window-hscroll)))
!       result width result x)
!     (if window-system
!       ;;Leave room for the left-side fringe
!       (push " " result))
      (dotimes (col numcols)
        (setq width    (ses-col-width col)
            totwidth (+ totwidth width 1))
!       (if (= totwidth 2) ;Scrolled so intercolumn space is leftmost
          (push " " result))
!       (when (> totwidth 2)
        (if (> header-row 0)
            (save-excursion
              (ses-goto-print (1- header-row) col)
              (setq x (buffer-substring-no-properties (point)
                                                      (+ (point) width)))
!             (if (>= width (1- totwidth))
!                 (setq x (substring x (- width totwidth -2))))
              (push (propertize x 'face ses-box-prop) result))
          (setq x (ses-column-letter col))
          (push (propertize x 'face ses-box-prop) result)
--- 1605,1647 ----
       (message (error-message-string err))))
    nil) ;Make coverage-tester happy
  
+ (defun ses-header-string-left-offset ()
+   "Number of characters in left fringe and left scrollbar (if any)."
+   (let ((left-fringe    (round (or (frame-parameter nil 'left-fringe) 0)
+                              (frame-char-width)))
+       (left-scrollbar (if (not (eq (frame-parameter nil
+                                                     'vertical-scroll-bars)
+                                    'left))
+                           0
+                         (let ((x (frame-parameter nil 'scroll-bar-width)))
+                           ;;Non-toolkil bar is always 14 pixels?
+                           (unless x (setq x 14))
+                           ;;Always round up
+                           (ceiling x (frame-char-width))))))
+     (+ left-fringe left-scrollbar)))
+ 
  (defun ses-create-header-string ()
    "Sets up `header-string' as the buffer's header line, based on the
  current set of columns and window-scroll position."
!   (let* ((left-offset (ses-header-string-left-offset))
!        (totwidth (- left-offset (window-hscroll)))
!        result width result x)
!     ;;Leave room for the left-side fringe and scrollbar
!     (push (make-string left-offset ? ) result)
      (dotimes (col numcols)
        (setq width    (ses-col-width col)
            totwidth (+ totwidth width 1))
!       (if (= totwidth (+ left-offset 1))
!         ;;Scrolled so intercolumn space is leftmost
          (push " " result))
!       (when (> totwidth (+ left-offset 1))
        (if (> header-row 0)
            (save-excursion
              (ses-goto-print (1- header-row) col)
              (setq x (buffer-substring-no-properties (point)
                                                      (+ (point) width)))
!             (if (>= width (- totwidth left-offset))
!                 (setq x (substring x (- width totwidth left-offset -1))))
              (push (propertize x 'face ses-box-prop) result))
          (setq x (ses-column-letter col))
          (push (propertize x 'face ses-box-prop) result)




reply via email to

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