Fixing notmuch --with-emacs

Implemented changes per #28959.

Tested on Mavericks. This should be good to go.