emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* feature request: individual markups for active and inactive time stamps on export
@ 2011-06-30 15:49 Eric S Fraga
  2011-06-30 21:38 ` [PATCH] " Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-06-30 15:49 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I would like to request a new feature for the latex export
functionality: would it be possible to have different markups for active
versus inactive time stamps?  It should be straightforward, having
looked at the code in

file:~/git/org-mode/lisp/org-latex.el::(defun org-export-latex-time-stamps ()

but my elisp is not quite up to the challenge... <blush>

I guess all that is needed is a new customisable variable (and possibly
renaming the existing one: org-export-latex-timestamp-markup) and a
simple (if inactive ... ...) bit of code?  It's the easy identification
of inactive versus active using the existing regexps that I cannot
easily do!

Thanks and apologies for having to ask for such a trivial addition,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.511.g2b7d)

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

* [PATCH] individual markups for active and inactive time stamps on export
  2011-06-30 15:49 feature request: individual markups for active and inactive time stamps on export Eric S Fraga
@ 2011-06-30 21:38 ` Eric S Fraga
  2011-07-01  9:04   ` [Accepted] " Bastien Guerry
  2011-07-01  9:04   ` [PATCH] " Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Eric S Fraga @ 2011-06-30 21:38 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello again,

okay, I will answer my own post with a possible solution to my feature
request earlier today.  

Attached is a patch that does the job; whether it is elegant enough or
not is another question.  I've not addressed the documentation at all
yet.  I will wait to see what the response to this simple patch might
be...

Thanks,
eric


* Allow for a different markup for inactive time stamps on latex export


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Allow for a different markup for inactive time stamps on latex export --]
[-- Type: text/x-diff, Size: 1048 bytes --]

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 1baa5f9..694f65b 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -292,6 +292,11 @@ markup defined, the first one in the association list will be used."
   :group 'org-export-latex
   :type 'string)
 
+(defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}"
+  "A printf format string to be applied to inactive time stamps."
+  :group 'org-export-latex
+  :type 'string)
+
 (defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
   "A printf format string to be applied to time stamps."
   :group 'org-export-latex
@@ -1613,7 +1618,9 @@ links, keywords, lists, tables, fixed-width"
       (org-if-unprotected-at (1- (point))
        (replace-match
 	(org-export-latex-protect-string
-	 (format org-export-latex-timestamp-markup
+	 (format (if (string= "<" (substring (match-string 0) 0 1))
+		     org-export-latex-timestamp-markup
+		   org-export-latex-timestamp-inactive-markup)
 		 (substring (org-translate-time (match-string 0)) 1 -1)))
 	t t)))))
 

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.525.gd6fb5.dirty)

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

* [Accepted] individual markups for active and inactive time stamps on export
  2011-06-30 21:38 ` [PATCH] " Eric S Fraga
@ 2011-07-01  9:04   ` Bastien Guerry
  2011-07-01  9:11     ` Eric S Fraga
  2011-07-01  9:04   ` [PATCH] " Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien Guerry @ 2011-07-01  9:04 UTC (permalink / raw)
  To: emacs-orgmode

Patch 816 (http://patchwork.newartisans.com/patch/816/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C874o373spj.fsf%40ucl.ac.uk%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] individual markups for active and inactive time stamps on export
> Date: Fri, 01 Jul 2011 02:38:48 -0000
> From: Eric S Fraga <e.fraga@ucl.ac.uk>
> X-Patchwork-Id: 816
> Message-Id: <874o373spj.fsf@ucl.ac.uk>
> To: emacs-orgmode@gnu.org
> 
> Hello again,
> 
> okay, I will answer my own post with a possible solution to my feature
> request earlier today.  
> 
> Attached is a patch that does the job; whether it is elegant enough or
> not is another question.  I've not addressed the documentation at all
> yet.  I will wait to see what the response to this simple patch might
> be...
> 
> Thanks,
> eric
> 
> 
> * Allow for a different markup for inactive time stamps on latex export
> 
> 
> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
> index 1baa5f9..694f65b 100644
> --- a/lisp/org-latex.el
> +++ b/lisp/org-latex.el
> @@ -292,6 +292,11 @@ markup defined, the first one in the association list will be used."
>    :group 'org-export-latex
>    :type 'string)
>  
> +(defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}"
> +  "A printf format string to be applied to inactive time stamps."
> +  :group 'org-export-latex
> +  :type 'string)
> +
>  (defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
>    "A printf format string to be applied to time stamps."
>    :group 'org-export-latex
> @@ -1613,7 +1618,9 @@ links, keywords, lists, tables, fixed-width"
>        (org-if-unprotected-at (1- (point))
>         (replace-match
>  	(org-export-latex-protect-string
> -	 (format org-export-latex-timestamp-markup
> +	 (format (if (string= "<" (substring (match-string 0) 0 1))
> +		     org-export-latex-timestamp-markup
> +		   org-export-latex-timestamp-inactive-markup)
>  		 (substring (org-translate-time (match-string 0)) 1 -1)))
>  	t t)))))
>  
> 

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

* Re: [PATCH] individual markups for active and inactive time stamps on export
  2011-06-30 21:38 ` [PATCH] " Eric S Fraga
  2011-07-01  9:04   ` [Accepted] " Bastien Guerry
@ 2011-07-01  9:04   ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2011-07-01  9:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi Eric,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> okay, I will answer my own post with a possible solution to my feature
> request earlier today.  
>
> Attached is a patch that does the job; whether it is elegant enough or
> not is another question.  I've not addressed the documentation at all
> yet.  I will wait to see what the response to this simple patch might
> be...

thanks, applied!

-- 
 Bastien

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

* Re: [Accepted] individual markups for active and inactive time stamps on export
  2011-07-01  9:04   ` [Accepted] " Bastien Guerry
@ 2011-07-01  9:11     ` Eric S Fraga
  0 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2011-07-01  9:11 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: emacs-orgmode

Bastien Guerry <bzg@altern.org> writes:

> Patch 816 (http://patchwork.newartisans.com/patch/816/) is now
> "Accepted".

Thanks!  I'll have a go at updating the documentation.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.530.g23bb.dirty)

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

end of thread, other threads:[~2011-07-01  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 15:49 feature request: individual markups for active and inactive time stamps on export Eric S Fraga
2011-06-30 21:38 ` [PATCH] " Eric S Fraga
2011-07-01  9:04   ` [Accepted] " Bastien Guerry
2011-07-01  9:11     ` Eric S Fraga
2011-07-01  9:04   ` [PATCH] " Bastien

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).