From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: (error (format ... Date: Thu, 16 Jun 2005 15:49:20 +0200 Message-ID: <85is0ewgwv.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118929834 16480 80.91.229.2 (16 Jun 2005 13:50:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Jun 2005 13:50:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 16 15:50:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DiuhB-0000Gb-1L for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2005 15:46:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Diumb-0003Uz-55 for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2005 09:51:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Diuls-0003MZ-M4 for emacs-devel@gnu.org; Thu, 16 Jun 2005 09:51:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Diule-0003F9-M7 for emacs-devel@gnu.org; Thu, 16 Jun 2005 09:50:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Diule-0003EN-2U for emacs-devel@gnu.org; Thu, 16 Jun 2005 09:50:50 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Diulz-00016w-Lf for emacs-devel@gnu.org; Thu, 16 Jun 2005 09:51:11 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Diuk3-00026o-H2; Thu, 16 Jun 2005 09:49:11 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 11E371C2BC3A; Thu, 16 Jun 2005 15:49:21 +0200 (CEST) Original-To: Juanma Barranquero In-Reply-To: (Juanma Barranquero's message of "Thu, 16 Jun 2005 15:32:55 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:38956 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38956 Juanma Barranquero writes: > Is there any reason for uses like this one from simple.el: > > (error (format "No further undo information%s" > (if (and transient-mark-mode mark-active) > " for region" ""))) > > instead of simply: > > (error "No further undo information%s" > (if (and transient-mark-mode mark-active) > " for region" "")) I'd probably be tempted to use (error (concat "No further undo information" (and transient-mark-mode mark-active " for region"))) in this case. It shares the disadvantage of the original version (when compared to yours) of being more likely to lead to accidental format string vulnerabilities if a user takes this as starting code for something with a variable string. It is perhaps more educational to preferable follow (error ... with a constant string. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum