Thankfully, texdef is a Perl script - so I added a print $_ to the texpipe, to observe results - and the texing process was crashing at:
! Undefined control sequence.
l.42 \currfile@realmainfilefalse
! Extra \fi.
l.53 \fi\fi
Since texdef depends on currfile, that must be the source of errors - and indeed, there are some mismatching definitions:
$ grep -i '20..\|ifcurrfile@abspath' `kpsewhich currfile-abspath.sty`
2012/05/06
\newif\ifcurrfile@abspath@windows
\ifcurrfile@abspath@windows
$ grep -i '20..\|ifcurrfile@abspath' `kpsewhich currfile.sty`
2012/05/06
\RequirePackage{filehook}[2011/01/09]
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@abspath
\@namedef{ver@fink.sty}{2011/01/09}%
$ grep 'ifcurrfile@' `kpsewhich currfile-abspath.sty`
\newif\ifcurrfile@abspath
\ifcurrfile@abspath
$ grep 'ifcurrfile@' `kpsewhich currfile.sty`
\let\ifcurrfile@realmainfile\relax
\expandafter\ifx\csname ifcurrfile@realmainfile\endcsname\relax
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@realmainfile
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@abspath
\ifcurrfile@realmainfile
\ifcurrfile@abspath
\ifcurrfile@fink
These two hacks seem to solve the problem:
sed -i 's/ifcurrfile@abspath@windows/ifcurrfile@abspath/' `kpsewhich currfile-abspath.sty`
sed -i 's_\\let\\ifcurrfile@realmainfile_\\newif\\ifcurrfile@realmainfile\n\\let\\ifcurrfile@realmainfile_' `kpsewhich currfile.sty`
And now I can happily run the example command line:
$ texdef -t latex -l -p xspace
Defined by file 'xspace.sty':
\xspace
\xspaceaddexceptions
\xspaceremoveexception
currfile) you are using. TeX Live 2011 is not an exact description, it's just the distribution. I updatedtexdef(andcurrfile) several times during the 2011 live cycle. – Martin Scharrer♦ Jun 12 '12 at 19:58