From: Remi Vanicat Date: Sat, 23 Feb 2008 19:39:53 GMT Subject: Re: [PATCH] git.el: Add a git-grep command Message-ID: <8763wfwjg6.dlv@maison.homelinux.org> In-Reply-To: <200802230200.m1N202Y7007392@localhost.localdomain> Xavier Maillard writes: > Hi, > > Here is a modification with inclusion of git-grep only when the grep > library is available. > > +(require 'grep () t) > > +(when (featurep 'grep) > + (defvar git-grep-history nil) > + > + (defun git-grep (regexp &optional files dir) > > Why not just do something like this ? > > (when (require 'grep () t) > (defvar ...) > (defun git-grep ...)) Because I wanted require to stay on top of the file, but I didn't want to put the rest of the git-grep stuff there. (the real reason is because I did not check in the doc for the return value of require, and so I didn't knew that I could do that, but still, I believe that my after the fact argument are good.) -- Rémi Vanicat