From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Giraud Subject: Better sitemap formating Date: Fri, 11 Feb 2011 15:43:11 +0100 Message-ID: <87lj1m7hts.fsf@univ-nantes.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=46357 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnuDp-00055c-Ha for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 09:43:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnuDm-000221-MA for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 09:43:45 -0500 Received: from smtp-tls1.univ-nantes.fr ([193.52.101.145]:39202 helo=smtp-tls.univ-nantes.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnuDm-00021n-Em for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 09:43:42 -0500 Received: from localhost (debian [127.0.0.1]) by smtp-tls.univ-nantes.fr (Postfix) with ESMTP id A35BC95439 for ; Fri, 11 Feb 2011 15:43:40 +0100 (CET) Received: from smtp-tls.univ-nantes.fr ([127.0.0.1]) by localhost (smtp-tls1.d101.univ-nantes.fr [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qzpxHilPr2r8 for ; Fri, 11 Feb 2011 15:43:40 +0100 (CET) Received: from K (unknown [172.16.13.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-tls.univ-nantes.fr (Postfix) with ESMTPSA id 8D53995437 for ; Fri, 11 Feb 2011 15:43:40 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --=-=-= Hi, Here's a patch that make the sitemap entry formating coherent with the new html-pre/postamble one. While here I was trying to add some documentation about this feature in org.texi but I end up copy/pasting or paraphrasing the docstring of correspondant customs. Is it acceptable for the documentation or plain useless? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-publish.el-sitemap-formating-coherent-with-new-p.patch >From 766b0db7d0189d2edb0d8799c3424d62f9ac4e47 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 11 Feb 2011 15:32:58 +0100 Subject: [PATCH] org-publish.el: sitemap formating coherent with new preamble Adopt downcase for format directive to be coherent with the new pre/postamble formating. Use `format-spec' function instead of `org-replace-escapes'. --- lisp/org-publish.el | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lisp/org-publish.el b/lisp/org-publish.el index a7aaee2..3a29d06 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -55,6 +55,7 @@ (require 'cl)) (require 'org) (require 'org-exp) +(require 'format-spec) (eval-and-compile (unless (fboundp 'declare-function) @@ -271,13 +272,13 @@ in the sitemap." :group 'org-publish :type 'string) -(defcustom org-publish-sitemap-file-entry-format "%T" +(defcustom org-publish-sitemap-file-entry-format "%t" "How a sitemap file entry is formated. You could use brackets to delimit on what part the link will be. -%T is the title. -%A is the author. -%D is the date formated using `org-publish-sitemap-date-format'." +%t is the title. +%a is the author. +%d is the date formated using `org-publish-sitemap-date-format'." :group 'org-publish :type 'string) @@ -816,13 +817,11 @@ Default for SITEMAP-FILENAME is 'sitemap.org'." (or visiting (kill-buffer sitemap-buffer)))) (defun org-publish-format-file-entry (fmt file project-plist) - (org-replace-escapes fmt - (list (cons "%T" (org-publish-find-title file)) - (cons "%D" (format-time-string - sitemap-date-format - (org-publish-find-date file))) - (cons "%A" (or (plist-get project-plist :author) - user-full-name))))) + (format-spec fmt + `((?t . ,(org-publish-find-title file)) + (?d . ,(format-time-string sitemap-date-format + (org-publish-find-date file))) + (?a . ,(or (plist-get project-plist :author) user-full-name))))) (defun org-publish-find-title (file) "Find the title of FILE in project." -- 1.7.1 --=-=-= -- Manuel Giraud --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--