From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: How do I debug errors in post-command-hook? Date: Thu, 29 Jul 2010 23:33:24 +0200 Message-ID: References: <201007292230.58883.tassilo@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280439237 9728 80.91.229.12 (29 Jul 2010 21:33:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Jul 2010 21:33:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 29 23:33:55 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 1Oeaji-0003Tt-FK for ged-emacs-devel@m.gmane.org; Thu, 29 Jul 2010 23:33:54 +0200 Original-Received: from localhost ([127.0.0.1]:57629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oeajh-0005fI-To for ged-emacs-devel@m.gmane.org; Thu, 29 Jul 2010 17:33:53 -0400 Original-Received: from [140.186.70.92] (port=36932 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oeajb-0005dV-5A for emacs-devel@gnu.org; Thu, 29 Jul 2010 17:33:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeajZ-0002Lj-Uu for emacs-devel@gnu.org; Thu, 29 Jul 2010 17:33:47 -0400 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:48694) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeajZ-0002LL-Rw for emacs-devel@gnu.org; Thu, 29 Jul 2010 17:33:45 -0400 Original-Received: by gwj16 with SMTP id 16so411905gwj.0 for ; Thu, 29 Jul 2010 14:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=6wWEkspWgt2aDvjE5IUzX6PouXp31jaE6qVTja1HgzY=; b=P8kUAMJgc0ondFhtIfxblDtY2BMmrA+b2L7lJtfqnUoqrrgYh/LWL41rAS/6iFKEeu /HR1IGNjklSBpQuDi/Yoix4gTpzUrUbGZD52GHEB3B8kGjmYJaBDEzicl/LU2ysbONr2 veExF8I0uh4LJshl9w+47vjUl4aBMLpACpkRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=A/nNnMmUuQVXYLtO9OHNj7Fo9qSnFOepbsrRXz+9PUlGskis0lls4qYrkIHuh9EGqG URmAQaZ2Om9O+B67UutOT9WDDk7pxwjuQ4aT2VqPbTI1X49rTXbCdnjTtegFw4tNopLX V5JzKJ7lbUcxsHv+2Vk+fW3TDB+eZ0/eysShA= Original-Received: by 10.100.138.20 with SMTP id l20mr958505and.10.1280439224608; Thu, 29 Jul 2010 14:33:44 -0700 (PDT) Original-Received: by 10.229.5.72 with HTTP; Thu, 29 Jul 2010 14:33:24 -0700 (PDT) In-Reply-To: <201007292230.58883.tassilo@member.fsf.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:127990 Archived-At: On Thu, Jul 29, 2010 at 10:30 PM, Tassilo Horn wro= te: > Hi all, > > how do I debug errors that happen while executing a function in > `post-command-hook'? =C2=A0The 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. =C2=A0One example is the lusty-explorer= 's > `lusty-buffer-explorer' function. =C2=A0It works fine when run in a "norm= al" > 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 usually split up functions in post-command-hook like this: (defun post-fun () (condition-case err (post-fun-1) (error (message "post-fun: %s" (error-message-string err))))) (defun post-fun-1 () ...) When I get an error I do M-: (post-fun-1)