From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: HASM Newsgroups: gmane.emacs.help Subject: icalendar--datetime-to-iso-date (icalendar.el) Date: Thu, 03 Nov 2016 06:27:00 -0700 Organization: A noiseless patient Spider Message-ID: <871sysiti3.fsf@127.0.0.1> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1478179871 19824 195.159.176.226 (3 Nov 2016 13:31:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 Nov 2016 13:31:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 03 14:31:04 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2I6N-0002MW-Bl for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Nov 2016 14:30:43 +0100 Original-Received: from localhost ([::1]:33014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2I6Q-0003GO-5U for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Nov 2016 09:30:46 -0400 X-Received: by 10.194.88.7 with SMTP id bc7mr436113wjb.13.1478179623535; Thu, 03 Nov 2016 06:27:03 -0700 (PDT) Original-Path: usenet.stanford.edu!c17no242631wmc.0!news-out.google.com!x66ni222wme.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!137.226.75.22.MISMATCH!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-Injection-Info: mx02.eternal-september.org; posting-host="8d43edb595f34ee451e7be24506f51f5"; logging-data="13846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Q8d9n7yH9tD/RE5oC2BBreAMNluWDcMs=" Cancel-Lock: sha1:Sf/iUQSpfxL/phP3FJ1194KpymU= sha1:GjhB9Wxd4zgP2rMNjGNoVWmsZIE= Original-Xref: usenet.stanford.edu gnu.emacs.help:219002 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111659 Archived-At: Shouldn't format in: icalendar--datetime-to-iso-date (icalendar.el) be: "%04d%s%02d%s%02d" instead of: "%d%s%d%s%d"? At least that's how I read the wikipedia description of the standard: https://en.wikipedia.org/wiki/ISO_8601 This will allow, for those of use ISO dates with: (setq diary-date-forms diary-iso-date-forms calendar-date-style 'iso ) To create a "simple' sort function for the diary, like the one below. -- HASM ------------------------------------------------------------ (defun sort--diary (diary-filename) (with-current-buffer (set-buffer (find-file-noselect (expand-file-name diary-filename))) (goto-char (point-min)) (while (search-forward "\C-j " nil t) (replace-match "^j ")) (sort-lines nil (point-min) (point-max)) (goto-char (point-min)) (while (search-forward "^j" nil t) (replace-match "\C-j")) (save-buffer))) (defvar sort--diary-filename (expand-file-name diary-file) "History for sort--diary diary-filename") (defun sort-diary (diary-filename) "Sort diary file. Requires dates to use ISO standard" (interactive (list (read-from-minibuffer "diary file name: " (car sort--diary-filename) nil nil 'sort--diary-filename))) (sort--diary diary-filename))