[Top][All Lists]

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

Bug in x-create-frame primitive

From: Christopher Neufeld
Subject: Bug in x-create-frame primitive
Date: Sat, 16 Mar 2002 14:47:29 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

I have come across a bug which can prevent elisp programs from opening
new frames successfully.  To reproduce it

run "emacs -q" from with an X session

then, execute the following commands:

M-: (setq text-mode-hook 'turn-on-auto-fill)
M-: (make-frame)

At this point, we drop into the backtrace buffer with the following

Debugger entered--Lisp error: (wrong-type-argument listp turn-on-auto-fill)
  member(turn-on-auto-fill turn-on-auto-fill)
  eval-expression((make-frame) nil)

A workaround, when creating frames within elisp, is to create a
locally scoped variable, text-mode-hook, and assign nil to it.  This
allows the script to execute.  i.e.

(defun ... ()
  (let (new-display text-mode-hook)
    (setq text-mode-hook nil)
    (setq new-display ( ... ))
    (condition-case nil
        (make-frame-on-display new-display)
      (error nil))

The text-mode-hook, if previously assigned, will still work as
intended in the new frame, of course.  It just has to be overridden
within the scope of the x-create-frame call itself.

 Christopher Neufeld                 address@hidden
 Home page:  http://caliban.physics.utoronto.ca/neufeld/Intro.html
 "Don't edit reality for the sake of simplicity"

reply via email to

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