From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: lisp/emacs-lisp/debug.el patch. Date: Wed, 23 Mar 2005 14:14:55 +0100 Message-ID: References: <874qf2bkqg.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111584149 23305 80.91.229.2 (23 Mar 2005 13:22:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2005 13:22:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 23 14:22:28 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DE5oP-0002eq-18 for ged-emacs-devel@m.gmane.org; Wed, 23 Mar 2005 14:22:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DE65u-0003BA-19 for ged-emacs-devel@m.gmane.org; Wed, 23 Mar 2005 08:40:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DE63T-0001M2-FY for emacs-devel@gnu.org; Wed, 23 Mar 2005 08:37:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DE63J-0001J1-Cz for emacs-devel@gnu.org; Wed, 23 Mar 2005 08:37:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DE63H-0001DI-RV for emacs-devel@gnu.org; Wed, 23 Mar 2005 08:37:39 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DE5hJ-0001rq-MF for emacs-devel@gnu.org; Wed, 23 Mar 2005 08:14:57 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DE5hI-0003dD-W3; Wed, 23 Mar 2005 08:14:57 -0500 Original-To: Lute Kamstra In-Reply-To: <874qf2bkqg.fsf@xs4all.nl> (Lute Kamstra's message of "Wed, 23 Mar 2005 13:38:31 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:35036 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35036 Lute Kamstra writes: > Here's a patch to handle debug-on-entry for autoloaded functions and > compiled macros. > > The patch also solves a problem with cancel-debug-on-entry. > Currently, it signals an error for built-in functions, autoloaded > functions, and aliases that are not set to debug-on entry. The patch > makes cancel-debug-on-entry a no-op in these cases. > > Ok to commit? On a (maybe?) completely different track: since AUCTeX and preview-latex are up to now distributed separately (and there will be a separate preview-latex available for a while to come, to use with older AUCTeX versions as well), preview-latex uses defadvice on AUCTeX functions. The advice was originally given with 2 matches for "defadvice" in buffer: preview.el 2007:(defadvice TeX-region-create (around preview-counters preactivate) 3151:(defadvice TeX-region-create (before preview-preamble preactivate) It turned out, however, that in certain autoload constellations (where stuff got loaded in order dictated by a combination of mode-hooks and requires and autoloads) the activation of the advice did not happen. It was possible to explicitly activate it manually, however. Possibly relevant dependency scraps would be -*- mode: grep; default-directory: "/home/tmp/auctex/preview/" -*- grep -nH -e TeX-region-create /home/tmp/auctex/*.el /home/tmp/auctex/tex-buf.el:176: (TeX-region-create (TeX-region-file TeX-default-extension) /home/tmp/auctex/tex-buf.el:1123:(defun TeX-region-create (file region original offset) /home/tmp/auctex/tex.el:580:(autoload 'TeX-region-create "tex-buf" no-doc nil) Grep finished (matches found) at Wed Mar 23 14:04:09 Looking at the dependencies, it would appear that the autoload for TeX-region-create itself was unnecessary. We have now changed this to 2 matches for "defadvice" in buffer: preview.el 2007:(defadvice TeX-region-create (around preview-counters) 3151:(defadvice TeX-region-create (before preview-preamble preactivate activate) Both tex.el and tex-buf.el are required (in that order) upon both compilation and execution of preview.el, but it is conceivable that with some use the load order might be different. Another issue is that byte compiler warnings seemed to indicate that preactivation does not work: the advice still gets compiled at load time. It is probably some interaction with autoload forms here that comes into play. They current workaround at least works, but it would probably be prudent to figure why preacticivation seems to fail in some settings involving autoload. Does any of that ring a bell with anybody? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum