summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2007-02-10 22:25:51 +0000
committerJay Belanger <jay.p.belanger@gmail.com>2007-02-10 22:25:51 +0000
commit0098d2be699960c3d566331429174f8466dd50be (patch)
tree48afa6a41feb92529cd2c87f722859b34ae8b15e /lisp
parentef0dca0c4174651b3d2b98427595c58e093d7c71 (diff)
downloademacs-0098d2be699960c3d566331429174f8466dd50be.tar.gz
(calculator): Adjust previous adjustment.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calculator.el56
1 files changed, 33 insertions, 23 deletions
diff --git a/lisp/calculator.el b/lisp/calculator.el
index a5e527eed20..98fd5634663 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -738,29 +738,39 @@ See the documentation for `calculator-mode' for more information."
;; If the modeline might interfere with the calculator buffer,
;; use 3 lines instead.
(if (and (fboundp 'face-attr-construct)
- ;; 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)))
+ (let* ((dh (plist-get (face-attr-construct 'default) :height))
+ (mf (face-attr-construct 'modeline))
+ (mh (plist-get mf :height)))
+ ;; If the modeline is shorter than the default,
+ ;; stick with 2 lines. (It may be necessary to
+ ;; check how much shorter.)
+ (and
+ (not
+ (or (and (integerp dh)
+ (integerp mh)
+ (< mh dh))
+ (and (numberp mh)
+ (not (integerp mh))
+ (< mh 1))))
+ (or
+ ;; If the modeline is taller than the default,
+ ;; use 3 lines.
+ (and (integerp dh)
+ (integerp mh)
+ (> mh dh))
+ (and (numberp mh)
+ (not (integerp mh))
+ (> mh 1))
+ ;; If the modeline has a box with non-negative line-width,
+ ;; use 3 lines.
+ (let* ((bx (plist-get mf :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))