bug-gnu-emacs
[Top][All Lists]
Advanced

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

Fcall_interactively sometimes leaves enable uninitialized


From: Kalle Olavi Niemitalo
Subject: Fcall_interactively sometimes leaves enable uninitialized
Date: 15 Apr 2001 20:57:09 +0300

In GNU Emacs 20.7.1 (i386-pc-linux-gnu, X toolkit)
 of Sun Apr 15 2001 on PC486
configured using `configure  --prefix=/home/kalle 
--exec-prefix=/home/kalle/i386-pc-linux-gnu --host=i386-pc-linux-gnu 
--build=i386-pc-linux-gnu'

Fcall_interactively in src/callint.c leaves the local variable
enable uninitialized if the FUNCTION parameter isn't a symbol.
If the interactive-spec of FUNCTION is a string,
Fcall_interactively then checks the value of the uninitialized
variable and binds `enable-local-minibuffers' to t unless ENABLE
happens to be nil.

As the bug involves an uninitialized variable and doesn't cause a
crash, its existence is easiest to verify with a debugger.  I
could demonstrate it with the steps below, but don't be surprised
if they fail on an Emacs compiled by you.

1. Start Emacs with --no-init-file --no-site-file.

2. Evaluate the following expressions in the *scratch* buffer.

   (setq enable-recursive-minibuffers nil)

   (defun kon-test (x)
     (interactive "nNumber: ")
     x)

   (defun kon-test-1 ()
     (interactive)
     (list 1 2 3)   ; prime the stack
     (call-interactively 'kon-test))

   (defun kon-test-2 ()
     (interactive)
     (list 1 2 3)
     (call-interactively (symbol-function 'kon-test)))

   (global-set-key (kbd "C-c t 1") 'kon-test-1)
   (global-set-key (kbd "C-c t 2") 'kon-test-2)

3. Type M-x C-c t 1.  Emacs gives an "Command attempted to use
   minibuffer while in minibuffer" error, as expected.  Return to
   top level with C-g.

4. Type M-x C-c t 2.  Emacs displays a recursive minibuffer even
   though `enable-recursive-minibuffers' should still be nil.



reply via email to

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