From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Whitfield Diffie Newsgroups: gmane.emacs.devel Subject: Percent sign in message Date: Sun, 10 Sep 2006 23:15:08 -0700 Message-ID: <200609110615.k8B6F86U021306@ushabti.sfbay.sun.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1157955653 31630 80.91.229.2 (11 Sep 2006 06:20:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 06:20:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 11 08:20:51 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GMfA2-0006F2-8g for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 08:20:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMfA1-0002GA-9j for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 02:20:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMf9o-0002G5-Su for emacs-devel@gnu.org; Mon, 11 Sep 2006 02:20:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMf9m-0002Ft-7v for emacs-devel@gnu.org; Mon, 11 Sep 2006 02:20:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMf9m-0002Fq-2L for emacs-devel@gnu.org; Mon, 11 Sep 2006 02:20:34 -0400 Original-Received: from [192.18.42.13] (helo=nwkea-mail-1.sun.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GMfAz-0005f2-1L for emacs-devel@gnu.org; Mon, 11 Sep 2006 02:21:49 -0400 Original-Received: from sfbaymail1sca.SFBay.Sun.COM ([129.145.154.35]) by nwkea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k8B6KUrG014684 for ; Sun, 10 Sep 2006 23:20:31 -0700 (PDT) Original-Received: from ushabti.sfbay.sun.com (ushabti.SFBay.Sun.COM [129.146.74.69]) by sfbaymail1sca.SFBay.Sun.COM (8.13.6+Sun/8.13.6/ENSMAIL, v2.2) with ESMTP id k8B6KTw7021711 for ; Sun, 10 Sep 2006 23:20:29 -0700 (PDT) Original-Received: from ushabti.sfbay.sun.com (localhost [127.0.0.1]) by ushabti.sfbay.sun.com (8.13.5+Sun/8.13.5) with ESMTP id k8B6F9nr021309; Sun, 10 Sep 2006 23:15:09 -0700 (PDT) Original-Received: (from diffie@localhost) by ushabti.sfbay.sun.com (8.13.5+Sun/8.13.5/Submit) id k8B6F86U021306; Sun, 10 Sep 2006 23:15:08 -0700 (PDT) Original-To: emacs-devel Started-at: 2006.09.10-23:03:58 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:59656 Archived-At: Sunday 10 September 2006 at 23:03 I am sending this message to emacs-devel rather than bug-gnu-emacs because, although I think this is arguable a bug, it could be fixed by changing the documentation but the fix I propose is more substantial. The command (message "%") produces the error (error "Not enough arguments for format string") because message hands its arguments directly to format and format makes special use of percent signs. A reasonably careful look at the documentation of format finds the warning that if you want a percent in the format string, you should double it. That isn't so bad because there is no reason to use format if you don't want the special way it processes its string. Message is another thing. It is perfectly reasonable to call message to print a fixed string or, as produced the trouble, a string that is not under the program's control. In my case, I have a function called `describe-last-kbd-macro' that constructs a definition and calls message to present it and my macro operated on comments in TeX. Clearly I could pre-process the message to double the percent signs but it doesn't seem that should be necessary. What I propose is changing format so that it specially interprets as many percent signs as it has arguments for and just passes the rest verbatum, with a possible warning in the *Messages* buffer. Whit