From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: Async package.el Date: Thu, 9 Apr 2015 15:53:14 +0100 Message-ID: References: <55228FD2.3080501@yandex.ru> <552330A2.1090406@yandex.ru> <55248915.5070707@yandex.ru> <5525DA9F.2000301@yandex.ru> <87oamx8kgw.fsf@gmail.com> <87r3rts7o9.fsf@gmx.us> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1428591215 21902 80.91.229.3 (9 Apr 2015 14:53:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Apr 2015 14:53:35 +0000 (UTC) Cc: emacs-devel To: Rasmus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 09 16:53:34 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YgDpm-0001lH-CY for ged-emacs-devel@m.gmane.org; Thu, 09 Apr 2015 16:53:34 +0200 Original-Received: from localhost ([::1]:35124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgDpl-0002Ff-V2 for ged-emacs-devel@m.gmane.org; Thu, 09 Apr 2015 10:53:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgDpV-0002FU-3r for emacs-devel@gnu.org; Thu, 09 Apr 2015 10:53:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgDpU-00041h-Ae for emacs-devel@gnu.org; Thu, 09 Apr 2015 10:53:17 -0400 Original-Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:36104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgDpU-00041a-22 for emacs-devel@gnu.org; Thu, 09 Apr 2015 10:53:16 -0400 Original-Received: by lbbqq2 with SMTP id qq2so84354082lbb.3 for ; Thu, 09 Apr 2015 07:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=oHMqHrkUpP7moZ2/WTvvLESUnGugwNFXTDNkpE5xXkM=; b=GivYjt+BGpLlUFoc4VO+PL68tsJNbeouDaNE4CmlFh14JCGr5Q7lO7tIJRugUoL1OP kTx/AXL8jMpEmKPkNiNOYdfnjlrUX72lnkYtB1JS8AJ4QqZXa+ofI+Jw8r4KRzuAKxp+ D78DR7iwD3nWoq46TbX3rM3U8U/EsAEl1l6VYVT/0Z6LGaK2nYQCNM7EbjX3WMjdyQyX DyQn9uBWL8uH3/WEEjTlPsiBWZAY/niVOucUxnG4uNlBK0fhbEeBAC3PbU4ZmBj4r+1X 3J2nz8mqmG3T5FJfPMxQfG7uMRW3e0O922+Ae3avPMKJ3qy+TNThvw2hJsDB3yoD0P2Q jWYQ== X-Received: by 10.152.7.239 with SMTP id m15mr2878081laa.95.1428591195045; Thu, 09 Apr 2015 07:53:15 -0700 (PDT) Original-Received: by 10.25.150.131 with HTTP; Thu, 9 Apr 2015 07:53:14 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: yiRJq-yI9eRVmteRgmopPCqUALQ X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185211 Archived-At: There are some C-level functions that send messages without using `message', but these are very few. There's also an emacs package dedicated to muting messages, I think it's called `shut-up' (or something like that). 2015-04-09 15:50 GMT+01:00 Artur Malabarba : >>> I need to find a >>> way of telling #'message not to talk when called from an async >>> task -- or more generally, if called from anything except the main UI >>> thread. Any ideas? >> >> Is something like this too hackish? >> >> (cl-letf (((symbol-function 'message) 'ignore)) >> whatever) >> > > This is generally what I do too. IIRC, the only drawback is that this > uses unwind-protect, which is not triggered by the max-lisp-eval-depth > error. So if you hit that error, message's function definition won't > be restored. > You can either just live with that, or you can wrap the code inside > the `cl-letf' in a `condition-case' statement and to catch that error.