all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: rms@gnu.org
Cc: deego3@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Fixing numerous `message' bugs..
Date: Fri, 07 Dec 2007 18:37:03 +0100	[thread overview]
Message-ID: <85bq92l83k.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1J0gpq-0000No-Es@fencepost.gnu.org> (Richard Stallman's message of "Fri, 07 Dec 2007 12:17:58 -0500")

Richard Stallman <rms@gnu.org> 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

  reply	other threads:[~2007-12-07 17:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06  0:14 Fixing numerous `message' bugs D. Goel
2007-12-06 10:56 ` David Kastrup
2007-12-06 14:36   ` Dave Goel
2007-12-06 19:26     ` Glenn Morris
2007-12-06 19:34       ` Dave Goel
2007-12-06 20:21       ` Johan Bockgård
2007-12-07  5:28         ` Glenn Morris
2007-12-07 15:52           ` Dave Goel
2007-12-06 15:53 ` Stefan Monnier
2007-12-06 16:01   ` Dave Goel
2007-12-06 16:49     ` Stefan Monnier
2007-12-06 16:58       ` David Kastrup
2007-12-06 17:19         ` David Kastrup
2007-12-07 17:17         ` Richard Stallman
2007-12-07 17:37           ` David Kastrup [this message]
2007-12-07 17:17         ` Richard Stallman
2007-12-07 17:18         ` Richard Stallman
2007-12-07 17:24           ` David Kastrup
2007-12-07 18:00             ` Dave Goel
2007-12-07 18:38               ` Stefan Monnier
2007-12-08  0:56                 ` Glenn Morris
2007-12-08  2:21                   ` Stefan Monnier
2007-12-08 10:55                     ` David Kastrup
2007-12-08 19:15                 ` Richard Stallman
2007-12-10 17:41                   ` Dave Goel
2007-12-10 18:04                     ` Jason Rumney
2007-12-10 19:05                       ` Dave Goel
2007-12-10 19:56                         ` Andreas Schwab
2007-12-10 20:31                           ` Dave Goel
2007-12-10 21:19                             ` David Kastrup
2007-12-10 22:44                               ` Dave Goel
2007-12-10 23:02                                 ` David Kastrup
2007-12-08 19:15             ` Richard Stallman
2007-12-07 17:18 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85bq92l83k.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=deego3@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.