]> git.notmuchmail.org Git - notmuch/commit
emacs: Avoid runtime use of `cl'.
authorDavid Edmondson <dme@dme.org>
Thu, 29 Apr 2010 10:33:36 +0000 (11:33 +0100)
committerCarl Worth <cworth@cworth.org>
Thu, 28 Oct 2010 00:41:50 +0000 (17:41 -0700)
commitc506e1034b5adb54b3e4f8d3e59086756f2bb126
tree7fda3e5dc2e837473281c0754994fc791e2294bd
parentb67c3ed6094025558ebcdd608735d116a01997f8
emacs: Avoid runtime use of `cl'.

The GNU Emacs Lisp Reference Manual section D.1 says:

> *  Please don't require the cl package of Common Lisp extensions at
>    run time. Use of this package is optional, and it is not part of
>    the standard Emacs namespace. If your package loads cl at run time,
>    that could cause name clashes for users who don't use that package.
>
>    However, there is no problem with using the cl package at compile
>    time, with (eval-when-compile (require 'cl)). That's sufficient for
>    using the macros in the cl package, because the compiler expands
>    them before generating the byte-code.

Follow this advice, requiring the following changes where `cl' was
used at runtime:

- replace `rassoc-if' in `notmuch-search-buffer-title' with the `loop'
  macro and inline code. At the same time find the longest prefix
  which matches the query rather than simply the last,
- replace `union', `intersection' and `set-difference' in
  `notmuch-show-add-tag' and `notmuch-show-remove-tag' with local code
  to calculate the result of adding and removing a list of tags from
  another list of tags.
emacs/notmuch-hello.el
emacs/notmuch-show.el
emacs/notmuch.el