From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: To `boundp' or not to `boundp'? Date: Tue, 01 Sep 2015 22:12:59 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1441160030 29452 80.91.229.3 (2 Sep 2015 02:13:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 02:13:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 02 04:13:45 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZWxYS-0001QA-Hu for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 04:13:41 +0200 Original-Received: from localhost ([::1]:60406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWxYS-00087a-IP for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Sep 2015 22:13:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWxXz-0007lR-B7 for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 22:13:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWxXw-0001Xi-5P for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 22:13:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:52700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWxXv-0001XV-VS for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 22:13:08 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZWxXt-0000ys-EQ for help-gnu-emacs@gnu.org; Wed, 02 Sep 2015 04:13:06 +0200 Original-Received: from 104-247-231-250.cpe.teksavvy.com ([104-247-231-250.cpe.teksavvy.com]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Sep 2015 04:13:05 +0200 Original-Received: from monnier by 104-247-231-250.cpe.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Sep 2015 04:13:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 14 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 104-247-231-250.cpe.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:SByP/oRyoqwmG4e0hbNEmG3BiNo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106977 Archived-At: > (when (and (boundp 'xxx-mode) xxx-mode) > ...) > I personally prefer to do it shorter > (when (ignore-errors xxx-mode) > ...) > Are those equivalent? Kinda. I think ignore-errors has a higher cost than boundp+and, but the more important difference is that ignore-errors will hide all kinds of other errors, so its use generally makes debugging your code harder. For that reason I generally prefer to avoid it. Stefan