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: Emacs Lisp: Problem with nested condition-case and catch in byte compiled code Date: Thu, 14 Nov 2002 18:54:17 -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="============_-1174793635==_ma============" X-Trace: main.gmane.org 1037329588 9346 80.91.224.249 (15 Nov 2002 03:06:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 15 Nov 2002 03:06:28 +0000 (UTC) Cc: stan@gnu.org 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 18CWoL-0002QU-00 for ; Fri, 15 Nov 2002 04:06:26 +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 18CWnz-00070c-00; Thu, 14 Nov 2002 22:06:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18CWdV-0001Rn-00 for help-gnu-emacs@gnu.org; Thu, 14 Nov 2002 21:55:13 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18CWdQ-0001RC-00 for help-gnu-emacs@gnu.org; Thu, 14 Nov 2002 21:55:12 -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 18CWdO-0001QQ-00 for help-gnu-emacs@gnu.org; Thu, 14 Nov 2002 21:55:07 -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 SAA09675 for ; Thu, 14 Nov 2002 18:56:58 -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 SAA32403; Thu, 14 Nov 2002 18:59:44 -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:3619 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3619 --============_-1174793635==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" 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 --============_-1174793635==_ma============ Content-Type: text/html; charset="us-ascii" Emacs Lisp: Problem with nested condition-case and cat
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
--============_-1174793635==_ma============--