From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Leo Liu <sdl.web@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [ELPA-diffs] /srv/bzr/emacs/elpa r342: New package ggtags
Date: Thu, 31 Jan 2013 11:02:37 -0500 [thread overview]
Message-ID: <jwv38xhibrg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1U0vtC-0006Gd-Dz@vcs.savannah.gnu.org> (Leo Liu's message of "Thu, 31 Jan 2013 22:50:42 +0800")
> +(defmacro ggtags-ensure-global-buffer (&rest body)
> + (declare (indent 0))
> + `(progn
> + (assert (and (buffer-live-p compilation-last-buffer)
> + (with-current-buffer compilation-last-buffer
> + (derived-mode-p 'ggtags-global-mode)))
> + nil "No global buffer found")
> + (with-current-buffer compilation-last-buffer ,@body)))
I think this is a misuse of `assert'. An `assert' should be used for
something that should *never* be false (i.e. if it is false, we have
a bug, possibly in the assertion itself). This is reflected in the fact
that depending on optimization levels, CL can be told to "optimize-away"
the assertions.
So I think you want to use an explicit "test + error" above.
Stefan
next parent reply other threads:[~2013-01-31 16:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1U0vtC-0006Gd-Dz@vcs.savannah.gnu.org>
2013-01-31 16:02 ` Stefan Monnier [this message]
2013-01-31 18:03 ` [ELPA-diffs] /srv/bzr/emacs/elpa r342: New package ggtags Leo Liu
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=jwv38xhibrg.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=sdl.web@gmail.com \
/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.