From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: How do I debug errors in post-command-hook? Date: Fri, 30 Jul 2010 08:54:31 +0200 Message-ID: <201007300854.31902.tassilo@member.fsf.org> References: <201007292230.58883.tassilo@member.fsf.org> <87wrsdq151.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280472892 26417 80.91.229.12 (30 Jul 2010 06:54:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Jul 2010 06:54:52 +0000 (UTC) Cc: Johan =?iso-8859-1?q?Bockg=E5rd?= To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 30 08:54:48 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OejUT-0006bP-8v for ged-emacs-devel@m.gmane.org; Fri, 30 Jul 2010 08:54:45 +0200 Original-Received: from localhost ([127.0.0.1]:45290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OejUS-0004KB-5F for ged-emacs-devel@m.gmane.org; Fri, 30 Jul 2010 02:54:44 -0400 Original-Received: from [140.186.70.92] (port=35256 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OejUL-0004Jn-7p for emacs-devel@gnu.org; Fri, 30 Jul 2010 02:54:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OejUK-00057D-49 for emacs-devel@gnu.org; Fri, 30 Jul 2010 02:54:37 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:23595) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OejUI-00056l-MG; Fri, 30 Jul 2010 02:54:35 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 6238D7800AFC; Fri, 30 Jul 2010 08:54:33 +0200 (CEST) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04954-04; Fri, 30 Jul 2010 08:54:32 +0200 (CEST) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from tsdh.localnet (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 7E77E78004C1; Fri, 30 Jul 2010 08:54:32 +0200 (CEST) User-Agent: KMail/1.13.5 (Linux/2.6.35-rc6-git4; KDE/4.4.5; x86_64; ; ) In-Reply-To: <87wrsdq151.fsf@gnu.org> X-Face: `TY6r/ws=N5uqO1E`M=Sups<}n%T[E^o_?MJj< =?iso-8859-1?q?O4j=265ljV6lU=7DcXU7oftH=26/x=5F=7EK=7B=26zv9=7D=0A=09sB?= =?iso-8859-1?q?=7D5/Ea=5BhU=7BCS=23=3F=3F0=3F=3Fn?=@sX+ft]?{(l?, mp"a`u 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 Xref: news.gmane.org gmane.emacs.devel:128000 Archived-At: On Friday 30 July 2010 02:11:38 Johan Bockg=E5rd wrote: Hi Johan, > (defadvice lusty--post-command-function (around intercept activate) > (condition-case err > ad-do-it > ;; Let the debugger run > ((debug error) (signal (car err) (cdr err))))) That didn't enter the debugger. I guess you missed the error as condition handler. So I use this advice now: =2D-8<---------------cut here---------------start------------->8--- (defadvice lusty--post-command-function (around intercept activate) (condition-case err ad-do-it ;; Let the debugger run (error (progn (message "%s" err) (debug err))))) =2D-8<---------------cut here---------------end--------------->8--- And here's the backtrace. =2D-8<---------------cut here---------------start------------->8--- Debugger entered: ((error "Attempt to modify read-only object")) (progn (message "%s" err) (debug err)) (condition-case err (setq ad-return-value (ad-Orig-lusty--post-command-fu= nction)) (error (progn ... ...))) (let (ad-return-value) (condition-case err (setq ad-return-value ...) (er= ror ...)) ad-return-value) lusty--post-command-function() run-hooks(post-command-hook) ad-Orig-read-buffer(">> " nil nil) (setq ad-return-value (ad-Orig-read-buffer prompt def require-match)) (let ((completion-styles ...)) (setq ad-return-value (ad-Orig-read-buffer= prompt def require-match))) (let (ad-return-value) (let (...) (setq ad-return-value ...)) ad-return-v= alue) read-buffer(">> ") apply(read-buffer ">> " nil) (save-window-excursion (apply read-fn lusty-prompt args)) (unwind-protect (save-window-excursion (apply read-fn lusty-prompt args))= (remove-hook (quote post-command-hook) (quote lusty--post-command-function= )) (setq lusty--previous-minibuffer-contents nil lusty--initial-window-conf= ig nil lusty--current-idle-timer nil)) (let ((lusty--highlighted-coords ...) (lusty--matches-matrix ...) (lusty-= =2Dmatrix-column-widths ...) (lusty--matrix-truncated-p nil)) (add-hook (qu= ote post-command-hook) (quote lusty--post-command-function) t) (unwind-prot= ect (save-window-excursion ...) (remove-hook ... ...) (setq lusty--previous= =2Dminibuffer-contents nil lusty--initial-window-config nil lusty--current-= idle-timer nil))) lusty--run(read-buffer) (let* ((lusty--active-mode :buffer-explorer) (minibuffer-local-completion= =2Dmap lusty-mode-map) (buffer ...)) (when buffer (switch-to-buffer buffer)= )) lusty-buffer-explorer() call-interactively(lusty-buffer-explorer nil nil) =2D-8<---------------cut here---------------end--------------->8--- Well, that doesn't help me, right? The error message was printed anyway, and the backtrace is the backtrace after leaving `lusty--post-command-function'. Bye, Tassilo