emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Some %elements in org-html-postamble-format became too "generous"
@ 2013-04-07 11:52 Dieter Wilhelm
  2013-04-07 13:04 ` Nicolas Goaziou
  0 siblings, 1 reply; 16+ messages in thread
From: Dieter Wilhelm @ 2013-04-07 11:52 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

before 8pre it was better possible to translate the Org/Emacs information in the
postamble.  If I'm using

 ("fr" "<p class=\"author\">Auteur: %a (%e)</p>\n<p class=\"date\">Date
 de la modification: %d </p>\n<p class=\"creator\">Produit par %c
 </p>\n")

The result looks like:

Produit par Generated by Org mode 8.0-pre in Emacs 24.3.3

which also contradicts the documentation string of
org-html-postamble-format...

By the way, I think the creation Time (%T) capability of the postamble
is rather pointless, could you please change it to the modification time
or add something (like %C)? This would save the hassle of putting
everywhere #+DATE: {{{modification-time(%Y-%m-%d)}}} into the files.
One could just change the %d to %C...

Moreover, I think the documentation string is not really precise about
the creation time.  We have on Linux atime, mtime and ctime (Access,
Modification and in effect the inode "Change" time), probably the modern
file systems store additionally the "true Creation" time.

Above nitpicking is only meant for supporting my request with the
modification time. :-)

-- 
Thank you

        Dieter

Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 11:52 Some %elements in org-html-postamble-format became too "generous" Dieter Wilhelm
@ 2013-04-07 13:04 ` Nicolas Goaziou
  2013-04-07 16:26   ` Dieter Wilhelm
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-04-07 13:04 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: emacs-orgmode

Hello,

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> before 8pre it was better possible to translate the Org/Emacs information in the
> postamble.  If I'm using
>
>  ("fr" "<p class=\"author\">Auteur: %a (%e)</p>\n<p class=\"date\">Date
>  de la modification: %d </p>\n<p class=\"creator\">Produit par %c
>  </p>\n")
>
> The result looks like:
>
> Produit par Generated by Org mode 8.0-pre in Emacs 24.3.3
>
> which also contradicts the documentation string of
> org-html-postamble-format...

I fixed this. "%c" equals to `org-html-creator-string' (#+CREATOR:)
value. You are responsible for the translation.

> By the way, I think the creation Time (%T) capability of the postamble
> is rather pointless, could you please change it to the modification time
> or add something (like %C)? This would save the hassle of putting
> everywhere #+DATE: {{{modification-time(%Y-%m-%d)}}} into the files.
> One could just change the %d to %C...

I added %C.

> Moreover, I think the documentation string is not really precise about
> the creation time.  We have on Linux atime, mtime and ctime (Access,
> Modification and in effect the inode "Change" time), probably the modern
> file systems store additionally the "true Creation" time.

This was about the creation time of the /output/, which is, in fact, the
time of export. I changed the docstring to make it clear.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 13:04 ` Nicolas Goaziou
@ 2013-04-07 16:26   ` Dieter Wilhelm
  2013-04-07 17:35     ` Dieter Wilhelm
  2013-04-07 18:32     ` Nicolas Goaziou
  0 siblings, 2 replies; 16+ messages in thread
