emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Bibtex and latex export


From: Achim Gratz
Subject: [Orgmode] Re: Bibtex and latex export
Date: Fri, 08 Oct 2010 20:03:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

I'm pretty sure that this behaviour of egrep has been introduced with
GNU grep version 2.6 (which says it fixed some long-standing bugs with
regards to locale handling and character classes if you care to read the
release notes).  Unfortunately, as we see here, fixing bugs in one place
often uncovers bugs someplace else, as the texi2dvi maintainers
certainly didn't suspect a new version of grep to cause breakage.  There
are some bugs introduced with 2.6 that supposedly have been fixed in
2.7.

Since the intent of the regex is obviously to allow an absolute path to
start either with a "/" or a DOS drive letter, contrary to what I wrote
before it is _not_ possible to use character classes as that would also
allow extra characters not allowed in drive letters in most locales.
Probably the most compatible version is to force the "C" locale for the
egrep call in question and slightly modify the range expression:

  echo "$command_line_filename" | LC_ALL=C $EGREP '^(/|[A-Za-z]:/)' >&6 \
  || command_line_filename="./$command_line_filename"

Otherwise you can't really use range expressions or character classes at
all since they either permit illegal drive letters or might not work
with due to the bugs in older versions of grep... it would however be
possible to spell out each drive letter bot in upper and lower case,
although that handicaps the permissible length of the filename (if the
"-i" switch wasn't broken in some locales one could use it and save one
version of the cases):

  echo "$command_line_filename" | LC_ALL=C $EGREP \
  '^(/|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/)' >&6 \
  || command_line_filename="./$command_line_filename"

*Shudder* :-)


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




reply via email to

[Prev in Thread] Current Thread [Next in Thread]