From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [ELPA-diffs] /srv/bzr/emacs/elpa r342: New package ggtags Date: Thu, 31 Jan 2013 11:02:37 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1359648171 17494 80.91.229.3 (31 Jan 2013 16:02:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2013 16:02:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Leo Liu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 31 17:03:11 2013 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 1U0wbV-0001os-Dx for ged-emacs-devel@m.gmane.org; Thu, 31 Jan 2013 17:03:09 +0100 Original-Received: from localhost ([::1]:51514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0wbD-0000e0-9w for ged-emacs-devel@m.gmane.org; Thu, 31 Jan 2013 11:02:51 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0wb4-0000aL-2O for emacs-devel@gnu.org; Thu, 31 Jan 2013 11:02:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0wb2-0007qX-1k for emacs-devel@gnu.org; Thu, 31 Jan 2013 11:02:42 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0wb1-0007qS-Ty for emacs-devel@gnu.org; Thu, 31 Jan 2013 11:02:39 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r0VG2cdG030832; Thu, 31 Jan 2013 11:02:38 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 0A6FEB4182; Thu, 31 Jan 2013 11:02:37 -0500 (EST) In-Reply-To: (Leo Liu's message of "Thu, 31 Jan 2013 22:50:42 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4478=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4478> : streams <898144> : uri <1332985> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:156740 Archived-At: > +(defmacro ggtags-ensure-global-buffer (&rest body) > + (declare (indent 0)) > + `(progn > + (assert (and (buffer-live-p compilation-last-buffer) > + (with-current-buffer compilation-last-buffer > + (derived-mode-p 'ggtags-global-mode))) > + nil "No global buffer found") > + (with-current-buffer compilation-last-buffer ,@body))) I think this is a misuse of `assert'. An `assert' should be used for something that should *never* be false (i.e. if it is false, we have a bug, possibly in the assertion itself). This is reflected in the fact that depending on optimization levels, CL can be told to "optimize-away" the assertions. So I think you want to use an explicit "test + error" above. Stefan