* 23.0.50; Cannot run calculator on TTY
@ 2007-10-01 2:35 raman
2007-10-01 6:16 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: raman @ 2007-10-01 2:35 UTC (permalink / raw)
To: emacs-pretest-bug
I can no longer run M-x calculator with emacs running on the
Linux console (outside X).
Error I get is:
ad-Orig-split-window-vertically: Window height 2 too small (after
splitting)
Here is a backtrace:
ad-Orig-split-window-vertically: Window height 2 too small (after splitting)
Debugger entered--Lisp error: (error "Window height 2 too small (after splitting)")
split-window(nil 10)
ad-Orig-split-window-vertically(-2)
split-window-vertically(-2)
ad-Orig-calculator()
calculator()
call-interactively(calculator)
execute-extended-command(nil)
call-interactively(execute-extended-command)
In GNU Emacs 23.0.50.26 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
of 2007-09-27 on labrador
configured using `configure '--prefix=/usr/local' '--with-gtk' '--with-gpm' '--with-rsvg' '--with-png' '--with-jpeg' '--with-gif''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8
default-enable-multibyte-characters: nil
Major mode: VM
Minor modes in effect:
erc-menu-mode: t
erc-autojoin-mode: t
erc-ring-mode: t
erc-pcomplete-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-stamp-mode: t
erc-netsplit-mode: t
erc-track-mode: t
erc-track-minor-mode: t
erc-match-mode: t
jabber-activity-mode: t
erc-irccontrols-mode: t
erc-noncommands-mode: t
erc-readonly-mode: t
dynamic-completion-mode: t
dired-omit-mode: t
shell-dirtrack-mode: t
savehist-mode: t
display-time-mode: t
desktop-save-mode: t
auto-insert-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
auto-compression-mode: t
Recent input:
RET c d SPC a f g h a n RET w g e t SPC C-y RET m v
SPC b o TAB m o n . r a m RET C-x C-f m o RET ESC <
ESC [ [ D ESC > c u r l SPC C-y C-e e ESC b ESC b C-d
C-d C-d t u e C-e C-e SPC > SPC t u e . r a m RET ESC
p C-e e ESC b ESC b C-k ESC b ESC b C-k w e d . r p
m SPC > SPC w e d . r a m RET ESC p C-e C-e ESC b ESC
b ESC b ESC b C-k t h u . r p m SPC > SPC t h u . r
a m RET ESC p ESC p C-e C-e ESC b ESC b ESC b ESC b
C-k f r i . r p m SPC > SPC f r i . r a m RET f o r
SPC i SPC i n SPC * . r a m RET d o SPC RET r a m p
3 DEL DEL DEL m 2 p m DEL DEL m p 3 SPC $ i RET d o
n e RET C-e m C-x @ h m ESC C-s q C-e x m ESC m SPC
ESC g RET 1 RET N k k k k k k ' V S C-e m N n P j '
n j ' n j ' ESC c q n k k k ESC x c a l c u l TAB RET
C-e a ESC x r e o DEL DEL DEL r e p o r t SPC e m TAB
b TAB RET
Recent messages:
Decoding MIME message...
Decoding quoted-printable... done
Wrote /tmp/vm-pgg-signature5850T9K
Decoding MIME message... done
Hid 17 citation lines
All messages have been marked as deleted.
Expunging...
Decoding MIME message... done
Deleted messages expunged.
nil
ad-Orig-split-window-vertically: Window height 2 too small (after splitting)
--
Best Regards,
--raman
Email: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-01 2:35 23.0.50; Cannot run calculator on TTY raman
@ 2007-10-01 6:16 ` martin rudalics
2007-10-01 13:17 ` T. V. Raman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-01 6:16 UTC (permalink / raw)
To: T. V. Raman; +Cc: emacs-pretest-bug
> I can no longer run M-x calculator with emacs running on the
> Linux console (outside X).
> Error I get is:
> ad-Orig-split-window-vertically: Window height 2 too small (after
> splitting)
>
> Here is a backtrace:
> ad-Orig-split-window-vertically: Window height 2 too small (after splitting)
>
> Debugger entered--Lisp error: (error "Window height 2 too small (after splitting)")
> split-window(nil 10)
> ad-Orig-split-window-vertically(-2)
> split-window-vertically(-2)
> ad-Orig-calculator()
> calculator()
> call-interactively(calculator)
> execute-extended-command(nil)
> call-interactively(execute-extended-command)
What do the "ad-Orig-..." do? What is the value of `window-min-height'
when they attempt to split the window?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-01 6:16 ` martin rudalics
@ 2007-10-01 13:17 ` T. V. Raman
2007-10-01 15:41 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: T. V. Raman @ 2007-10-01 13:17 UTC (permalink / raw)
To: rudalics; +Cc: emacs-pretest-bug, raman
Apologies about the Ad-orig -- that's because everything has been
advised by Emacspeak.
window-min-height is 4 -- I've not changed it.
>>>>> "martin" == martin rudalics <rudalics@gmx.at> writes:
>> I can no longer run M-x calculator with emacs running on
>> the Linux console (outside X). Error I get is:
>> ad-Orig-split-window-vertically: Window height 2 too small
>> (after splitting)
>>
>> Here is a backtrace: ad-Orig-split-window-vertically:
>> Window height 2 too small (after splitting)
>>
>> Debugger entered--Lisp error: (error "Window height 2 too
>> small (after splitting)") split-window(nil 10)
>> ad-Orig-split-window-vertically(-2)
>> split-window-vertically(-2) ad-Orig-calculator()
>> calculator() call-interactively(calculator)
>> execute-extended-command(nil)
>> call-interactively(execute-extended-command)
martin>
martin> What do the "ad-Orig-..." do? What is the value of
martin> `window-min-height' when they attempt to split the
martin> window?
--
Best Regards,
--raman
Email: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-01 13:17 ` T. V. Raman
@ 2007-10-01 15:41 ` martin rudalics
2007-10-02 3:13 ` T. V. Raman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-01 15:41 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> Apologies about the Ad-orig -- that's because everything has been
> advised by Emacspeak.
I understand. The problem is that apparently
ad-Orig-calculator()
wants to do
split-window-vertically(-2)
which eventually has `split-window' complain. If you bind
`window-min-height' to 2 around this the complaints should go away,
hopefully.
> window-min-height is 4 -- I've not changed it.
Did you change it earlier?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-01 15:41 ` martin rudalics
@ 2007-10-02 3:13 ` T. V. Raman
2007-10-02 7:32 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: T. V. Raman @ 2007-10-02 3:13 UTC (permalink / raw)
To: rudalics; +Cc: emacs-pretest-bug, raman
>>>>> "martin" == martin rudalics <rudalics@gmx.at> 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: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-02 3:13 ` T. V. Raman
@ 2007-10-02 7:32 ` martin rudalics
2007-10-02 13:23 ` T. V. Raman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-02 7:32 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> 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.
-2 is not bizarre. It's purpose is to give the calculator window 2
lines.
> 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
The binding of `window-min-height' is here to avoid that `split-window'
complains about too small windows.
> ;; If the modeline might interfere with the calculator buffer,
> ;; use 3 lines instead.
> (if (and (fboundp 'face-attr-construct)
...
All this shouldn't bother us since we already know that we get the
standard value -2 here.
...
> -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.
Hence we seem to be left with the fact that your configuration has
(let ((split-window-keep-point nil)
(window-min-height 2))
(split-window-vertically -2))
fail for some reason. Could you please verify by evaluating that form?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-02 7:32 ` martin rudalics
@ 2007-10-02 13:23 ` T. V. Raman
2007-10-02 17:51 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: T. V. Raman @ 2007-10-02 13:23 UTC (permalink / raw)
To: rudalics; +Cc: emacs-pretest-bug, raman
martin> Hence we seem to be left with the fact that your
martin> configuration has
martin>
martin> (let ((split-window-keep-point nil)
martin> (window-min-height 2)) (split-window-vertically -2))
martin>
martin> fail for some reason. Could you please verify by
martin> evaluating that form?
The form that computes the argument to split-window-vertically
martin> (shown below)
evaluates to -2 in my environment.
(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)
--
Best Regards,
--raman
Email: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-02 13:23 ` T. V. Raman
@ 2007-10-02 17:51 ` martin rudalics
2007-10-03 1:49 ` T. V. Raman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-02 17:51 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> The form that computes the argument to split-window-vertically
> martin> (shown below)
> evaluates to -2 in my environment.
Sorry, my question was formulated badly. I wanted to know what happens
when you evaluate the form below in your environment:
(let ((split-window-keep-point nil)
(window-min-height 2))
(split-window-vertically -2))
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-02 17:51 ` martin rudalics
@ 2007-10-03 1:49 ` T. V. Raman
2007-10-03 6:21 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: T. V. Raman @ 2007-10-03 1:49 UTC (permalink / raw)
To: rudalics; +Cc: emacs-pretest-bug, raman
>>>>> "martin" == martin rudalics <rudalics@gmx.at> writes:
martin> Sorry, my question was formulated badly. I wanted to
martin> know what happens when you evaluate the form below in
martin> your environment:
martin>
martin> (let ((split-window-keep-point nil)
martin> (window-min-height 2)) (split-window-vertically -2))
Raises the same error as raised by calling M-x calculator shown
martin> earlier, so we've narrowed it down.
I also get the same error if I just evaluate
(split-window-vertically -2) in my environment.
Works if I pass -3
--
Best Regards,
--raman
Email: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-03 1:49 ` T. V. Raman
@ 2007-10-03 6:21 ` martin rudalics
[not found] ` <18179.41840.532732.664369@gargle.gargle.HOWL>
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-03 6:21 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> martin> Sorry, my question was formulated badly. I wanted to
> martin> know what happens when you evaluate the form below in
> martin> your environment:
> martin>
> martin> (let ((split-window-keep-point nil)
> martin> (window-min-height 2)) (split-window-vertically -2))
> Raises the same error as raised by calling M-x calculator shown
> martin> earlier, so we've narrowed it down.
> I also get the same error if I just evaluate
> (split-window-vertically -2) in my environment.
> Works if I pass -3
>
This means something's wrong with your `split-window'. C-x C-e gets me
for
(let ((window-min-height 2))
(split-window-vertically -3))
=> Make a two lines window at bottom
(split-window-vertically -3)
=> Lisp error: (error "Window height 3 too small (after splitting)")
(let ((window-min-height 2))
(split-window-vertically -2))
=> Make a one line window at bottom
(split-window-vertically -2)
=> Lisp error: (error "Window height 2 too small (after splitting)")
which is the expected behavior. Your behavior is wrong because
(let ((window-min-height 2))
(split-window-vertically -2))
should not_raise an error while
(split-window-vertically -3)
should. My build is Emacs 22.1 with a few modifications. Maybe
something changed since then.
Can you run `split_window' with GDB and find out why it fails?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
[not found] ` <18187.33374.913139.901742@gargle.gargle.HOWL>
@ 2007-10-09 17:07 ` martin rudalics
2007-10-11 4:21 ` T. V. Raman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-09 17:07 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> I finally isolated the cause of this problem.
Fine.
> In short, if a buffer has a header-line set i.e. non-nil value
> for header-line-format,
> then launching calculator there boms with the error shown
> earlier.
>
> Specifically, compare the following two forms:
> ;;; no error:
> (let ((header-line-format nil)
> (window-min-height 2))
> (split-window-vertically -2))
>
>
> ;;; Errors:
> (let ((header-line-format "Foo")
> (window-min-height 2))
> (split-window-vertically -2))
>
> Basically when header-line-format is set, the smallest window
> you can make needs 3 lines.
When you're splitting windows, yes.
>
> The fix might be to set header-line-format to nil in the
> top-level let form in calculator.
Alternatively we could do something like
(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*
...
(plist-get (face-attr-construct 'modeline) :overline)))
-3 -2)
(if header-line-format 1 0))))
in calculator. The problem is that `calculator' should do all those
fancy calculations it does for the mode-line for the header-line too.
What do you prefer? Is a header-line of any use for calculator?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-09 17:07 ` martin rudalics
@ 2007-10-11 4:21 ` T. V. Raman
2007-10-11 8:50 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: T. V. Raman @ 2007-10-11 4:21 UTC (permalink / raw)
To: rudalics; +Cc: emacs-pretest-bug, raman
For something like the calculator that wants to claim as small a
window as possible, I would guess that the header line is not too
useful, especially since it has a modeline.
>>>>> "martin" == martin rudalics <rudalics@gmx.at> writes:
>> I finally isolated the cause of this problem.
martin> Fine.
martin>
>> In short, if a buffer has a header-line set i.e. non-nil
>> value for header-line-format, then launching calculator
>> there boms with the error shown earlier.
>>
>> Specifically, compare the following two forms: ;;; no
>> error: (let ((header-line-format nil) (window-min-height
>> 2)) (split-window-vertically -2))
>>
>>
>> ;;; Errors: (let ((header-line-format "Foo")
>> (window-min-height 2)) (split-window-vertically -2))
>>
>> Basically when header-line-format is set, the smallest
>> window you can make needs 3 lines.
martin>
martin> When you're splitting windows, yes.
martin>
>>
> The fix might be to set header-line-format to nil in the
>> top-level let form in calculator.
martin>
martin> Alternatively we could do something like
martin>
martin> (select-window (split-window-vertically ;; If the
martin> modeline might interfere with the calculator buffer,
martin> ;; use 3 lines instead. (- (if (and (fboundp
martin> 'face-attr-construct) (let* ... (plist-get
martin> (face-attr-construct 'modeline) :overline))) -3 -2)
martin> (if header-line-format 1 0))))
martin>
martin> in calculator. The problem is that `calculator'
martin> should do all those fancy calculations it does for
martin> the mode-line for the header-line too. What do you
martin> prefer? Is a header-line of any use for calculator?
martin>
--
Best Regards,
--raman
Email: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-11 4:21 ` T. V. Raman
@ 2007-10-11 8:50 ` martin rudalics
2007-10-11 13:30 ` T. V. Raman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-11 8:50 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> For something like the calculator that wants to claim as small a
> window as possible, I would guess that the header line is not too
> useful, especially since it has a modeline.
There should be no problem doing
((not (get-buffer-window calculator-buffer))
(let ((split-window-keep-point nil)
(window-min-height 2))
(setq header-line-format nil)
in `calculator'.
I wonder, however, why `header-line-format' has a non-nil value in the
first place. Do you have an advice creating a header line for all sorts
of windows?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-11 8:50 ` martin rudalics
@ 2007-10-11 13:30 ` T. V. Raman
2007-10-12 9:23 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: T. V. Raman @ 2007-10-11 13:30 UTC (permalink / raw)
To: rudalics; +Cc: emacs-pretest-bug, raman
In the emacspeak environment, I've set header-line-format to
either show just the buffer name or in case of things like my
alsaplayer interface, to show the title of the song that is
playing.
In info mode, I use the default behavior of using the header
line to show the node information.
In general, the header-line is one of my more favorite features
in newer emacsuns since it lets me squirrel away summary
information in a
manner that gets automatically updated.
>>>>> "martin" == martin rudalics <rudalics@gmx.at> writes:
>> For something like the calculator that wants to claim as
>> small a window as possible, I would guess that the header
>> line is not too useful, especially since it has a
>> modeline.
martin>
martin> There should be no problem doing
martin>
martin> ((not (get-buffer-window calculator-buffer))
martin> (let ((split-window-keep-point nil)
martin> (window-min-height 2)) (setq header-line-format nil)
martin>
martin> in `calculator'.
martin>
martin> I wonder, however, why `header-line-format' has a
martin> non-nil value in the first place. Do you have an
martin> advice creating a header line for all sorts of
martin> windows?
--
Best Regards,
--raman
Email: raman@users.sf.net
WWW: http://emacspeak.sf.net/raman/
AIM: emacspeak GTalk: tv.raman.tv@gmail.com
PGP: http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC: irc://irc.freenode.net/#emacs
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-11 13:30 ` T. V. Raman
@ 2007-10-12 9:23 ` martin rudalics
2007-10-13 0:18 ` Richard Stallman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-12 9:23 UTC (permalink / raw)
To: raman; +Cc: emacs-pretest-bug
> In the emacspeak environment, I've set header-line-format to
> either show just the buffer name or in case of things like my
> alsaplayer interface, to show the title of the song that is
> playing.
> In info mode, I use the default behavior of using the header
> line to show the node information.
>
> In general, the header-line is one of my more favorite features
> in newer emacsuns since it lets me squirrel away summary
> information in a
> manner that gets automatically updated.
Presently, `split-window' has a problem with mode/header lines and small
heights (presumably also with scroll-bars and fringes). To check
whether all windows are large enough after splitting it must make an
assumption about the presence of these on the new window. It currently
bases its judgments on the appearance of the window that shall be split.
This is obviously wrong in your calculator example: You probably have a
header line on the existing window and `split-window' assumes that you
want a header line for the calculator window too.
I'm not sure how `split-window' should handle this:
(1) Use worst-case assumptions (all windows get scroll-bars, header
lines, ...).
(2) Use assumptions based on default values.
(3) Provide explicit (optional) parameters for `split-window-vertically'
and `split-window-horizontally'.
(4) Have functions like `calculator' split the window first and
adjust it afterwards (probably using `fit-window-to-buffer').
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-12 9:23 ` martin rudalics
@ 2007-10-13 0:18 ` Richard Stallman
2007-10-13 9:02 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2007-10-13 0:18 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-pretest-bug, raman
Presently, `split-window' has a problem with mode/header lines and small
heights (presumably also with scroll-bars and fringes). To check
whether all windows are large enough after splitting it must make an
assumption about the presence of these on the new window. It currently
bases its judgments on the appearance of the window that shall be split.
Strictly speaking, that is correct. Splitting the window shows the
same buffer in both of the resulting windows, so it is valid if that
buffer could be displayed in both. However, in a larger sense, given
that the aim is to display another window there, this does not really
DTRT.
One idea that occurs to me is that `window-min-height' could count the
header line, if any. That way, the fact that some buffers have header
lines and others don't will not cause any problems for vertical
splitting of windows. In the most usual cases, at least -- but not
in all cases, perhaps.
Another solution would be to pass a two buffers to `split-window',
telling it to select those two buffers, and to calculate based
on the assumption that those buffers will be displayed.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-13 0:18 ` Richard Stallman
@ 2007-10-13 9:02 ` martin rudalics
2007-10-13 19:47 ` Richard Stallman
0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2007-10-13 9:02 UTC (permalink / raw)
To: rms; +Cc: emacs-pretest-bug, raman
> Presently, `split-window' has a problem with mode/header lines and small
> heights (presumably also with scroll-bars and fringes). To check
> whether all windows are large enough after splitting it must make an
> assumption about the presence of these on the new window. It currently
> bases its judgments on the appearance of the window that shall be split.
>
> Strictly speaking, that is correct. Splitting the window shows the
> same buffer in both of the resulting windows, so it is valid if that
> buffer could be displayed in both. However, in a larger sense, given
> that the aim is to display another window there, this does not really
> DTRT.
>
> One idea that occurs to me is that `window-min-height' could count the
> header line, if any.
Do you mean
"One idea that occurs to me is that the `split-window' could NOT count
the header line, if any."
here? That is, change
size = max (window_min_height,
(MIN_SAFE_WINDOW_HEIGHT
+ (WINDOW_WANTS_MODELINE_P (w) ? 1 : 0)
+ (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 )));
to
size = max (window_min_height,
(MIN_SAFE_WINDOW_HEIGHT
+ (WINDOW_WANTS_MODELINE_P (w) ? 1 : 0)));
in `window_min_size_2'? If so I think we should do that and maybe add a
short remark in the doc-string of `split-window' and the Elisp manual.
The only drawback I can think of is that splitting may produce a window
showing a header- and a mode-line only.
> That way, the fact that some buffers have header
> lines and others don't will not cause any problems for vertical
> splitting of windows. In the most usual cases, at least -- but not
> in all cases, perhaps.
>
> Another solution would be to pass a two buffers to `split-window',
> telling it to select those two buffers, and to calculate based
> on the assumption that those buffers will be displayed.
That's what I meant with "provide explicit (optional) parameters for
`split-window-vertically' and `split-window-horizontally'". This would
also mean that the client of these functions (and `split-window') would
have to set the corresponding (buffer-local) variables _before_ calling
these.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-13 9:02 ` martin rudalics
@ 2007-10-13 19:47 ` Richard Stallman
2007-10-26 21:03 ` martin rudalics
0 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2007-10-13 19:47 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-pretest-bug, raman
> One idea that occurs to me is that `window-min-height' could count the
> header line, if any.
Do you mean
"One idea that occurs to me is that the `split-window' could NOT count
the header line, if any."
We may be trying to say the same thing in two ways. Basically, my
idea is that the minimum allowed number of lines in a window -- in
every sense -- would not depend on whether one of those lines
is used as a header line.
This might require changes in redisplay as well
in order to function correctly.
The only drawback I can think of is that splitting may produce a window
showing a header- and a mode-line only.
Yes, that could happen. It might be a lesser problem than the one we
now have. At least it would be comprehensible and would follow a
simple rule.
> That way, the fact that some buffers have header
> lines and others don't will not cause any problems for vertical
> splitting of windows. In the most usual cases, at least -- but not
> in all cases, perhaps.
>
> Another solution would be to pass a two buffers to `split-window',
> telling it to select those two buffers, and to calculate based
> on the assumption that those buffers will be displayed.
That's what I meant with "provide explicit (optional) parameters for
`split-window-vertically' and `split-window-horizontally'". This would
also mean that the client of these functions (and `split-window') would
have to set the corresponding (buffer-local) variables _before_ calling
these.
Then we both had the same idea. If people like this better, it is
fine with me.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: 23.0.50; Cannot run calculator on TTY
2007-10-13 19:47 ` Richard Stallman
@ 2007-10-26 21:03 ` martin rudalics
0 siblings, 0 replies; 19+ messages in thread
From: martin rudalics @ 2007-10-26 21:03 UTC (permalink / raw)
To: rms; +Cc: emacs-pretest-bug, raman
> We may be trying to say the same thing in two ways. Basically, my
> idea is that the minimum allowed number of lines in a window -- in
> every sense -- would not depend on whether one of those lines
> is used as a header line.
Since no one opted for the solution below I checked in a fix to do that.
> That's what I meant with "provide explicit (optional) parameters for
> `split-window-vertically' and `split-window-horizontally'". This would
> also mean that the client of these functions (and `split-window') would
> have to set the corresponding (buffer-local) variables _before_ calling
> these.
>
> Then we both had the same idea. If people like this better, it is
> fine with me.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2007-10-26 21:03 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-01 2:35 23.0.50; Cannot run calculator on TTY raman
2007-10-01 6:16 ` martin rudalics
2007-10-01 13:17 ` T. V. Raman
2007-10-01 15:41 ` martin rudalics
2007-10-02 3:13 ` T. V. Raman
2007-10-02 7:32 ` martin rudalics
2007-10-02 13:23 ` T. V. Raman
2007-10-02 17:51 ` martin rudalics
2007-10-03 1:49 ` T. V. Raman
2007-10-03 6:21 ` martin rudalics
[not found] ` <18179.41840.532732.664369@gargle.gargle.HOWL>
[not found] ` <18187.33374.913139.901742@gargle.gargle.HOWL>
2007-10-09 17:07 ` martin rudalics
2007-10-11 4:21 ` T. V. Raman
2007-10-11 8:50 ` martin rudalics
2007-10-11 13:30 ` T. V. Raman
2007-10-12 9:23 ` martin rudalics
2007-10-13 0:18 ` Richard Stallman
2007-10-13 9:02 ` martin rudalics
2007-10-13 19:47 ` Richard Stallman
2007-10-26 21:03 ` martin rudalics
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).