From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: Emacs Lisp: Problem with nested condition-case and catch in byte compiled code Date: Fri, 15 Nov 2002 10:22:58 -0800 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="============_-1174737913==_ma============" X-Trace: main.gmane.org 1037661914 3983 80.91.224.249 (18 Nov 2002 23:25:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 18 Nov 2002 23:25:14 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18DvGP-00011q-00 for ; Tue, 19 Nov 2002 00:25:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18DvEN-0006hF-00; Mon, 18 Nov 2002 18:23:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18Cl7y-0000ut-00 for help-gnu-emacs@gnu.org; Fri, 15 Nov 2002 13:23:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18Cl7t-0000qE-00 for help-gnu-emacs@gnu.org; Fri, 15 Nov 2002 13:23:36 -0500 Original-Received: from renfield.synergymicro.com ([153.105.4.30] helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 18Cl7s-0000p8-00 for help-gnu-emacs@gnu.org; Fri, 15 Nov 2002 13:23:32 -0500 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id KAA14996 for ; Fri, 15 Nov 2002 10:25:25 -0800 Original-Received: from [198.17.100.22] (G-Hill-Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.9.3/8.8.7) with ESMTP id KAA10245 for ; Fri, 15 Nov 2002 10:28:02 -0800 In-Reply-To: Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3732 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3732 --============_-1174737913==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" A bit more experimentation shows that nesting a catch inside a catch or a condition-case inside a condition-case causes the same problem. I'm beginning to think I must have stumbled across a bug in either the byte compiler or the byte-code interpreter. --Greg At 6:54 PM -0800 11/14/02, Greg Hill wrote: >This one has me stumped. > >Here is my source code: > >----------------------------------------------------------------------------- >(defun cctest () > (interactive) > (catch 'cctest > (message "before condition-case in catch, (interactive-p) = %s" > (interactive-p)) > (condition-case nil > (message "inside condition-case in catch, (interactive-p) = %s" > (interactive-p)) > (error nil)) > (message "after condition-case in catch, (interactive-p) = %s" > (interactive-p))) > > (message "before condition-case after catch, (interactive-p) = %s" > (interactive-p)) > (condition-case nil > (message "inside condition-case after catch, (interactive-p) = %s" > (interactive-p)) > (error nil)) > (message "after condition-case after catch, (interactive-p) = %s" > (interactive-p)) > > (condition-case nil > (progn > (message "before catch in condition-case, (interactive-p) = %s" > (interactive-p)) > (catch 'cctest > (message "inside catch in condition-case, (interactive-p) = %s" > (interactive-p))) > (message "after catch in condition-case, (interactive-p) = %s" > (interactive-p))) > (error nil))) >---------------------------------------------------------------------------- > > >If I load the .el source file and execute cctest interactively, I get: > >------------------------------------------------------- >before condition-case in catch, (interactive-p) = t >inside condition-case in catch, (interactive-p) = t >after condition-case in catch, (interactive-p) = t >before condition-case after catch, (interactive-p) = t >inside condition-case after catch, (interactive-p) = t >after condition-case after catch, (interactive-p) = t >before catch in condition-case, (interactive-p) = t >inside catch in condition-case, (interactive-p) = t >after catch in condition-case, (interactive-p) = t >------------------------------------------------------- > > >If I byte compile, load the .elc, and execute cctest interactively, I get: > >------------------------------------------------------- >before condition-case in catch, (interactive-p) = t >inside condition-case in catch, (interactive-p) = nil >after condition-case in catch, (interactive-p) = t >before condition-case after catch, (interactive-p) = t >inside condition-case after catch, (interactive-p) = t >after condition-case after catch, (interactive-p) = t >before catch in condition-case, (interactive-p) = t >inside catch in condition-case, (interactive-p) = nil >after catch in condition-case, (interactive-p) = t >------------------------------------------------------- > > >There seems to be something special about a call to (interactive-p) >inside a condition-case inside a catch, or inside a catch inside a >condition-case, in byte-compiled code. But for the life of me I >can't imagine what that could be. Anybody have any ideas? > >--Greg --============_-1174737913==_ma============ Content-Type: text/html; charset="us-ascii" Re: Emacs Lisp: Problem with nested condition-case and
A bit more experimentation shows that nesting a catch inside a catch or a condition-case inside a condition-case causes the same problem.

I'm beginning to think I must have stumbled across a bug in either the byte compiler or the byte-code interpreter.

--Greg

At 6:54 PM -0800 11/14/02, Greg Hill wrote:
This one has me stumped.

Here is my source code:

-----------------------------------------------------------------------------
(defun cctest ()
  (interactive)
  (catch 'cctest
    (message "before condition-case in catch, (interactive-p) = %s"
           (interactive-p))
    (condition-case nil
    (message "inside condition-case in catch, (interactive-p) = %s"
        (interactive-p))
      (error nil))
    (message "after condition-case in catch, (interactive-p) = %s"
         (interactive-p)))

  (message "before condition-case after catch, (interactive-p) = %s"
         (interactive-p))
  (condition-case nil
      (message "inside condition-case after catch, (interactive-p) = %s"
               (interactive-p))
    (error nil))
  (message "after condition-case after catch, (interactive-p) = %s"
         (interactive-p))

  (condition-case nil
      (progn
    (message "before catch in condition-case, (interactive-p) = %s"
        (interactive-p))
        (catch 'cctest
    (message "inside catch in condition-case, (interactive-p) = %s"
                  (interactive-p)))
    (message "after catch in condition-case, (interactive-p) = %s"
          (interactive-p)))
    (error nil)))
----------------------------------------------------------------------------


If I load the .el source file and execute cctest interactively, I get:

-------------------------------------------------------
before condition-case in catch, (interactive-p) = t
inside condition-case in catch, (interactive-p) = t
after condition-case in catch, (interactive-p) = t
before condition-case after catch, (interactive-p) = t
inside condition-case after catch, (interactive-p) = t
after condition-case after catch, (interactive-p) = t
before catch in condition-case, (interactive-p) = t
inside catch in condition-case, (interactive-p) = t
after catch in condition-case, (interactive-p) = t
-------------------------------------------------------


If I byte compile, load the .elc, and execute cctest interactively, I get:

-------------------------------------------------------
before condition-case in catch, (interactive-p) = t
inside condition-case in catch, (interactive-p) = nil
after condition-case in catch, (interactive-p) = t
before condition-case after catch, (interactive-p) = t
inside condition-case after catch, (interactive-p) = t
after condition-case after catch, (interactive-p) = t
before catch in condition-case, (interactive-p) = t
inside catch in condition-case, (interactive-p) = nil
after catch in condition-case, (interactive-p) = t
-------------------------------------------------------


There seems to be something special about a call to (interactive-p) inside a condition-case inside a catch, or inside a catch inside a condition-case, in byte-compiled code.  But for the life of me I can't imagine what that could be.  Anybody have any ideas?

--Greg

--============_-1174737913==_ma============--