emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.0.50; Cannot run calculator on TTY


From: T. V. Raman
Subject: Re: 23.0.50; Cannot run calculator on TTY
Date: Mon, 1 Oct 2007 20:13:46 -0700


>>>>> "martin" == martin rudalics <address@hidden> writes:
    >> Apologies about the Ad-orig -- that's because everything
    >> has been advised by Emacspeak.
    martin> 
    martin> I understand.  The problem is that apparently
    martin> 
    martin>    ad-Orig-calculator()
    martin> 
    martin> wants to do
    martin> 
    martin>    split-window-vertically(-2)

The problem is in the calculator.el code.
My advice is benign --(will attach it here)
but it's the original code, i.e. ad-Orig-calculator that is
ending up with the bizarre -2.
I tried to understand the code in calculator.el that does this
but failed.

Here is the advice I have on calculator:
(defadvice calculator (after emacspeak pre act comp)
  "Speech enable calculator."
  (when (interactive-p)
    (emacspeak-auditory-icon 'open-object)
    (message "Welcome to the pocket calculator.")))

All the above does is to speak a message and play a sound after
the calculator is up.

The problem lines in calculator.el appear to be:
;;; starting on line 734:

(let ((split-window-keep-point nil)
               (window-min-height 2))
           ;; maybe leave two lines for our window because of the normal
           ;; `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)
                      (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))

Notice the call to split-window-vertically above, and the
somewhat complex code that determines the numeric argument being
passed to that call.


    martin> 
    martin> which eventually has `split-window' complain.  If you
    martin> bind `window-min-height' to 2 around this the
    martin> complaints should go away, hopefully.
Not sure what you mean.
I got the code to work by deleting the split-window-vertically
    martin> call in my copy of calculator --which is not
    martin> completely right -- because  
obviously, I then end up with the calculator taking the whole
    martin> screen.

    martin> 
    >> window-min-height is 4 -- I've not changed it.
    martin> 
    martin> Did you change it earlier?
No, I dont touch it.

-- 
Best Regards,
--raman

      
Email:  address@hidden
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: address@hidden
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




reply via email to

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