From: Dieter Wilhelm @ 2013-04-07 16:26 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>
>> before 8pre it was better possible to translate the Org/Emacs information in the
>> postamble.  If I'm using
>>
>>  ("fr" "<p class=\"author\">Auteur: %a (%e)</p>\n<p class=\"date\">Date
>>  de la modification: %d </p>\n<p class=\"creator\">Produit par %c
>>  </p>\n")
>>
>> The result looks like:
>>
>> Produit par Generated by Org mode 8.0-pre in Emacs 24.3.3
>>
>> which also contradicts the documentation string of
>> org-html-postamble-format...
>
> I fixed this. "%c" equals to `org-html-creator-string' (#+CREATOR:)
> value. You are responsible for the translation.

Thank you, you're very helpful.  

Even though I'm not yet happy with this because the
org-html-creator-string default:

"Generated by <a href=\"http://orgmode.org\">Org</a> mode 8.0-pre in <a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."

is in my opinion too much language dependent!  It requires the user who
wants to translate the preamble to change 2 places,
org-html-postamble-format *and* org-html-creator-string.

Why not simply making org-html-creator-string "name oriented", like:

"<a href=\"http://orgmode.org\">Org</a> mode 8.0-pre / <a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."

Then one would be done with just translating
org-html-postamble-format...

>> By the way, I think the creation Time (%T) capability of the postamble
>> is rather pointless, could you please change it to the modification time
>> or add something (like %C)? This would save the hassle of putting
>> everywhere #+DATE: {{{modification-time(%Y-%m-%d)}}} into the files.
>> One could just change the %d to %C...
>
> I added %C.

Thank you. 

Works wonderfully for English, sorry I forgot the more general case.
The default time string format has a day name included.  Wouldn't it be
possible for the exporters to look for the language keyword e.g.:
#+LANGUAGE: fr and set the time string translated accordingly?  I've no
idea how much work it is but I imagine org asking the OS under some
locale argument might do...

Or just using a default time string format which is language
independent, like %Y-%m-%d.

>> Moreover, I think the documentation string is not really precise about
>> the creation time.  We have on Linux atime, mtime and ctime (Access,
>> Modification and in effect the inode "Change" time), probably the modern
>> file systems store additionally the "true Creation" time.
>
> This was about the creation time of the /output/, which is, in fact, the
> time of export. I changed the docstring to make it clear.

Sorry for the confusion, now I understand.

By the way, is it normal that org-html-postamble-format and
org-html-creator-string are not loaded before an html export is
triggered?

-- 
Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 16:26   ` Dieter Wilhelm
@ 2013-04-07 17:35     ` Dieter Wilhelm
  2013-04-07 18:35       ` Nicolas Goaziou
  2013-04-07 18:32     ` Nicolas Goaziou
  1 sibling, 1 reply; 16+ messages in thread
From: Dieter Wilhelm @ 2013-04-07 17:35 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Hello,
>>
>> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>>
>>> before 8pre it was better possible to translate the Org/Emacs information in the
>>> postamble.  If I'm using
>>>
>>>  ("fr" "<p class=\"author\">Auteur: %a (%e)</p>\n<p class=\"date\">Date
>>>  de la modification: %d </p>\n<p class=\"creator\">Produit par %c
>>>  </p>\n")
>>>
>>> The result looks like:
>>>
>>> Produit par Generated by Org mode 8.0-pre in Emacs 24.3.3
>>>
>>> which also contradicts the documentation string of
>>> org-html-postamble-format...
>>
>> I fixed this. "%c" equals to `org-html-creator-string' (#+CREATOR:)
>> value. You are responsible for the translation.
>
> Thank you, you're very helpful.  
>
> Even though I'm not yet happy with this because the
> org-html-creator-string default:
>
> "Generated by <a href=\"http://orgmode.org\">Org</a> mode 8.0-pre in <a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."
>
> is in my opinion too much language dependent!  It requires the user who
> wants to translate the preamble to change 2 places,
> org-html-postamble-format *and* org-html-creator-string.
>
> Why not simply making org-html-creator-string "name oriented", like:
>
> "<a href=\"http://orgmode.org\">Org</a> mode 8.0-pre / <a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."
>
> Then one would be done with just translating
> org-html-postamble-format...
>
>>> By the way, I think the creation Time (%T) capability of the postamble
>>> is rather pointless, could you please change it to the modification time
>>> or add something (like %C)? This would save the hassle of putting
>>> everywhere #+DATE: {{{modification-time(%Y-%m-%d)}}} into the files.
>>> One could just change the %d to %C...
>>
>> I added %C.
>
> Thank you. 
>
> Works wonderfully for English, sorry I forgot the more general case.
> The default time string format has a day name included.  Wouldn't it be
> possible for the exporters to look for the language keyword e.g.:
> #+LANGUAGE: fr and set the time string translated accordingly?  I've no
> idea how much work it is but I imagine org asking the OS under some
> locale argument might do...
>
> Or just using a default time string format which is language
> independent, like %Y-%m-%d.

Shouldn't %C not adhere to org-export-date-timestamp-format
which is in fact "%Y-%m-%d"?

--
Sorry for the hassle

        Dieter


>>> Moreover, I think the documentation string is not really precise about
>>> the creation time.  We have on Linux atime, mtime and ctime (Access,
>>> Modification and in effect the inode "Change" time), probably the modern
>>> file systems store additionally the "true Creation" time.
>>
>> This was about the creation time of the /output/, which is, in fact, the
>> time of export. I changed the docstring to make it clear.
>
> Sorry for the confusion, now I understand.
>
> By the way, is it normal that org-html-postamble-format and
> org-html-creator-string are not loaded before an html export is
> triggered?

-- 
Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 16:26   ` Dieter Wilhelm
  2013-04-07 17:35     ` Dieter Wilhelm
@ 2013-04-07 18:32     ` Nicolas Goaziou
  2013-04-07 18:51       ` Rick Frankel
  2013-04-07 20:52       ` Dieter Wilhelm
  1 sibling, 2 replies; 16+ messages in thread
From: Nicolas Goaziou @ 2013-04-07 18:32 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: emacs-orgmode

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> Even though I'm not yet happy with this because the
> org-html-creator-string default:
>
> "Generated by <a href=\"http://orgmode.org\">Org</a> mode 8.0-pre in <a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."
>
> is in my opinion too much language dependent!  It requires the user who
> wants to translate the preamble to change 2 places,
> org-html-postamble-format *and* org-html-creator-string.
>
> Why not simply making org-html-creator-string "name oriented", like:
>
> "<a href=\"http://orgmode.org\">Org</a> mode 8.0-pre / <a
> href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."

Agreed. Done.

> Works wonderfully for English, sorry I forgot the more general case.
> The default time string format has a day name included.  Wouldn't it be
> possible for the exporters to look for the language keyword e.g.:
> #+LANGUAGE: fr and set the time string translated accordingly?  I've no
> idea how much work it is but I imagine org asking the OS under some
> locale argument might do...

This is no trivial task. Patches welcome. ;)

> Or just using a default time string format which is language
> independent, like %Y-%m-%d.

There's `org-html--timestamp-format', which is used for all timestamps
in preamble, postamble and metadata. It's clearly an internal variable.
I don't know if it is used because the format is required or because it
saves copying over the same format string.

Since I don't know the intent behind this, I can't tell if it could be
made a defcustom.

> By the way, is it normal that org-html-postamble-format and
> org-html-creator-string are not loaded before an html export is
> triggered?

Yes, by default, the export framework is not loaded at startup (as
specified in `org-export-backends'). You can use `eval-after-load' or
simply (require 'ox-html) if needed.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 17:35     ` Dieter Wilhelm
@ 2013-04-07 18:35       ` Nicolas Goaziou
  0 siblings, 0 replies; 16+ messages in thread
From: Nicolas Goaziou @ 2013-04-07 18:35 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: emacs-orgmode

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

>> Or just using a default time string format which is language
>> independent, like %Y-%m-%d.
>
> Shouldn't %C not adhere to org-export-date-timestamp-format
> which is in fact "%Y-%m-%d"?

`org-export-date-timestamp-format' is, as the docstring says, specific
to the DATE keyword. I'd rather not overload it with an orthogonal use.

> Sorry for the hassle

Don't.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 18:32     ` Nicolas Goaziou
@ 2013-04-07 18:51       ` Rick Frankel
  2013-04-07 19:00         ` Nicolas Goaziou
  2013-04-07 20:52       ` Dieter Wilhelm
  1 sibling, 1 reply; 16+ messages in thread
From: Rick Frankel @ 2013-04-07 18:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Dieter Wilhelm, emacs-orgmode

On Sun, Apr 07, 2013 at 08:32:34PM +0200, Nicolas Goaziou wrote:
> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
> > Or just using a default time string format which is language
> > independent, like %Y-%m-%d.
> 
> There's `org-html--timestamp-format', which is used for all timestamps
> in preamble, postamble and metadata. It's clearly an internal variable.
> I don't know if it is used because the format is required or because it
> saves copying over the same format string.
> 
> Since I don't know the intent behind this, I can't tell if it could be
> made a defcustom.

It was created just localize the definition. I see no reason not to
make it a defcustom.

rick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 18:51       ` Rick Frankel
@ 2013-04-07 19:00         ` Nicolas Goaziou
  2013-04-09  1:55           ` Rick Frankel
                             ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Nicolas Goaziou @ 2013-04-07 19:00 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

Hello,

Rick Frankel <rick@rickster.com> writes:

> On Sun, Apr 07, 2013 at 08:32:34PM +0200, Nicolas Goaziou wrote:
>> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>> > Or just using a default time string format which is language
>> > independent, like %Y-%m-%d.
>> 
>> There's `org-html--timestamp-format', which is used for all timestamps
>> in preamble, postamble and metadata. It's clearly an internal variable.
>> I don't know if it is used because the format is required or because it
>> saves copying over the same format string.
>> 
>> Since I don't know the intent behind this, I can't tell if it could be
>> made a defcustom.
>
> It was created just localize the definition. I see no reason not to
> make it a defcustom.

Then what about this patch?


Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html-Add-defcustom-for-timestamps-in-metadata.patch --]
[-- Type: text/x-patch, Size: 3386 bytes --]

From 91283eedf89bd8b74b68f127737478a7a9b4d670 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Sun, 7 Apr 2013 20:59:26 +0200
Subject: [PATCH] ox-html: Add defcustom for timestamps in metadata

* lisp/ox-html.el (org-html-metadata-timestamp-format): New variable,
  renamed from `org-html--timestamp-format'.
(org-html--build-meta-info, org-html-format-spec,
org-html--build-pre/postamble): Use new variable.
---
 lisp/ox-html.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index d09cc0f..3fe97dd 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -136,10 +136,6 @@
 (defvar org-html-format-table-no-css)
 (defvar htmlize-buffer-places)  ; from htmlize.el
 
-(defvar org-html--timestamp-format "%Y-%m-%d %a %H:%M"
-  "FORMAT used by `format-time-string' for timestamps in
-preamble, postamble and metadata.")
-
 (defvar org-html--pre/postamble-class "status"
   "CSS class used for pre/postamble")
 
@@ -912,6 +908,14 @@ org-info.js for your website."
 	       (list :tag "Postamble" (const :format "" postamble)
 		     (string :tag "     id") (string :tag "element"))))
 
