From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Johan_Bockg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: How do I debug errors in post-command-hook? Date: Fri, 30 Jul 2010 02:11:38 +0200 Message-ID: <87wrsdq151.fsf@gnu.org> References: <201007292230.58883.tassilo@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1280448713 3046 80.91.229.12 (30 Jul 2010 00:11:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Jul 2010 00:11:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 30 02:11:51 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 1OedCW-0004vV-KG for ged-emacs-devel@m.gmane.org; Fri, 30 Jul 2010 02:11:48 +0200 Original-Received: from localhost ([127.0.0.1]:33469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OedCW-0002Xj-1f for ged-emacs-devel@m.gmane.org; Thu, 29 Jul 2010 20:11:48 -0400 Original-Received: from [140.186.70.92] (port=45558 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OedCQ-0002Xc-76 for emacs-devel@gnu.org; Thu, 29 Jul 2010 20:11:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OedCP-0007i5-3l for emacs-devel@gnu.org; Thu, 29 Jul 2010 20:11:42 -0400 Original-Received: from smtprelay-b12.telenor.se ([62.127.194.21]:59429) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OedCO-0007hx-Ux for emacs-devel@gnu.org; Thu, 29 Jul 2010 20:11:41 -0400 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b12.telenor.se (Postfix) with ESMTP id C3B96EA2C7 for ; Fri, 30 Jul 2010 02:11:39 +0200 (CEST) X-SENDER-IP: [85.228.203.92] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhFQAOu1UUxV5MtcPGdsb2JhbACHZotajFgMAQEBATUtwE+FOAQ X-IronPort-AV: E=Sophos;i="4.55,283,1278280800"; d="scan'208";a="111427039" Original-Received: from c-5ccbe455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.203.92]) by ipb2.telenor.se with ESMTP; 30 Jul 2010 02:11:39 +0200 Original-Received: by muon.localdomain (Postfix, from userid 1000) id E47A54844B6; Fri, 30 Jul 2010 02:11:38 +0200 (CEST) Mail-Copies-To: never In-Reply-To: <201007292230.58883.tassilo@member.fsf.org> (Tassilo Horn's message of "Thu, 29 Jul 2010 22:30:58 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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 Xref: news.gmane.org gmane.emacs.devel:127994 Archived-At: Tassilo Horn writes: > Hi all, > > how do I debug errors that happen while executing a function in > `post-command-hook'? The usual debugging facilities like > `toggle-debug-on-error' and `edebug-function' are not triggered in > there... > > Background: There seem to be some packages that error when emacs is > started with the --daemon option. One example is the lusty-explorer's > `lusty-buffer-explorer' function. It works fine when run in a "normal" > emacs, but I get an error in `post-command-hook' when emacs was > initially started as daemon, and I'd like to know what's going wrong. ;; I spent a few hours hacking together a solution using ;; signal-hook-function and had written a reply, and just before sending ;; the message I noticed that this actually works: (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)))))