[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA-diffs] /srv/bzr/emacs/elpa r342: New package ggtags
From: |
Stefan Monnier |
Subject: |
Re: [ELPA-diffs] /srv/bzr/emacs/elpa r342: New package ggtags |
Date: |
Thu, 31 Jan 2013 11:02:37 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> +(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
- Re: [ELPA-diffs] /srv/bzr/emacs/elpa r342: New package ggtags,
Stefan Monnier <=