emacs-devel
[Top][All Lists]
Advanced

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

Re: byte-code: Wrong type argument: number-or-marker-p, (+ -21)


From: Jan D.
Subject: Re: byte-code: Wrong type argument: number-or-marker-p, (+ -21)
Date: Fri, 14 Nov 2003 23:47:21 +0100 (MET)

> 
> I want to start my emacs with geometry 80x[full-screen-height], with
> menu-bar and tool-bar disabled.
> 
...
> 
> Then, starting emacs as:
> 
>     emacs --geometry 80x100+0-0&  # too tall for my screen, but ok for testing
> 
> prints this error:
> 
>     byte-code: Wrong type argument: number-or-marker-p, (+ -520)
> 
> After hitting this error emacs exhibits some seemingly unrelated
> problems, such as gud not syncing the src window.
> 
> Running with --debug-init does not help, adding (setq debug-on-error
> t) to ~/.emacs.el yields:
> 
>     Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (+ 
> -21))
>       frame-notice-user-settings()
>       command-line-1(("80x100+0-0"))
>       command-line()
>       normal-top-level()
> 
> however, there is no call to number-or-marker-p in
> frame-notice-user-settings.  I'm confused.

These lines in frame-notice-user-settings triggers the error:
            (let* ...
                   (top (frame-parameter frame-initial-frame 'top)))
              (when (and (consp initial-top) (eq '- (car initial-top)))
                (setq newparms
                      (append newparms
                              `((top . ,(+ top (* lines char-height))))
                              nil)))


When the top of the frame is over the top of the display (i.e. y is negative),
frame-parameter returns a strange value (evaluated in *scratch*):


(frame-parameter (selected-frame) 'top)
(+ -21)

Ditto for left.
This is because of this code in x_report_frame_params:

  /* Represent negative positions (off the top or left screen edge)
     in a way that Fmodify_frame_parameters will understand correctly.  */
  XSETINT (tem, f->left_pos);
  if (f->left_pos >= 0)
    store_in_alist (alistptr, Qleft, tem);
  else
    store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil)));

It has been like this a long time (21.2 at least).  Someone better in lisp
than me can probably fix frame-notice-user-settings so it works ok.
My initial attempt (if (consp top) (car (cdr top)) top) leads to a
serious miscalculation of the top position with your geometry parameter,
the whole frame is over the top.  The bottom of the frame should be on
the bottom of the screen.

        Jan D.





reply via email to

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