unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: emacs-devel@gnu.org
Subject: Re: byte-code: Wrong type argument: number-or-marker-p, (+ -21)
Date: Fri, 14 Nov 2003 23:47:21 +0100 (MET)	[thread overview]
Message-ID: <200311142330.hAENUB5p021655@stubby.bodenonline.com> (raw)
In-Reply-To: <m3llql8uv9.fsf@appel.flower> "from Jan Nieuwenhuizen at Nov 12,  2003 04:33:14 pm"

> 
> 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	other threads:[~2003-11-14 22:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12 15:33 byte-code: Wrong type argument: number-or-marker-p, (+ -21) Jan Nieuwenhuizen
2003-11-14 22:47 ` Jan D. [this message]
2003-11-17 10:15   ` FIX: " Jan Nieuwenhuizen
2003-11-17 14:06     ` Kim F. Storm
2003-11-17 13:43       ` Jan Nieuwenhuizen
2003-11-19 13:26         ` Jan Nieuwenhuizen
2003-11-19 17:07           ` Kim F. Storm
2003-11-19 21:07             ` Jan Nieuwenhuizen
2003-11-19 23:46               ` Kim F. Storm
2003-11-20  9:59                 ` FIX#3: " Jan Nieuwenhuizen
2003-11-23 21:32                   ` Jan D.
2003-12-06 16:14                   ` Geometry interpretation change? (was: FIX#3: byte-code: Wrong type argument: number-or-marker-p, (+ -21)) Jan D.
2003-12-07  0:57                     ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200311142330.hAENUB5p021655@stubby.bodenonline.com \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).