emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/calculator.el,v


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calculator.el,v
Date: Sat, 10 Feb 2007 22:01:25 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Jay Belanger <jpb>      07/02/10 22:01:25

Index: calculator.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calculator.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- calculator.el       21 Jan 2007 03:53:12 -0000      1.23
+++ calculator.el       10 Feb 2007 22:01:25 -0000      1.24
@@ -735,8 +735,32 @@
            ;; `raised' modeline in Emacs 21
            (select-window
             (split-window-vertically
+             ;; If the modeline might interfere with the calculator buffer,
+             ;; use 3 lines instead. 
              (if (and (fboundp 'face-attr-construct)
-                      (plist-get (face-attr-construct 'modeline) :box))
+                      ;; If the modeline is shorter than the default, 
+                      ;; stick with 2 lines.  (It may be necessary to 
+                      ;; check how much shorter.)
+                      (let ((dh (plist-get (face-attr-construct 'default) 
:height))
+                            (mh (plist-get (face-attr-construct 'modeline) 
:height)))
+                        (not
+                         (or (and (integerp dh)
+                                  (integerp mh)
+                                  (< mh dh))
+                             (and (numberp mh)
+                                  (not (integerp mh))
+                                  (< mh 1)))))
+                      (or
+                       ;; If the modeline has a box with non-negative 
line-width,
+                       ;; use 3 lines.
+                       (let* ((bx (plist-get (face-attr-construct 'modeline) 
:box))
+                              (lh (plist-get bx :line-width)))
+                         (and bx
+                              (or 
+                               (not lh)
+                               (> lh 0))))
+                       ;; If the modeline has an overline, use 3 lines.
+                       (plist-get (face-attr-construct 'modeline) :overline)))
                -3 -2)))
            (switch-to-buffer calculator-buffer)))
         ((not (eq (current-buffer) calculator-buffer))




reply via email to

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