From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: D. Goel Newsgroups: gmane.emacs.devel Subject: Fixing numerous `message' bugs.. Date: Wed, 05 Dec 2007 19:14:47 -0500 Message-ID: <87myso8yrs.fsf@marie.gnufans.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196912063 933 80.91.229.12 (6 Dec 2007 03:34:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 03:34:23 +0000 (UTC) To: emacs-devel@gnu.org , Dave Goel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 06 04:34:31 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J07VN-0000bv-2n for ged-emacs-devel@m.gmane.org; Thu, 06 Dec 2007 04:34:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J07V6-0004bS-9k for ged-emacs-devel@m.gmane.org; Wed, 05 Dec 2007 22:34:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J04OF-0003Jj-0q for emacs-devel@gnu.org; Wed, 05 Dec 2007 19:14:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J04OD-0003HB-Lx for emacs-devel@gnu.org; Wed, 05 Dec 2007 19:14:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J04OD-0003Gj-EZ for emacs-devel@gnu.org; Wed, 05 Dec 2007 19:14:53 -0500 Original-Received: from mtao03.charter.net ([209.225.8.188]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J04OD-0006XB-5u for emacs-devel@gnu.org; Wed, 05 Dec 2007 19:14:53 -0500 Original-Received: from aarprv04.charter.net ([10.20.200.74]) by mtao03.charter.net (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20071206001452.XRPM19023.mtao03.charter.net@aarprv04.charter.net>; Wed, 5 Dec 2007 19:14:52 -0500 Original-Received: from marie.gnufans.net ([66.168.196.121]) by aarprv04.charter.net with ESMTP id <20071206001452.TTZW17353.aarprv04.charter.net@marie.gnufans.net>; Wed, 5 Dec 2007 19:14:52 -0500 Original-Received: from deego by marie.gnufans.net with local (Exim 3.36 #1 (Debian)) id 1J04O7-0002fw-00; Wed, 05 Dec 2007 19:14:47 -0500 X-Face: #5@=vrmx5t3mZaPY8(mR.n+V#:%4NW7j5A&^}@lGp2rK; CQ4%iH1v'gh/^A)w5*6c&R2(P' 4+seYDq8OK'LPI/C(C^A*w|f*t+8, 'T8b#_0~h3!A7GoVroE[cr0Fb'A0%SdU|Lk@gBV&1vA X-Chzlrs: 0 X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Wed, 05 Dec 2007 22:33:27 -0500 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:84774 Archived-At: The emacs source code is littered with thousands of buggy calls to `message'. Here is an example of such a structure: (message (if foo nil (if bar "abc" (concat "def" filename)))) This example will lead to an error if the filename has %s in it. At the same time, the simplistic fix of replacing (message by (message "%s" would be incorrect because if foo is true, the coder wanted (message nil), and not (message "%s" nil). The appropriate fix to this would be (let ((arg ((rest-of-the-code)))) (if (null arg) (message nil) (message "%s" arg))) ^^^ This fix will have to be repeated thousands of time as I go through the source code. It would rather make much more sense to code this fix into a little function: (defun msg (arg) (if (null arg) (message nil) (message (format "%s" arg)))) Then, I simply have to replace buggy calls to `message' with `msg' ---- .. this new function can be further improved to be more general, so that develepors can simply start preferring the new msg if they like - (defun msg (&rest args) (cond ((null args) (message nil)) ((null (car args) (message nil))) ((= (length args) 1) (message "%s" (car args))) (apply 'message args))) I would like to add `msg' to simple.el, and replace buggy `message' calls by `msg'. Can you please confirm or comment? ((My correct email is now deego3@gmail.com, please cc there as well; emacs-devel seems to send those messages to spam, so I am emailing from my older gnufans address. If an admin sees this, can you please unblock my other email to emacs-devel sent earlier today about a bugfix I made to find-func.el? thanks.) - deego (Deepak Goel)