This macro is great, but it uses current locales, so it gives me french
date in my spec file.
Having also english locales installed, i tried to change this, but even
unsetting LANG and LANGUAGE environment variables doesn't change
anything. What is the correct way to do this ?


Chmouel Boudjnah a �crit :
> 
> Hi,
> 
> As Emacs user when sometime i have to use vim[1] i find annonying to
> write the changelog with the version and release (under emacs with the
> rpm-spec-mode-mdk i simply do a C-c e and we have the changelog with
> the version release inserted).
> 
> Finally here is a version of a vim macros to insert a version and a
> release, need the spec-version script in your $PATH :
> 
> bind ,ch to add a new Changelog
> 
> --=-=-=
> map ,ch /^%changelog/<C-m>o* <C-R>=strftime("%a %b %d %Y")<C-m> Chmouel Boudjnah 
><[EMAIL PROTECTED]> <Esc>:r!spec-version -v %<C-m>d$k$po-
> --=-=-=
> 
> bind ,CH to add an entry to ChangeLog
> 
> --=-=-=
> map ,CH /%changelog/2<CR>O-
> --=-=-=
> 
> and here is the spec-version script :
> 
> --=-=-=
> #!/usr/bin/perl
> 
> my $vim++, shift if $ARGV[0] =~ /-v/;
> 
> my $file = shift or die "Give me some ganja for my aeroplane\n";
> local *macros;
> 
> open FH, $file;
> while (<FH>) {
>     $macros{$1}=$2 if /^%define\s*(\w+)\s*(.*)$/;
>     while (/^\w+:\s+.*%.*/) {s|%{(\w+)}|$macros{$1}|; s|%(\w+)|$macros{$1}|}
>     &gmac(Name); &gmac(Version); &gmac(Release);
> }
> close FH;
> 
> if ($vim) { $macros{Release}++, $macros{Release} .= "mdk" } else { print 
>"$macros{Name}-" };
> 
> print "$macros{Version}-$macros{Release}\n";
> 
> sub gmac { my $s = shift @_; $macros{$s} = $1 if /^$s:\s+(.*)/; }
> --=-=-=
> 
> PS: Emacs rulz
> 
> [1]  Slow connex :pp.
> --
> MandrakeSoft Inc                http://www.mandrakesoft.com
> San-Francisco, CA USA                             --Chmouel

-- 
Guillaume Rousse
Iremia - Universit� de la R�union

Sleep doesn't exists. Just lack of cafeine.

Reply via email to