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: Fixing numerous `message' bugs.. Date: Fri, 07 Dec 2007 18:37:03 +0100 Message-ID: <85bq92l83k.fsf@lola.goethe.zz> References: <87myso8yrs.fsf@marie.gnufans.net> <87ve7b4xt6.fsf@marie.gnufans.net> <85abonpxnw.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1197049018 13439 80.91.229.12 (7 Dec 2007 17:36:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2007 17:36:58 +0000 (UTC) Cc: deego3@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 07 18:37:06 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 1J0h8L-0007tQ-Pp for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 18:37:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0h84-0006cN-NP for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 12:36:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0h80-0006YO-HD for emacs-devel@gnu.org; Fri, 07 Dec 2007 12:36:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0h7y-0006Ts-K4 for emacs-devel@gnu.org; Fri, 07 Dec 2007 12:36:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0h7y-0006Tf-GT for emacs-devel@gnu.org; Fri, 07 Dec 2007 12:36:42 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J0h7y-0004ul-1d for emacs-devel@gnu.org; Fri, 07 Dec 2007 12:36:42 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J0h7r-0001go-Ri; Fri, 07 Dec 2007 12:36:36 -0500 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 7E67D1C46130; Fri, 7 Dec 2007 18:37:03 +0100 (CET) In-Reply-To: (Richard Stallman's message of "Fri, 07 Dec 2007 12:17:58 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:84839 Archived-At: Richard Stallman writes: > +++ b/lisp/textmodes/artist.el > @@ -1151,14 +1151,14 @@ PREV-OP-ARG are used when invoked recursively during the build-up." > (interactive) > (let ((next-op (cdr (cdr (assoc artist-curr-go artist-prev-next-op-alist))))) > (artist-select-operation next-op) > - (message next-op))) > + (message (and next-op "%s") next-op))) > > I have a feeling that next-op is always supposed to be non-nil, and I > think artist-select-operation will get en error if next-op is not nil. > So I think the `and' is not needed. How about asking the `artist.el' > maintainer? Well, I was going through this sort of defensively. If I couldn't figure out in 10 seconds whether the string could contain percent signs, I went with "%s", and if I couldn't figure out in the same time frame whether it could be nil, I added the "and". It would probably be cleaner to omit the "and" when in doubt and let the package maintainers clean up afterwards in the rare case where this was mistaken. It is also possible to write this as (message "%s" (concat next-op)) which is more concise and avoids double evaluation of next-op. It does copy next-op, though. So perhaps (message "%s" (or next-op "")) -- David Kastrup, Kriemhildstr. 15, 44793 Bochum