+* Using a simple macro that will emulate the "limit" mutt functionality
+ using notmuch.
+
+ See the [**alternative notmuch integration**](http://log.or.cz/?p=228)
+ blog post for instructions and details,
+ or simply put these two macros to your muttrc:
+
+ # 'L' performs a notmuch query, showing only the results
+ macro index L "<enter-command>unset wait_key<enter><shell-escape>read -p 'notmuch query: ' x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;chomp@a;s/\^id:// for@a;$,=\"|\";print@a'\`\"<enter>" "show only messages matching a notmuch pattern"
+ # 'a' shows all messages again (supersedes default <alias> binding)
+ macro index a "<limit>all\n" "show all messages (undo limit)"
+
+ The upside (if you are used to working in the context of a single folder)
+ is that this really does use the limit functionality of mutt
+ and you are still in your original folder.
+ The downside is that this approach has scaling problems
+ and works well only for reasonably specific queries.
+
+
+## <span id="reapply_auto">**Automatically retagging the database (e.g., when upgrading versions)**</span>
+
+Certain versions of notmuch include new automatic tags (for example, between
+0.3 and 0.10, automatic tagging of signed and encrypted messages was added).
+However, for users running with databases created in older versions of
+notmuch, these tags are missing in pre-existing messages and need to be
+added. One way to do this is as follows:
+
+ $ notmuch dump --output=~/out.nm
+ $ mv ~/Mail/.notmuch ~/.notmuch.bak
+ $ notmuch new
+ $ notmuch tag -inbox -unread '*'
+ $ notmuch restore --accumulate --input=~/out.nm