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