Last active
August 14, 2016 02:49
-
-
Save oylenshpeegul/97965c1996e5e8d0147685c8b296ec06 to your computer and use it in GitHub Desktop.
Emacs - insert the date with Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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