+(defcustom org-html-metadata-timestamp-format "%Y-%m-%d %a %H:%M"
+  "Format used for timestamps in preamble, postamble and metadata.
+See `format-time-string' for more information on its components."
+  :group 'org-export-html
+  :version "24.4"
+  :package-version '(Org . "8.0")
+  :type 'string)
+
 ;;;; Template :: Mathjax
 
 (defcustom org-html-mathjax-options
@@ -1432,7 +1436,7 @@ INFO is a plist used as a communication channel."
      (format
       (when :time-stamp-file
 	(format-time-string
-	 (concat "<!-- " org-html--timestamp-format " -->\n"))))
+	 (concat "<!-- " org-html-metadata-timestamp-format " -->\n"))))
      (format
       "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>\n"
       (or (and org-html-coding-system
@@ -1500,7 +1504,7 @@ INFO is a plist used as a communication channel."
 used in the preamble or postamble."
   `((?t . ,(org-export-data (plist-get info :title) info))
     (?d . ,(org-export-data (org-export-get-date info) info))
-    (?T . ,(format-time-string org-html--timestamp-format))
+    (?T . ,(format-time-string org-html-metadata-timestamp-format))
     (?a . ,(org-export-data (plist-get info :author) info))
     (?e . ,(mapconcat
 	    (lambda (e)
@@ -1509,7 +1513,7 @@ used in the preamble or postamble."
 	    ", "))
     (?c . ,(plist-get info :creator))
     (?C . ,(let ((file (plist-get info :input-file)))
-	     (format-time-string org-html--timestamp-format
+	     (format-time-string org-html-metadata-timestamp-format
 				 (if file (nth 5 (file-attributes file))
 				   (current-time)))))
     (?v . ,(or org-html-validation-link ""))))
@@ -1552,10 +1556,9 @@ communication channel."
 		      (format
 		       "<p class=\"date\">%s: %s</p>\n"
 		       (org-html--translate "Created" info)
-		       (format-time-string org-html--timestamp-format)))
+		       (format-time-string org-html-metadata-timestamp-format)))
 		    (when (plist-get info :with-creator)
-		      (format "<p class=\"creator\">%s</p>\n"
-			      creator))
+		      (format "<p class=\"creator\">%s</p>\n" creator))
 		    (format "<p class=\"xhtml-validation\">%s</p>\n"
 			    validation-link))))
 		(t (format-spec
-- 
1.8.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 18:32     ` Nicolas Goaziou
  2013-04-07 18:51       ` Rick Frankel
@ 2013-04-07 20:52       ` Dieter Wilhelm
  1 sibling, 0 replies; 16+ messages in thread
From: Dieter Wilhelm @ 2013-04-07 20:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>> Why not simply making org-html-creator-string "name oriented", like:
>>
>> "<a href=\"http://orgmode.org\">Org</a> mode 8.0-pre / <a
>> href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.3.3."
>
> Agreed. Done.

Wonderful, now I'm receiving:

  Emacs 24.3.3 (Org mode 8.0-pre) 

Which is fine for me, I respect your decision but I really think you are
too humble here.  It was first and foremost created by Org (within
mighty Emacs of course :-)), thus:

  "Org mode 8.0-pre (Emacs 24.3.3)"

Thank you for your work.

>> Works wonderfully for English, sorry I forgot the more general case.
>> The default time string format has a day name included.  Wouldn't it be
>> possible for the exporters to look for the language keyword e.g.:
>> #+LANGUAGE: fr and set the time string translated accordingly?  I've no
>> idea how much work it is but I imagine org asking the OS under some
>> locale argument might do...
>
> This is no trivial task. Patches welcome. ;)

Autsch 8-)

>> By the way, is it normal that org-html-postamble-format and
>> org-html-creator-string are not loaded before an html export is
>> triggered?
>
> Yes, by default, the export framework is not loaded at startup (as
> specified in `org-export-backends'). You can use `eval-after-load' or
> simply (require 'ox-html) if needed.

Good, everything is fine.  Thanks for the confirmation.
-- 
      Dieter

Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 19:00         ` Nicolas Goaziou
@ 2013-04-09  1:55           ` Rick Frankel
  2013-04-10 12:44             ` Nicolas Goaziou
  2013-04-09  5:46           ` Some %elements in org-html-postamble-format became too "generous" Dieter Wilhelm
  2013-04-10 18:13           ` Dieter Wilhelm
  2 siblings, 1 reply; 16+ messages in thread
From: Rick Frankel @ 2013-04-09  1:55 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Dieter Wilhelm, emacs-orgmode

On Sun, Apr 07, 2013 at 09:00:27PM +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Rick Frankel <rick@rickster.com> writes:
> 
> > On Sun, Apr 07, 2013 at 08:32:34PM +0200, Nicolas Goaziou wrote:
> >> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
> >> > Or just using a default time string format which is language
> >> > independent, like %Y-%m-%d.
> >> 
> >> There's `org-html--timestamp-format', which is used for all timestamps
> >> in preamble, postamble and metadata. It's clearly an internal variable.
> >> I don't know if it is used because the format is required or because it
> >> saves copying over the same format string.
> >> 
> >> Since I don't know the intent behind this, I can't tell if it could be
> >> made a defcustom.
> >
> > It was created just localize the definition. I see no reason not to
> > make it a defcustom.
> 
> Then what about this patch?

Works for me.

rick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 19:00         ` Nicolas Goaziou
  2013-04-09  1:55           ` Rick Frankel
@ 2013-04-09  5:46           ` Dieter Wilhelm
  2013-04-09  9:54             ` Bastien
  2013-04-10 18:13           ` Dieter Wilhelm
  2 siblings, 1 reply; 16+ messages in thread
From: Dieter Wilhelm @ 2013-04-09  5:46 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Then what about this patch?

Could someone please point me to the docu for applying patches within
Emails.  I think Bastien has written about keyboard shortcuts for doing
this but I can't find his Email...

--
Thanks


>
> Regards,
>
> -- 
> Nicolas Goaziou
> From 91283eedf89bd8b74b68f127737478a7a9b4d670 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <n.goaziou@gmail.com>
> Date: Sun, 7 Apr 2013 20:59:26 +0200
> Subject: [PATCH] ox-html: Add defcustom for timestamps in metadata
>
> * lisp/ox-html.el (org-html-metadata-timestamp-format): New variable,
>   renamed from `org-html--timestamp-format'.
> (org-html--build-meta-info, org-html-format-spec,
> org-html--build-pre/postamble): Use new variable.
> ---
>  lisp/ox-html.el | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index d09cc0f..3fe97dd 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -136,10 +136,6 @@
>  (defvar org-html-format-table-no-css)
>  (defvar htmlize-buffer-places)  ; from htmlize.el
>  
> -(defvar org-html--timestamp-format "%Y-%m-%d %a %H:%M"
> -  "FORMAT used by `format-time-string' for timestamps in
> -preamble, postamble and metadata.")
> -
>  (defvar org-html--pre/postamble-class "status"
>    "CSS class used for pre/postamble")
>  
> @@ -912,6 +908,14 @@ org-info.js for your website."
>  	       (list :tag "Postamble" (const :format "" postamble)
>  		     (string :tag "     id") (string :tag "element"))))
>  
> +(defcustom org-html-metadata-timestamp-format "%Y-%m-%d %a %H:%M"
> +  "Format used for timestamps in preamble, postamble and metadata.
> +See `format-time-string' for more information on its components."
> +  :group 'org-export-html
> +  :version "24.4"
> +  :package-version '(Org . "8.0")
> +  :type 'string)
> +
>  ;;;; Template :: Mathjax
>  
>  (defcustom org-html-mathjax-options
> @@ -1432,7 +1436,7 @@ INFO is a plist used as a communication channel."
>       (format
>        (when :time-stamp-file
>  	(format-time-string
> -	 (concat "<!-- " org-html--timestamp-format " -->\n"))))
> +	 (concat "<!-- " org-html-metadata-timestamp-format " -->\n"))))
>       (format
>        "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>\n"
>        (or (and org-html-coding-system
> @@ -1500,7 +1504,7 @@ INFO is a plist used as a communication channel."
>  used in the preamble or postamble."
>    `((?t . ,(org-export-data (plist-get info :title) info))
>      (?d . ,(org-export-data (org-export-get-date info) info))
> -    (?T . ,(format-time-string org-html--timestamp-format))
> +    (?T . ,(format-time-string org-html-metadata-timestamp-format))
>      (?a . ,(org-export-data (plist-get info :author) info))
>      (?e . ,(mapconcat
>  	    (lambda (e)
> @@ -1509,7 +1513,7 @@ used in the preamble or postamble."
>  	    ", "))
>      (?c . ,(plist-get info :creator))
>      (?C . ,(let ((file (plist-get info :input-file)))
> -	     (format-time-string org-html--timestamp-format
> +	     (format-time-string org-html-metadata-timestamp-format
>  				 (if file (nth 5 (file-attributes file))
>  				   (current-time)))))
>      (?v . ,(or org-html-validation-link ""))))
> @@ -1552,10 +1556,9 @@ communication channel."
>  		      (format
>  		       "<p class=\"date\">%s: %s</p>\n"
>  		       (org-html--translate "Created" info)
> -		       (format-time-string org-html--timestamp-format)))
> +		       (format-time-string org-html-metadata-timestamp-format)))
>  		    (when (plist-get info :with-creator)
> -		      (format "<p class=\"creator\">%s</p>\n"
> -			      creator))
> +		      (format "<p class=\"creator\">%s</p>\n" creator))
>  		    (format "<p class=\"xhtml-validation\">%s</p>\n"
>  			    validation-link))))
>  		(t (format-spec

-- 
Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-09  5:46           ` Some %elements in org-html-postamble-format became too "generous" Dieter Wilhelm
@ 2013-04-09  9:54             ` Bastien
  0 siblings, 0 replies; 16+ messages in thread
From: Bastien @ 2013-04-09  9:54 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: emacs-orgmode, Nicolas Goaziou

Hi Dieter,

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>> Then what about this patch?
>
> Could someone please point me to the docu for applying patches within
> Emails.  I think Bastien has written about keyboard shortcuts for doing
> this but I can't find his Email...

1. Save the patch (your.patch)
2. go to your org-mode directory
3. git apply your.patch

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-09  1:55           ` Rick Frankel
@ 2013-04-10 12:44             ` Nicolas Goaziou
  2013-04-10 13:15               ` [PATCH] org-contacts.el, add alias properties Feng Shu
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-04-10 12:44 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: emacs-orgmode

Hello,

Rick Frankel <rick@rickster.com> writes:

> On Sun, Apr 07, 2013 at 09:00:27PM +0200, Nicolas Goaziou wrote:
>> Hello,
>> 
>> Rick Frankel <rick@rickster.com> writes:
>> 
>> > On Sun, Apr 07, 2013 at 08:32:34PM +0200, Nicolas Goaziou wrote:
>> >> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>> >> > Or just using a default time string format which is language
>> >> > independent, like %Y-%m-%d.
>> >> 
>> >> There's `org-html--timestamp-format', which is used for all timestamps
>> >> in preamble, postamble and metadata. It's clearly an internal variable.
>> >> I don't know if it is used because the format is required or because it
>> >> saves copying over the same format string.
>> >> 
>> >> Since I don't know the intent behind this, I can't tell if it could be
>> >> made a defcustom.
>> >
>> > It was created just localize the definition. I see no reason not to
>> > make it a defcustom.
>> 
>> Then what about this patch?
>
> Works for me.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] org-contacts.el, add alias properties
  2013-04-10 12:44             ` Nicolas Goaziou
@ 2013-04-10 13:15               ` Feng Shu
  2013-04-10 13:18                 ` Bastien
  0 siblings, 1 reply; 16+ messages in thread
From: Feng Shu @ 2013-04-10 13:15 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: 0001-org-contacts.el-add-name-alias-property.patch --]
[-- Type: text/x-diff, Size: 1451 bytes --]

From 27f65b3939ca60ec7abf7d066b3aadfff44396a8 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Wed, 10 Apr 2013 21:05:15 +0800
Subject: [PATCH] org-contacts.el, add name alias property.

* contrib/lisp/org-contacts.el (org-contacts-alias-property): add new
  varible
  (org-contacts-matcher): add org-contacts-alias-property to this list

Name alias is a very useful feature, especially for CJK users.
---
 contrib/lisp/org-contacts.el |    7 +++++++
 1 个文件被修改,插入 7 行(+)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 65eeea8..a3c4aed 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -81,6 +81,12 @@ When set to nil, all your Org files will be used."
   :type 'string
   :group 'org-contacts)
 
+(defcustom org-contacts-alias-property "ALIAS"
+  "Name of the property for contact name alias."
+  :type 'string
+  :group 'org-contacts)
+
+
 (defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
   "Format of the anniversary agenda entry.
 The following replacements are available:
@@ -129,6 +135,7 @@ The following replacements are available:
 
 (defcustom org-contacts-matcher
   (mapconcat 'identity (list org-contacts-email-property
+			     org-contacts-alias-property
 			     org-contacts-tel-property
 			     org-contacts-address-property
 			     org-contacts-birthday-property)
-- 
1.7.10.4


[-- Attachment #2: Type: text/plain, Size: 6 bytes --]



-- 

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] org-contacts.el, add alias properties
  2013-04-10 13:15               ` [PATCH] org-contacts.el, add alias properties Feng Shu
@ 2013-04-10 13:18                 ` Bastien
  0 siblings, 0 replies; 16+ messages in thread
From: Bastien @ 2013-04-10 13:18 UTC (permalink / raw)
  To: Feng Shu; +Cc: emacs-orgmode

Hi Feng,

Feng Shu <tumashu@gmail.com> writes:

> From 27f65b3939ca60ec7abf7d066b3aadfff44396a8 Mon Sep 17 00:00:00 2001
> From: Feng Shu <tumashu@gmail.com>
> Date: Wed, 10 Apr 2013 21:05:15 +0800
> Subject: [PATCH] org-contacts.el, add name alias property.
>
> * contrib/lisp/org-contacts.el (org-contacts-alias-property): add new
>   varible
>   (org-contacts-matcher): add org-contacts-alias-property to this list

Applied, thanks.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Some %elements in org-html-postamble-format became too "generous"
  2013-04-07 19:00         ` Nicolas Goaziou
  2013-04-09  1:55           ` Rick Frankel
  2013-04-09  5:46           ` Some %elements in org-html-postamble-format became too "generous" Dieter Wilhelm
@ 2013-04-10 18:13           ` Dieter Wilhelm
  2 siblings, 0 replies; 16+ messages in thread
From: Dieter Wilhelm @ 2013-04-10 18:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Rick Frankel <rick@rickster.com> writes:
>
>> On Sun, Apr 07, 2013 at 08:32:34PM +0200, Nicolas Goaziou wrote:
>>> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>>> > Or just using a default time string format which is language
>>> > independent, like %Y-%m-%d.
>>> 
>>> There's `org-html--timestamp-format', which is used for all timestamps
>>> in preamble, postamble and metadata. It's clearly an internal variable.
>>> I don't know if it is used because the format is required or because it
>>> saves copying over the same format string.
>>> 
>>> Since I don't know the intent behind this, I can't tell if it could be
>>> made a defcustom.
>>
>> It was created just localize the definition. I see no reason not to
>> make it a defcustom.
>
> Then what about this patch?

It works like a charm, thanks

--
        Dieter

>
> Regards,
>
> -- 
> Nicolas Goaziou
> From 91283eedf89bd8b74b68f127737478a7a9b4d670 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <n.goaziou@gmail.com>
> Date: Sun, 7 Apr 2013 20:59:26 +0200
> Subject: [PATCH] ox-html: Add defcustom for timestamps in metadata
>
> * lisp/ox-html.el (org-html-metadata-timestamp-format): New variable,
>   renamed from `org-html--timestamp-format'.
> (org-html--build-meta-info, org-html-format-spec,
> org-html--build-pre/postamble): Use new variable.
> ---
>  lisp/ox-html.el | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index d09cc0f..3fe97dd 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -136,10 +136,6 @@
>  (defvar org-html-format-table-no-css)
>  (defvar htmlize-buffer-places)  ; from htmlize.el
>  
> -(defvar org-html--timestamp-format "%Y-%m-%d %a %H:%M"
> -  "FORMAT used by `format-time-string' for timestamps in
> -preamble, postamble and metadata.")
> -
>  (defvar org-html--pre/postamble-class "status"
>    "CSS class used for pre/postamble")
>  
> @@ -912,6 +908,14 @@ org-info.js for your website."
>  	       (list :tag "Postamble" (const :format "" postamble)
>  		     (string :tag "     id") (string :tag "element"))))
>  
> +(defcustom org-html-metadata-timestamp-format "%Y-%m-%d %a %H:%M"
> +  "Format used for timestamps in preamble, postamble and metadata.
> +See `format-time-string' for more information on its components."
> +  :group 'org-export-html
> +  :version "24.4"
> +  :package-version '(Org . "8.0")
> +  :type 'string)
> +
>  ;;;; Template :: Mathjax
>  
>  (defcustom org-html-mathjax-options
> @@ -1432,7 +1436,7 @@ INFO is a plist used as a communication channel."
>       (format
>        (when :time-stamp-file
>  	(format-time-string
> -	 (concat "<!-- " org-html--timestamp-format " -->\n"))))
> +	 (concat "<!-- " org-html-metadata-timestamp-format " -->\n"))))
>       (format
>        "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>\n"
>        (or (and org-html-coding-system
> @@ -1500,7 +1504,7 @@ INFO is a plist used as a communication channel."
>  used in the preamble or postamble."
>    `((?t . ,(org-export-data (plist-get info :title) info))
>      (?d . ,(org-export-data (org-export-get-date info) info))
> -    (?T . ,(format-time-string org-html--timestamp-format))
> +    (?T . ,(format-time-string org-html-metadata-timestamp-format))
>      (?a . ,(org-export-data (plist-get info :author) info))
>      (?e . ,(mapconcat
>  	    (lambda (e)
> @@ -1509,7 +1513,7 @@ used in the preamble or postamble."
>  	    ", "))
>      (?c . ,(plist-get info :creator))
>      (?C . ,(let ((file (plist-get info :input-file)))
> -	     (format-time-string org-html--timestamp-format
> +	     (format-time-string org-html-metadata-timestamp-format
>  				 (if file (nth 5 (file-attributes file))
>  				   (current-time)))))
>      (?v . ,(or org-html-validation-link ""))))
> @@ -1552,10 +1556,9 @@ communication channel."
>  		      (format
>  		       "<p class=\"date\">%s: %s</p>\n"
>  		       (org-html--translate "Created" info)
> -		       (format-time-string org-html--timestamp-format)))
> +		       (format-time-string org-html-metadata-timestamp-format)))
>  		    (when (plist-get info :with-creator)
> -		      (format "<p class=\"creator\">%s</p>\n"
> -			      creator))
> +		      (format "<p class=\"creator\">%s</p>\n" creator))
>  		    (format "<p class=\"xhtml-validation\">%s</p>\n"
>  			    validation-link))))
>  		(t (format-spec

-- 
Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-04-10 18:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-07 11:52 Some %elements in org-html-postamble-format became too "generous" Dieter Wilhelm
2013-04-07 13:04 ` Nicolas Goaziou
2013-04-07 16:26   ` Dieter Wilhelm
2013-04-07 17:35     ` Dieter Wilhelm
2013-04-07 18:35       ` Nicolas Goaziou
2013-04-07 18:32     ` Nicolas Goaziou
2013-04-07 18:51       ` Rick Frankel
2013-04-07 19:00         ` Nicolas Goaziou
2013-04-09  1:55           ` Rick Frankel
2013-04-10 12:44             ` Nicolas Goaziou
2013-04-10 13:15               ` [PATCH] org-contacts.el, add alias properties Feng Shu
2013-04-10 13:18                 ` Bastien
2013-04-09  5:46           ` Some %elements in org-html-postamble-format became too "generous" Dieter Wilhelm
2013-04-09  9:54             ` Bastien
2013-04-10 18:13           ` Dieter Wilhelm
2013-04-07 20:52       ` Dieter Wilhelm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).