Skip to content

Instantly share code, notes, and snippets.

@oylenshpeegul
Last active August 14, 2016 02:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save oylenshpeegul/97965c1996e5e8d0147685c8b296ec06 to your computer and use it in GitHub Desktop.
Emacs - insert the date with Perl
;; Use some Perl to insert the date.
(defun myday ()
"print the date"
(interactive)
(call-process "perl" nil t nil "-e" "
# perl code here
my @Monat = qw(Januar Februar Maerz April Mai Juni Juli August
September Oktober November Dezember);
my @Tag = qw(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag
Samstag);
my (undef, undef, undef, $mday, $mon, $year, $wday, $yday) = localtime;
$year += 1900;
$yday += 1;
print qq/$Tag[$wday], den $mday $Monat[$mon] $year (yday $yday)\n/;
"
))
;; C-c m calls myday
(global-set-key (kbd "C-c m") 'myday)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment