[O] new (LaTeX) exporter and date formatting

2012-05-23 Thread Andreas Leha
Hi all,

I am exporting a document containing dates like this inactive one
[2011-10-17 Mo].

I do not want to change the displaying of dates in org mode (as that
breaks indentation and point movement).  But I'd like this to be
exported as Mo, 17.10.2011.  How do I do that?

I found
,
| org-e-latex-inactive-timestamp-format is a variable defined in 
`org-e-latex.el'.
| Its value is \\textit{%s}
`
but I have no idea what to change that to or whether that is the correct
place to achieve the different data format at all.

Side note:
Ideally, in my opinion, the LaTeX-exporter would honor the
#+LANGUAGE: XX
setting and change the babel-settings accordingly and offer the option
to format the date/time-stamps differently for different languages.


Regards,
Andreas




Re: [O] How to get Wrap at Window Edge in org-mode?

2012-05-23 Thread Carsten Dominik

On May 22, 2012, at 7:21 PM, Bastien wrote:

 Hi Marius,
 
 Marius Hofert marius.hof...@math.ethz.ch writes:
 
 I am working with Xubuntu 12.04 on a MacBook Air (4,1) with org-mode version
 7.8.09. I use the following code to get Wrap at Window Edge in
 org-agenda-mode:
 
 ,
 | (add-hook 'org-agenda-mode-hook
 |  '(lambda()
 | (if truncate-lines (toggle-truncate-lines -1))
 | ))
 `
 
 How can I get Wrap at Window Edge in all .org files?
 
 (setq org-startup-truncated nil)

The a reason why Org does wrap by default is to keep tables and code segments 
in good shape.  It would be nice if line truncation could be set locally with 
text properties, but that is currently not the case.

- Carsten

 
 HTH,
 
 -- 
 Bastien
 

- Carsten






[O] Problem with org-agenda-custom-commands after update to 7.8.10

2012-05-23 Thread Loris Bennett
Hi,

I have just updated to 7.8.10 from the last stable version and now find
that whereas 

(tags-todo +office+CATEGORY=\task\|+office+CATEGORY=\project\ 
 ((org-agenda-overriding-header Office TODOs)))

used to work, it now no longer does.  The section Office TODOs appears
in the agenda but without any todos.

Any ideas?
-- 
Loris






[O] new LaTeX exporter hook

2012-05-23 Thread Andreas Leha
Hi all,

the new LaTeX exporter does not seem to run the
org-export-latex-final-hook.  Is there an equivalent?

Cheers,
Andreas




[O] Problem Installing Info Files

2012-05-23 Thread Ian Barton

When I run make install I am getting the following error:

make -C doc install
make[1]: Entering directory `/home/ian/Dropbox/.emacs.d/src/org-mode/doc'
if [ ! -d ~/.emacs.d/src/info ]; then mkdir -p ~/.emacs.d/src/info; else 
true; fi ;

install -p org ~/.emacs.d/src/info
install-info --infodir=~/.emacs.d/src/info org
~/.emacs.d/src/info/dir: could not read (No such file or directory) and 
could not create (No such file or directory)

make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/ian/Dropbox/.emacs.d/src/org-mode/doc'
make: *** [install-doc] Error 2


The ~/.emacs.d/src/info exists and is writable. The file 
/.emacs.d/src/org-mode/doc/org exists and looks like an info file. I 
have install-info installed.


Running:

install-info --infodir=~/.emacs.d/src/info org

from the directory containing org gives the following error:

~/.emacs.d/src/info/dir: could not read (No such file or directory) and 
could not create (No such file or directory)


However, the org info file is copied into the directory. So it appears 
to be a problem with install-info. I have now run out of ideas.


Ian.




Re: [O] Problem with org-agenda-custom-commands after update to 7.8.10

2012-05-23 Thread Bastien
Hi Loris,

Loris Bennett loris.benn...@fu-berlin.de writes:

 I have just updated to 7.8.10 from the last stable version and now find
 that whereas 

 (tags-todo +office+CATEGORY=\task\|+office+CATEGORY=\project\ 
  ((org-agenda-overriding-header Office TODOs)))

 used to work, it now no longer does.  The section Office TODOs appears
 in the agenda but without any todos.

Fixed in the maint and master branches.

This important fix will be part of 7.8.11, to be released before the 
week-end.

Thanks,

-- 
 Bastien



Re: [O] Strange Custom Agenda Problem

2012-05-23 Thread Bastien
Hi Mike,

Mike McLean mike.mcl...@pobox.com writes:

 I have attached a minimal Org Mode setup that replicates this
 problem. The files are minimal-org.el and test.org. The lisp file is
 the minimum configuration for org-mode and the org-file is a
 simplified test file.

Thanks a lot for this.  

I finally fixed this, please test and confirm.

-- 
 Bastien



Re: [O] Strange Custom Agenda Problem

2012-05-23 Thread Bastien
Hi Laurynas,

Laurynas Biveinis laurynas.bivei...@gmail.com writes:

 I am also experiencing strange issues with custom agenda commands
 after I upgraded to 7.8.10 (not sure if from 7.8.09 - I might have
 skipped a version or two).

 In my case the negative tag selection stopped working in tags-todo. For 
 example,
 project-somedaymaybe/!TODO
 works as if it were
 project+somedaymaybe/!TODO

this should be fixed now -- please have a pull and let me know.

Best,

-- 
 Bastien



Re: [O] Using Org for a dissertation - appendices

2012-05-23 Thread Bastien
Hi Suvayu,

suvayu ali fatkasuvayu+li...@gmail.com writes:

 On Mon, May 21, 2012 at 9:08 AM, Henri-Paul Indiogine
 hindiog...@gmail.com wrote:
 The LaTeX export of course does not know the that last chapter should
 contain the appendices.  I have tried to insert several LaTeX commands
 in the orgmode file, but I could not make it work.

 This might help:

 http://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents/10305270#10305270

If there is anything useful from the link above that should
be added to Worg, please let us know.

Thanks!

-- 
 Bastien



Re: [O] Problem Installing Info Files

2012-05-23 Thread Jude DaShiell
Try:
sudo make .install-info while in the org directory and see what happens. 
On Wed, 23 May 2012, Ian Barton wrote:

 When I run make install I am getting the following error:
 
 make -C doc install
 make[1]: Entering directory `/home/ian/Dropbox/.emacs.d/src/org-mode/doc'
 if [ ! -d ~/.emacs.d/src/info ]; then mkdir -p ~/.emacs.d/src/info; else true;
 fi ;
 install -p org ~/.emacs.d/src/info
 install-info --infodir=~/.emacs.d/src/info org
 ~/.emacs.d/src/info/dir: could not read (No such file or directory) and could
 not create (No such file or directory)
 make[1]: *** [install] Error 1
 make[1]: Leaving directory `/home/ian/Dropbox/.emacs.d/src/org-mode/doc'
 make: *** [install-doc] Error 2
 
 
 The ~/.emacs.d/src/info exists and is writable. The file
 /.emacs.d/src/org-mode/doc/org exists and looks like an info file. I have
 install-info installed.
 
 Running:
 
 install-info --infodir=~/.emacs.d/src/info org
 
 from the directory containing org gives the following error:
 
 ~/.emacs.d/src/info/dir: could not read (No such file or directory) and could
 not create (No such file or directory)
 
 However, the org info file is copied into the directory. So it appears to be a
 problem with install-info. I have now run out of ideas.
 
 Ian.
 
 
 
 


Jude jdashiel-at-shellworld-dot-net
http://www.shellworld.net/~jdashiel/nj.html




Re: [O] Using Org for a dissertation - appendices

2012-05-23 Thread suvayu ali
Hi Bastien,

On Wed, May 23, 2012 at 12:19 PM, Bastien b...@gnu.org wrote:

 http://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents/10305270#10305270

 If there is anything useful from the link above that should
 be added to Worg, please let us know.

Well its just my customisation that lets me include Appendices and a
Bibliography in the regular org document tree for latex export. However
I have not ported my customisation to the new export engine.

For the last few months (and the coming month or two) I have been
extremely busy. When I have time I can write-up nicely for Worg and put
it in org-hacks (under LaTeX export). However if someone else could do
it earlier, you are welcome to give it a shot. :) I think the SO answer
is complete enough and can be included almost as is (except for the
missing new exporter changes). In any case, once there is an entry it
can be refined endlessly. :)

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Problem Installing Info Files

2012-05-23 Thread Ian Barton

On 23/05/12 11:19, Jude DaShiell wrote:

Try:
sudo make .install-info while in the org directory and see what happens.
On Wed, 23 May 2012, Ian Barton wrote:


When I run make install I am getting the following error:

make -C doc install
make[1]: Entering directory `/home/ian/Dropbox/.emacs.d/src/org-mode/doc'
if [ ! -d ~/.emacs.d/src/info ]; then mkdir -p ~/.emacs.d/src/info; else true;
fi ;
install -p org ~/.emacs.d/src/info
install-info --infodir=~/.emacs.d/src/info org
~/.emacs.d/src/info/dir: could not read (No such file or directory) and could
not create (No such file or directory)
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/ian/Dropbox/.emacs.d/src/org-mode/doc'
make: *** [install-doc] Error 2


The ~/.emacs.d/src/info exists and is writable. The file
/.emacs.d/src/org-mode/doc/org exists and looks like an info file. I have
install-info installed.

Running:

install-info --infodir=~/.emacs.d/src/info org

from the directory containing org gives the following error:

~/.emacs.d/src/info/dir: could not read (No such file or directory) and could
not create (No such file or directory)

However, the org info file is copied into the directory. So it appears to be a
problem with install-info. I have now run out of ideas.

Ian.


Thanks, tried that but got same error. In any case the directory is 
owned by me, so it shouldn't be a permission problem.





Re: [O] Problem Installing Info Files

2012-05-23 Thread suvayu ali
Hello Ian,

On Wed, May 23, 2012 at 12:11 PM, Ian Barton li...@wilkesley.net wrote:
 from the directory containing org gives the following error:

 ~/.emacs.d/src/info/dir: could not read (No such file or directory) and
 could not create (No such file or directory)

I think your info setup is a bit different. It would help if you could
describe it briefly. In any case, I would recommend you take a look at
this FAQ; maybe the answer is already there. :)

http://orgmode.org/worg/org-faq.html#update-info-manual-to-latest

GL

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Strange Custom Agenda Problem

2012-05-23 Thread Mike McLean
On May 23, 2012, at 6:17 AM, Bastien wrote:

 Hi Mike,
 
 Mike McLean mike.mcl...@pobox.com writes:
 
 I have attached a minimal Org Mode setup that replicates this
 problem. The files are minimal-org.el and test.org. The lisp file is
 the minimum configuration for org-mode and the org-file is a
 simplified test file.
 
 Thanks a lot for this.  
 
 I finally fixed this, please test and confirm.

I can confirm that this fixes my full block agenda where I first noticed the 
problem.

Org-mode version 7.8.10 (release_7.8.10-587-g31aa82 @ 
/Users/mlm/.emacs.d/el-get/org-mode/lisp/)
(without my branch to revert  
[[http://orgmode.org/w/?p%3Dorg-mode.git%3Ba%3Dcommit%3Bh%3Dc50f0c][Commit 
c50f0c]])

Thanks for the fix.

I really need to start leaning the Org-Mode code base, especially seeing how 
simple this fix was.

Mike




Re: [O] new LaTeX exporter hook

2012-05-23 Thread Jambunathan K
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi all,

 the new LaTeX exporter does not seem to run the
 org-export-latex-final-hook.  Is there an equivalent?

You are looking for `:filter-final-output' within
`org-export-filters-alist'.

I have defcustom that runs indent-region on final html output.  Here is
the relevant sections from org-e-html together with it's final section.

Adopt this example to e-latex case.

(defconst org-e-html-filters-alist
  '((:filter-final-output . org-e-html-final-function))
  Alist between filters keywords and back-end specific filters.
See `org-export-filters-alist' for more information.)

(defun org-e-html-final-function (contents backend info)
  (if (not org-e-html-pretty-output) contents
(with-temp-buffer
  (nxml-mode)
  (insert contents)
  (indent-region (point-min) (point-max))
  (buffer-substring-no-properties (point-min) (point-max)

(defcustom org-e-html-pretty-output nil
  Enable this to generate pretty HTML.
  :group 'org-export-e-html
  :type 'boolean)



 Cheers,
 Andreas




-- 



Re: [O] HTML export of inline tasks

2012-05-23 Thread Jambunathan K
Manish mailtomanish.sha...@gmail.com writes:

 Out of curiosity I tried ODT export and that produces weird results for
 inlinetasks. Does it work for you?

Provide an example.  I will fix it.
-- 



[O] doi proxy , a test patch

2012-05-23 Thread Fabrice Pardo

Hi,

My institution library permits direct access to abstracts
with pdf contents if we access to article through an address like 
http://dx.doi.org.my.instituti.on/... instead of http://dx.doi.org/...


In the attached patch, I have defined a new variable org-doi-proxy
which can be customized by the user.

diff --git a/lisp/org.el b/lisp/org.el
index 05f5375..c5d17a9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1838,6 +1838,10 @@ For more examples, see the system specific constants
 			(string :tag Command)
 			(sexp :tag Lisp form)
 
+(defcustom org-doi-proxy http://dx.doi.org/;
+  The doi proxy
+  :group 'org-link-follow
+  :type 'string)
 
 
 (defgroup org-refile nil
@@ -9714,7 +9718,7 @@ application the system uses for this file type.
 	 path
 
 	 ((string= type doi)
-	  (browse-url (concat http://dx.doi.org/; (if (org-string-match-p [[:nonascii:] ] path)
+	  (browse-url (concat org-doi-proxy (if (org-string-match-p [[:nonascii:] ] path)
 		   (org-link-escape
 			path org-link-escape-chars-browser)
 		 path


Re: [O] Comments break lists when exporting to TeX

2012-05-23 Thread Nicolas Goaziou
Hello,

Daniel Schoepe dan...@schoepe.org writes:

 while trying to include a source file in a list element via #+INCLUDE, I
 discovered the following behavior: A comment between two list elements breaks
 the list into two lists when exporting. For example:

 * Test
   - This is a list element.
 # This isn't.
   - This is another list element.

At the moment you insert text at column 0, the list ends.  You can use
inline comments (i.e. #+ This isn't) instead.

 I think it makes sense for comments to have no effect on this (i.e. it
 should behave the same during export as if it wasn't there), so I
 consider this a bug.

I do not. Export is consistent with in-buffer behaviour. You have
created two lists here, not one, and it has nothing to do with export.


Regards,

-- 
Nicolas Goaziou



Re: [O] doi proxy , a test patch

2012-05-23 Thread Jambunathan K

Is there a way one can avoid the defcustom and achieve the same effect
using link abbreviations? I don't know.

  (info (org) Link abbreviations)


Fabrice Pardo fabrice.pa...@lpn.cnrs.fr writes:

 Hi,

 My institution library permits direct access to abstracts
 with pdf contents if we access to article through an address like
 http://dx.doi.org.my.instituti.on/... instead of http://dx.doi.org/...

 In the attached patch, I have defined a new variable org-doi-proxy
 which can be customized by the user.

 diff --git a/lisp/org.el b/lisp/org.el
 index 05f5375..c5d17a9 100644
 --- a/lisp/org.el
 +++ b/lisp/org.el
 @@ -1838,6 +1838,10 @@ For more examples, see the system specific constants
   (string :tag Command)
   (sexp :tag Lisp form)
  
 +(defcustom org-doi-proxy http://dx.doi.org/;
 +  The doi proxy
 +  :group 'org-link-follow
 +  :type 'string)
  
  
  (defgroup org-refile nil
 @@ -9714,7 +9718,7 @@ application the system uses for this file type.
path
  
((string= type doi)
 -   (browse-url (concat http://dx.doi.org/; (if (org-string-match-p 
 [[:nonascii:] ] path)
 +   (browse-url (concat org-doi-proxy (if (org-string-match-p 
 [[:nonascii:] ] path)
  (org-link-escape
   path 
 org-link-escape-chars-browser)
path


-- 



Re: [O] Strange Custom Agenda Problem

2012-05-23 Thread Bastien
Mike McLean mike.mcl...@pobox.com writes:

 Thanks for the fix.

You're welcome.

 I really need to start leaning the Org-Mode code base, especially
 seeing how simple this fix was.

The fix was easy but finding the problem was not, because I assumed 
the existing regexp (prior to commit c50f0c) was okay while it was
not.  Those kind of things are too easily overlooked!

Glad I found it, and surprised it didn't yield other problems so far.

-- 
 Bastien



Re: [O] new LaTeX exporter hook

2012-05-23 Thread Nicolas Goaziou
Hello,

Jambunathan K kjambunat...@gmail.com writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 the new LaTeX exporter does not seem to run the
 org-export-latex-final-hook.  Is there an equivalent?

 You are looking for `:filter-final-output' within
 `org-export-filters-alist'.

 I have defcustom that runs indent-region on final html output.  Here is
 the relevant sections from org-e-html together with it's final section.

 Adopt this example to e-latex case.

 (defconst org-e-html-filters-alist
   '((:filter-final-output . org-e-html-final-function))
   Alist between filters keywords and back-end specific filters.
 See `org-export-filters-alist' for more information.)

 (defun org-e-html-final-function (contents backend info)
   (if (not org-e-html-pretty-output) contents
 (with-temp-buffer
   (nxml-mode)
   (insert contents)
   (indent-region (point-min) (point-max))
   (buffer-substring-no-properties (point-min) (point-max)

 (defcustom org-e-html-pretty-output nil
   Enable this to generate pretty HTML.
   :group 'org-export-e-html
   :type 'boolean)

Jambunathan is right.  Though, for completeness, I'll add that, as an
end-user, you shouldn't mess with `org-e-html-filters-alist'.  You can
add your filter to `org-export-filter-final-output-functions' instead.

Since this variable is back-end agnostic, your filter will probably have
to check the back-end first. Also, remember this is the functional
counterpart of hooks: the return value of your function will be used as
the new output. Thus, be sure it doesn't return nil.

Example follows:

#+begin_src emacs-lisp
(defun my-e-latex-final-filter (contents backend info)
  (if (not (eq backend 'e-latex)) contents
...
modify contents
...
new-contents))
#+end_src


Regards,

-- 
Nicolas Goaziou



Re: [O] Comments break lists when exporting to TeX

2012-05-23 Thread Daniel Schoepe
On Wed, 23.05.2012 14:21, Nicolas Goaziou wrote:
 At the moment you insert text at column 0, the list ends.  You can use
 inline comments (i.e. #+ This isn't) instead.

This however, does not solve my original problem, since it doesn't work
with #+INCLUDE (with version 7.8.09):

* Test
  - This will not indent the code properly as a part of the list element
#+INCLUDE foo.c src c
  - This will print #+INCLUDE .. literally:
#+INCLUDE foo.c src c
  - This works as expected:
  #+BEGIN_SRC c
  contents of foo.c
  #+END_SRC

Of course I could fall back to something like \lstlistinginput, but that
works only for TeX-export and hence defeats the whole point of
result-format-agnostic directives such as #+INCLUDE (at least when it's
used for source files).

 I do not. Export is consistent with in-buffer behaviour. You have
 created two lists here, not one, and it has nothing to do with export.

I find it odd for a comment to have such an effect on the semantics of
the document. My intuition about comments (that aren't special
directives) is that they have no effect on the final result (the PDF in
this case, or the binary in the case of compilable source code).

I think what I'm saying is that the comment shouldn't break up the lists
in the buffer either, but I don't have any strong feelings about this,
as long I can get #+INCLUDE to work in list elements. (But it would be a
nice, general rule that would allow #+INCLUDE to work as expected.
Another alternative would be to make all such directives also work when
they're not at column 0).

Cheers,
Daniel


pgpkmMn1GC4ou.pgp
Description: PGP signature


Re: [O] doi proxy , a test patch

2012-05-23 Thread Christian Moe

I think so.

I find DOI links simplify life a great deal in any case:

(setq org-link-abbrev-alist
   '((doi . http://dx.doi.org/;)))

e.g. doi:10.1016/j.jphysparis.2011.09.011

(Simply replace dx.doi.org with any privileged access point your 
institution might have)


Yours,
Christian

On 5/23/12 2:27 PM, Jambunathan K wrote:


Is there a way one can avoid the defcustom and achieve the same effect
using link abbreviations? I don't know.

   (info (org) Link abbreviations)


Fabrice Pardofabrice.pa...@lpn.cnrs.fr  writes:


Hi,

My institution library permits direct access to abstracts
with pdf contents if we access to article through an address like
http://dx.doi.org.my.instituti.on/... instead of http://dx.doi.org/...

In the attached patch, I have defined a new variable org-doi-proxy
which can be customized by the user.

diff --git a/lisp/org.el b/lisp/org.el
index 05f5375..c5d17a9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1838,6 +1838,10 @@ For more examples, see the system specific constants
(string :tag Command)
(sexp :tag Lisp form)

+(defcustom org-doi-proxy http://dx.doi.org/;
+  The doi proxy
+  :group 'org-link-follow
+  :type 'string)


  (defgroup org-refile nil
@@ -9714,7 +9718,7 @@ application the system uses for this file type.
 path

 ((string= type doi)
- (browse-url (concat http://dx.doi.org/; (if (org-string-match-p 
[[:nonascii:] ] path)
+ (browse-url (concat org-doi-proxy (if (org-string-match-p [[:nonascii:] 
] path)
   (org-link-escape
path 
org-link-escape-chars-browser)
 path








[O] Adding Easy Templates

2012-05-23 Thread Daniel E . Doherty
All,

I really like the Easy Template facility, and would like to add some of
my own.  However, I am having trouble with the elisp syntax.  I would
like to add a couple in my init file, but am having no luck.  Here is
what I have now:
=
  (eval-after-load 'org
(progn
  (add-to-list 'org-structure-template-alist
   (list '(m #+begin_src emacs-lisp\n?\n#+end_src)))
  (add-to-list 'org-structure-template-alist
   (list '(j 
#+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote)
=
Which yeilds:
=
Debugger entered--Lisp error: (invalid-function ((j #+begin_quote
||Dr|Cr|
|-
|?|$||
|||$|
#+end_quote)))
=


I have also tried this:
=
  (eval-after-load 'org
(progn
  (add-to-list 'org-structure-template-alist
   '(m #+begin_src emacs-lisp\n?\n#+end_src))
  (add-to-list 'org-structure-template-alist
   '(j 
#+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
=
Which spits out a similar error.  I am quoting the list, so I don't
understand why elisp is interpteting it as a function.  In the first
case, I even quote it twice.

Any help?

Thanks.

Dan Doherty



Re: [O] new (LaTeX) exporter and date formatting

2012-05-23 Thread Nicolas Goaziou
Hello,

Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 I am exporting a document containing dates like this inactive one
 [2011-10-17 Mo].

 I do not want to change the displaying of dates in org mode (as that
 breaks indentation and point movement).  But I'd like this to be
 exported as Mo, 17.10.2011.  How do I do that?

 I found
 ,
 | org-e-latex-inactive-timestamp-format is a variable defined in 
 `org-e-latex.el'.
 | Its value is \\textit{%s}
 `
 but I have no idea what to change that to or whether that is the correct
 place to achieve the different data format at all.

Since you want to change contents, and not only markup, this isn't the
correct place.

You can either add a filter in `org-export-filter-timestamp-functions',
or implement your own function to handle timestamp objects. If you
choose the latter, you can install the function in
`org-e-latex-translate-alist' to overwrite current latex exporter
behaviour, or use `org-export-define-derived-backend' to implement your
own back-end.

Assuming you want to overwrite current behaviour, something along the
lines of the following (untested) should do the work:

#+begin_src emacs-lisp
(defun my-e-latex-timestamp (timestamp contents info)
  (let ((value (org-translate-time (org-element-property :value timestamp
(setq value
  (replace-regexp-in-string
   org-ts-regexp1
   (lambda (text)
 (concat (save-match-data (org-trim (match-string 5 value))) , 
 (substring text 0 (1- (match-beginning 5)))
 (substring text (match-end 5
   value))
(case (org-element-property :type timestamp)
  ((active active-range) (format org-e-latex-active-timestamp-format value))
  ((inactive inactive-range)
   (format org-e-latex-inactive-timestamp-format value))
  (otherwise (format org-e-latex-diary-timestamp-format value)

(add-to-list 'org-e-latex-translate-alist 'my-e-latex-timestamp)
#+end_src

 Side note:
 Ideally, in my opinion, the LaTeX-exporter would honor the
 #+LANGUAGE: XX
 setting and change the babel-settings accordingly

That seems reasonable. Is there any translation table between language
symbols and Babel options?

 and offer the option to format the date/time-stamps differently for
 different languages.

I won't bother doing this, but export engine internals probably permit
it.


Regards,

-- 
Nicolas Goaziou



Re: [O] Adding Easy Templates

2012-05-23 Thread Carsten Dominik
Hi Daniel,

you need to quote the entire form, i.e. the progn;

 (eval-after-load 'org
   '(progn
 (add-to-list 'org-structure-template-alist
  '(m #+begin_src emacs-lisp\n?\n#+end_src))
 (add-to-list 'org-structure-template-alist
  '(j 
#+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote

This is because the entire form is stored for execution after loading org - but 
in your case it was
evaluated immediately...

- Carsten

On May 23, 2012, at 3:10 PM, Daniel E. Doherty wrote:

 All,
 
 I really like the Easy Template facility, and would like to add some of
 my own.  However, I am having trouble with the elisp syntax.  I would
 like to add a couple in my init file, but am having no luck.  Here is
 what I have now:
 =
  (eval-after-load 'org
(progn
  (add-to-list 'org-structure-template-alist
   (list '(m #+begin_src emacs-lisp\n?\n#+end_src)))
  (add-to-list 'org-structure-template-alist
   (list '(j 
 #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote)
 =
 Which yeilds:
 =
 Debugger entered--Lisp error: (invalid-function ((j #+begin_quote
 ||Dr|Cr|
 |-
 |?|$||
 |||$|
 #+end_quote)))
 =
 
 
 I have also tried this:
 =
  (eval-after-load 'org
(progn
  (add-to-list 'org-structure-template-alist
   '(m #+begin_src emacs-lisp\n?\n#+end_src))
  (add-to-list 'org-structure-template-alist
   '(j 
 #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
 =
 Which spits out a similar error.  I am quoting the list, so I don't
 understand why elisp is interpteting it as a function.  In the first
 case, I even quote it twice.
 
 Any help?
 
 Thanks.
 
 Dan Doherty
 

- Carsten






Re: [O] Adding Easy Templates

2012-05-23 Thread Nick Dokos
Daniel E. Doherty ded-...@ddoherty.net wrote:

 I have also tried this:
 =
   (eval-after-load 'org
 (progn
   (add-to-list 'org-structure-template-alist
'(m #+begin_src emacs-lisp\n?\n#+end_src))
   (add-to-list 'org-structure-template-alist
'(j 
 #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
 =
 Which spits out a similar error.  I am quoting the list, so I don't
 understand why elisp is interpteting it as a function.  In the first
 case, I even quote it twice.
 

I presume that it spits out the error when you try to *use* the template,
correct? You can add anything you want to org-structure-template-alist, but
if you try to *use* the thing, it'd better have the correct format.

In any case, the above (without the call to ``list'') is the correct
form, but the elements to add are *three*-element lists: (key
standard text muse text). If you don't care about org-mtags (see the
doc for org-structure-template-alist), just add an empty string as the
third element.

Untried but hope it works,
Nick



Re: [O] Problem Installing Info Files

2012-05-23 Thread Ian Barton

On 23/05/12 11:35, suvayu ali wrote:

Hello Ian,

On Wed, May 23, 2012 at 12:11 PM, Ian Bartonli...@wilkesley.net  wrote:

from the directory containing org gives the following error:

~/.emacs.d/src/info/dir: could not read (No such file or directory) and
could not create (No such file or directory)


I think your info setup is a bit different. It would help if you could
describe it briefly. In any case, I would recommend you take a look at
this FAQ; maybe the answer is already there. :)

http://orgmode.org/worg/org-faq.html#update-info-manual-to-latest

GL



I have found the problem, the clue was in the error message:) When I was 
using Debian/Ubuntu I got fed up of trying to get the info file to 
install in the correct place. Using a large bit of duck tape, I put it in:


~/.emacs.d/src/info org

then defined the following key binding:

(global-set-key (kbd f9 i) (lambda ()
 (interactive)
 (info

~/dropbox/.emacs.d/src/org-mode/doc/org)))

Since this isn't an info directory it doesn't contain a dir file for 
install-info to update, so make-info complains.


I have now stuck some duck tape on the Makefile and changed make-info to 
a simple cp command to get the file into the place where I want it.


Ian.



Re: [O] Adding Easy Templates

2012-05-23 Thread Carsten Dominik

On May 23, 2012, at 3:28 PM, Carsten Dominik wrote:

 Hi Daniel,
 
 you need to quote the entire form, i.e. the progn;
 
 (eval-after-load 'org
   '(progn
 (add-to-list 'org-structure-template-alist
  '(m #+begin_src emacs-lisp\n?\n#+end_src))
 (add-to-list 'org-structure-template-alist
  '(j 
 #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
 
 This is because the entire form is stored for execution after loading org - 
 but in your case it was
 evaluated immediately...



so what happens is that the result of the second add-to-list command (that 
result is the extended list) is stored and then evaluated after org.el is 
loaded.  So at that point in time, Emacs tries to evaluate


((j ..

Which is of cause not valid because the first element in that list `(j ...' 
is not a function.

- Carsten


 
 - Carsten
 
 On May 23, 2012, at 3:10 PM, Daniel E. Doherty wrote:
 
 All,
 
 I really like the Easy Template facility, and would like to add some of
 my own.  However, I am having trouble with the elisp syntax.  I would
 like to add a couple in my init file, but am having no luck.  Here is
 what I have now:
 =
 (eval-after-load 'org
   (progn
 (add-to-list 'org-structure-template-alist
  (list '(m #+begin_src emacs-lisp\n?\n#+end_src)))
 (add-to-list 'org-structure-template-alist
  (list '(j 
 #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote)
 =
 Which yeilds:
 =
 Debugger entered--Lisp error: (invalid-function ((j #+begin_quote
 ||Dr|Cr|
 |-
 |?|$||
 |||$|
 #+end_quote)))
 =
 
 
 I have also tried this:
 =
 (eval-after-load 'org
   (progn
 (add-to-list 'org-structure-template-alist
  '(m #+begin_src emacs-lisp\n?\n#+end_src))
 (add-to-list 'org-structure-template-alist
  '(j 
 #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
 =
 Which spits out a similar error.  I am quoting the list, so I don't
 understand why elisp is interpteting it as a function.  In the first
 case, I even quote it twice.
 
 Any help?
 
 Thanks.
 
 Dan Doherty
 
 
 - Carsten
 
 
 

- Carsten






Re: [O] Comments break lists when exporting to TeX

2012-05-23 Thread Nicolas Goaziou
Hello,

Daniel Schoepe dan...@schoepe.org writes:

 * Test
   - This will not indent the code properly as a part of the list element
 #+INCLUDE foo.c src c
   - This will print #+INCLUDE .. literally:
 #+INCLUDE foo.c src c
   - This works as expected:
   #+BEGIN_SRC c
   contents of foo.c
   #+END_SRC

This should be #+INCLUDE: foo.c src c, not #+INCLUDE foo.c src c

 Of course I could fall back to something like \lstlistinginput, but that
 works only for TeX-export and hence defeats the whole point of
 result-format-agnostic directives such as #+INCLUDE (at least when it's
 used for source files).

 I do not. Export is consistent with in-buffer behaviour. You have
 created two lists here, not one, and it has nothing to do with export.

 I find it odd for a comment to have such an effect on the semantics
 of the document. My intuition about comments (that aren't special
 directives) is that they have no effect on the final result (the PDF
 in this case, or the binary in the case of compilable source code).

Note that INCLUDE keyword isn't a comment. Also, again, comments have no
effect on the final result: they are consistent with what happens within
buffer.

[...]

 as long I can get #+INCLUDE to work in list elements. (But it would be a
 nice, general rule that would allow #+INCLUDE to work as expected.
 Another alternative would be to make all such directives also work when
 they're not at column 0).

--8---cut here---start-8---
- This will print #+INCLUDE .. literally:
  #+INCLUDE: foo.c src c
--8---cut here---end---8---

This works as expected in the new exporter.


Regards,

-- 
Nicolas Goaziou



Re: [O] doi proxy , a test patch

2012-05-23 Thread Fabrice Pardo

Does it really achieve the same effect ?
Don't you need to use double square bracket
eg [[doi:10.1016/j.jphysparis.2011.09.011]]
instead of doi:10.1016/j.jphysparis.2011.09.011 ?

If I'm wrong please correct me, I'm a newbie.

My proposal is to customize the already defined doi External link,
which was hardcoded in org-open-at-point function.


On 12-05-23 03:04 PM, Christian Moe wrote:

I think so.

I find DOI links simplify life a great deal in any case:

(setq org-link-abbrev-alist
'((doi . http://dx.doi.org/;)))

e.g. doi:10.1016/j.jphysparis.2011.09.011

(Simply replace dx.doi.org with any privileged access point your
institution might have)

Yours,
Christian

On 5/23/12 2:27 PM, Jambunathan K wrote:


Is there a way one can avoid the defcustom and achieve the same effect
using link abbreviations? I don't know.

(info (org) Link abbreviations)


Fabrice Pardofabrice.pa...@lpn.cnrs.fr writes:


Hi,

My institution library permits direct access to abstracts
with pdf contents if we access to article through an address like
http://dx.doi.org.my.instituti.on/... instead of http://dx.doi.org/...

In the attached patch, I have defined a new variable org-doi-proxy
which can be customized by the user.

diff --git a/lisp/org.el b/lisp/org.el
index 05f5375..c5d17a9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1838,6 +1838,10 @@ For more examples, see the system specific
constants
(string :tag Command)
(sexp :tag Lisp form)

+(defcustom org-doi-proxy http://dx.doi.org/;
+ The doi proxy
+ :group 'org-link-follow
+ :type 'string)


(defgroup org-refile nil
@@ -9714,7 +9718,7 @@ application the system uses for this file type.
path

((string= type doi)
- (browse-url (concat http://dx.doi.org/; (if (org-string-match-p
[[:nonascii:] ] path)
+ (browse-url (concat org-doi-proxy (if (org-string-match-p
[[:nonascii:] ] path)
(org-link-escape
path org-link-escape-chars-browser)
path










Re: [O] Strange Custom Agenda Problem

2012-05-23 Thread Laurynas Biveinis
2012/5/23 Bastien b...@gnu.org:
 In my case the negative tag selection stopped working in tags-todo. For 
 example,
 project-somedaymaybe/!TODO
 works as if it were
 project+somedaymaybe/!TODO

 this should be fixed now -- please have a pull and let me know.

I did and can confirm the fix. Thanks!

-- 
Laurynas



Re: [O] doi proxy , a test patch

2012-05-23 Thread Christian Moe

Uhhh... no, it doesn't. Sorry about the noise!

(I've had that customization for a long time, and don't think I 
noticed that a hardcoded doi link type was introduced, so I didn't 
even test before posting.)


Yours,
Christian

On 5/23/12 5:12 PM, Fabrice Pardo wrote:

Does it really achieve the same effect ?
Don't you need to use double square bracket
eg [[doi:10.1016/j.jphysparis.2011.09.011]]
instead of doi:10.1016/j.jphysparis.2011.09.011 ?

If I'm wrong please correct me, I'm a newbie.

My proposal is to customize the already defined doi External link,
which was hardcoded in org-open-at-point function.


On 12-05-23 03:04 PM, Christian Moe wrote:

I think so.

I find DOI links simplify life a great deal in any case:

(setq org-link-abbrev-alist
'((doi . http://dx.doi.org/;)))

e.g. doi:10.1016/j.jphysparis.2011.09.011

(Simply replace dx.doi.org with any privileged access point your
institution might have)

Yours,
Christian

On 5/23/12 2:27 PM, Jambunathan K wrote:


Is there a way one can avoid the defcustom and achieve the same effect
using link abbreviations? I don't know.

(info (org) Link abbreviations)


Fabrice Pardofabrice.pa...@lpn.cnrs.fr writes:


Hi,

My institution library permits direct access to abstracts
with pdf contents if we access to article through an address like
http://dx.doi.org.my.instituti.on/... instead of
http://dx.doi.org/...

In the attached patch, I have defined a new variable org-doi-proxy
which can be customized by the user.

diff --git a/lisp/org.el b/lisp/org.el
index 05f5375..c5d17a9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1838,6 +1838,10 @@ For more examples, see the system specific
constants
(string :tag Command)
(sexp :tag Lisp form)

+(defcustom org-doi-proxy http://dx.doi.org/;
+ The doi proxy
+ :group 'org-link-follow
+ :type 'string)


(defgroup org-refile nil
@@ -9714,7 +9718,7 @@ application the system uses for this file
type.
path

((string= type doi)
- (browse-url (concat http://dx.doi.org/; (if (org-string-match-p
[[:nonascii:] ] path)
+ (browse-url (concat org-doi-proxy (if (org-string-match-p
[[:nonascii:] ] path)
(org-link-escape
path org-link-escape-chars-browser)
path














Re: [O] Adding Easy Templates

2012-05-23 Thread Daniel E . Doherty

Gentlemen:

For the record, I combined Carsten and Nick's suggestion, so here is
what I now have in my init file, and it works:

#+begin_src emacs-lisp
  (eval-after-load 'org
'(progn
  (add-to-list 'org-structure-template-alist
   '(m #+begin_src emacs-lisp\n?\n#+end_src ))
  (add-to-list 'org-structure-template-alist
   '(j
   #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
   
#+end_src

Carsten, I appreciate the explanation for why my quoting didn't work.  I
will now be adding many more of these Easy Templates to my init file,
they are a great shortcut.

Regards,


At Wed, 23 May 2012 15:35:23 +0200,
Carsten Dominik carsten.domi...@gmail.com wrote:
 
 
 On May 23, 2012, at 3:28 PM, Carsten Dominik wrote:
 
  Hi Daniel,
  
  you need to quote the entire form, i.e. the progn;
  
  (eval-after-load 'org
'(progn
  (add-to-list 'org-structure-template-alist
   '(m #+begin_src emacs-lisp\n?\n#+end_src))
  (add-to-list 'org-structure-template-alist
   '(j 
  #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
  
  This is because the entire form is stored for execution after loading org - 
  but in your case it was
  evaluated immediately...
 
 
 
 so what happens is that the result of the second add-to-list command (that 
 result is the extended list) is stored and then evaluated after org.el is 
 loaded.  So at that point in time, Emacs tries to evaluate
 
 
 ((j ..
 
 Which is of cause not valid because the first element in that list `(j ...' 
 is not a function.
 
 - Carsten
 
 
  
  - Carsten
  
  On May 23, 2012, at 3:10 PM, Daniel E. Doherty wrote:
  
  All,
  
  I really like the Easy Template facility, and would like to add some of
  my own.  However, I am having trouble with the elisp syntax.  I would
  like to add a couple in my init file, but am having no luck.  Here is
  what I have now:
  =
  (eval-after-load 'org
(progn
  (add-to-list 'org-structure-template-alist
   (list '(m #+begin_src emacs-lisp\n?\n#+end_src)))
  (add-to-list 'org-structure-template-alist
   (list '(j 
  #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote)
  =
  Which yeilds:
  =
  Debugger entered--Lisp error: (invalid-function ((j #+begin_quote
  ||Dr|Cr|
  |-
  |?|$||
  |||$|
  #+end_quote)))
  =
  
  
  I have also tried this:
  =
  (eval-after-load 'org
(progn
  (add-to-list 'org-structure-template-alist
   '(m #+begin_src emacs-lisp\n?\n#+end_src))
  (add-to-list 'org-structure-template-alist
   '(j 
  #+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote
  =
  Which spits out a similar error.  I am quoting the list, so I don't
  understand why elisp is interpteting it as a function.  In the first
  case, I even quote it twice.
  
  Any help?
  
  Thanks.
  
  Dan Doherty
  
  
  - Carsten
  
  
  
 
 - Carsten
 
 
 
 



Re: [O] doi proxy , a test patch

2012-05-23 Thread Jambunathan K

I know nothing about doi services.  From what you say, the proxy servers
are not inter-changeable.

For the sake of argument -

Can a given Org document contain links to two different doi proxies?  In
that case will a defcustom help.

Fabrice Pardo fabrice.pa...@lpn.cnrs.fr writes:

 Does it really achieve the same effect ?
 Don't you need to use double square bracket
 eg [[doi:10.1016/j.jphysparis.2011.09.011]]
 instead of doi:10.1016/j.jphysparis.2011.09.011 ?

 If I'm wrong please correct me, I'm a newbie.

 My proposal is to customize the already defined doi External link,
 which was hardcoded in org-open-at-point function.


 On 12-05-23 03:04 PM, Christian Moe wrote:
 I think so.

 I find DOI links simplify life a great deal in any case:

 (setq org-link-abbrev-alist
 '((doi . http://dx.doi.org/;)))

 e.g. doi:10.1016/j.jphysparis.2011.09.011

 (Simply replace dx.doi.org with any privileged access point your
 institution might have)

 Yours,
 Christian

 On 5/23/12 2:27 PM, Jambunathan K wrote:

 Is there a way one can avoid the defcustom and achieve the same effect
 using link abbreviations? I don't know.

 (info (org) Link abbreviations)


 Fabrice Pardofabrice.pa...@lpn.cnrs.fr writes:

 Hi,

 My institution library permits direct access to abstracts
 with pdf contents if we access to article through an address like
 http://dx.doi.org.my.instituti.on/... instead of http://dx.doi.org/...

 In the attached patch, I have defined a new variable org-doi-proxy
 which can be customized by the user.

 diff --git a/lisp/org.el b/lisp/org.el
 index 05f5375..c5d17a9 100644
 --- a/lisp/org.el
 +++ b/lisp/org.el
 @@ -1838,6 +1838,10 @@ For more examples, see the system specific
 constants
 (string :tag Command)
 (sexp :tag Lisp form)

 +(defcustom org-doi-proxy http://dx.doi.org/;
 + The doi proxy
 + :group 'org-link-follow
 + :type 'string)


 (defgroup org-refile nil
 @@ -9714,7 +9718,7 @@ application the system uses for this file type.
 path

 ((string= type doi)
 - (browse-url (concat http://dx.doi.org/; (if (org-string-match-p
 [[:nonascii:] ] path)
 + (browse-url (concat org-doi-proxy (if (org-string-match-p
 [[:nonascii:] ] path)
 (org-link-escape
 path org-link-escape-chars-browser)
 path







-- 



[O] PATCH: follow timestamp link also in heading

2012-05-23 Thread Ingo Lohmar
Hi there,

I stumbled upon the functionality to open the agenda for a timestamp
using org-open-at-point.  That is really sweet, but as it turns out, it
does not work in a headline (as of 7.8.10, with no changes to the
relevant code since then).  I cannot see a good reason for this, and it
is a one-line patch to fix it.  Sorry for not using the development
version proper, hence just a unified diff (below).

It would be great if this could be included!
Ingo



--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9606,6 +9606,7 @@
   (org-remove-occur-highlights nil nil t)
   (cond
((and (org-at-heading-p)
+(not (org-at-timestamp-p))
 (not (org-in-regexp
   (concat org-plain-link-re \\|
   org-bracket-link-regexp \\|



[O] Comments and control lines (# vs. #+)

2012-05-23 Thread Samuel Wales
The following, which is general and I wrote a long time ago,
might also be relevant to the recent thread on comments
breaking lists.

===

There might be really good reasons for the #+ comment
convention in Org, but I am not sure what they are.  So
please bear with me.

This list is not complete or minimal.  Please disregard the
items you don't like.

===

Here are some of the reasons I prefer # to #+ as a
consistent commenting scheme for Org.

  1) #+ is not as standard as #
  2) there are tools for commenting and uncommenting regions
 with #, but not with #+
  3) many users have their own tools that do not
 understand #+
  4) imported (or pasted) text will often have # commenting
 and this will need special processing to make it work
 with Org
  5) fill functions and packages often don't understand #+
  6) plain # works in column 0 in Org, leading to user
 expectation that it will behave consistently in other
 columns as it does in most other languages that use #
  7) parsing commented comments is more complicated and
 error-prone when both are used
  8) internal and external parsers might or might not expect
 a more standard commenting scheme.
  9) indented #+ is not colored as a comment or a control
 line
  10) it is natural to want to do a block comment on a
  section of a list without breaking list structure.
  there are built-in tools for this.
  11) it is natural to want to do an indented comment on a
  single list item at the same level of indentation as
  the bullet
  12) there are tools for auto-fill and indentation within
  comments that take into account # but not #+
  13) some parsers probably expect a single character
  14) internal and external parsers might want a
  special-case-free commenting scheme
  15) #+ indicates an Org control line, so using it for
  comments overloads the syntax

Hope it's of some use.

Thanks.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com



Re: [O] PATCH: follow timestamp link also in heading

2012-05-23 Thread Ingo Lohmar
Dammit.  Should work (as in normal text) with inactive timestamps as
well!  See below.

--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9606,6 +9606,7 @@
   (org-remove-occur-highlights nil nil t)
   (cond
((and (org-at-heading-p)
+(not (org-at-timestamp-p t))
 (not (org-in-regexp
   (concat org-plain-link-re \\|
   org-bracket-link-regexp \\|



[O] links in comments and footnotes

2012-05-23 Thread Samuel Wales
Apropos of a recent thread, how do you get links to show in Org files
when they are part of comments?  They take on comment face at present,
making it not possible to determine that they are comments.

Same thing with footnotes.

Thanks,

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com



Re: [O] links in comments and footnotes

2012-05-23 Thread Samuel Wales
On 5/23/12, Samuel Wales samolog...@gmail.com wrote:
 making it not possible to determine that they are comments.

s/comments/links/

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com



Re: [O] links in comments and footnotes

2012-05-23 Thread Nicolas Goaziou
Hello,

Samuel Wales samolog...@gmail.com writes:

 Apropos of a recent thread, how do you get links to show in Org files
 when they are part of comments?  They take on comment face at present,
 making it not possible to determine that they are comments.

 Same thing with footnotes.

I'm not sure to understand the question. But, there is nothing inside
comments. No link, no footnote.


Regards,

-- 
Nicolas Goaziou



Re: [O] links in comments and footnotes

2012-05-23 Thread Samuel Wales
When I comment something that has a link, the link stops being in link face.

When I kill a link and yank it into a footnote, the link stops being
in link face.

I want that not to happen if possible.

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com



Re: [O] links in comments and footnotes

2012-05-23 Thread Samuel Wales
Click on a link in a comment and you get surprised.

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com



Re: [O] links in comments and footnotes

2012-05-23 Thread Nicolas Goaziou
Samuel Wales samolog...@gmail.com writes:

 When I comment something that has a link, the link stops being in link
 face.

That's normal. If it's commented, the link shouldn't be recognized
anymore (but I suppose it sill is)

 When I kill a link and yank it into a footnote, the link stops being
 in link face.

That's another problem. Probably a bug, although a minor one.


Regards,

-- 
Nicolas Goaziou



[O] Rounding timeclock and moving to the end of the line

2012-05-23 Thread Kevin Buchs
Hello group.

This is my first contribution to this email list.

Having a need to do my clocking in 1/4-hour multiples, I went and fully
implemented my own solution in org-mode BEFORE I realized that org-mode was
already set up to do it - it was just not completely implemented. I needed
to change a few (current-time) in org-clock-in (org-clock.el) to be
(org-current-time) and it works like a charm.

Here are the changes based on the development sources cloned via git today:

1198c1198
 (/ (- (org-float-time (org-current-time))
---
 (/ (- (org-float-time (current-time))
1202c1202
 (org-current-time)))
---
 (current-time)))


I have filled out the paperwork with FSF to be a developer in
emacs/org-mode.

My next project is to solve the problem that C-e does not move to the end
of the line with long lines that are not headings. I find myself doing this
often and have to hit multiple C-e s. I don't have the org-special-ctrl-a/e
set to non-nil. My line-move-visual is the default value of t, so I get the
end-of-visual-line movement one screen's worth. Before I make any changes,
I thought I should be clear on the design goals here. It seems as if the
declaration of line-move-visual says it is dealing with vertical motion,
not horizontal motion. I don't see any behavior elsewhere that uses the
interpretation that line-move-visual is for horizontal motion. Anyone have
thoughts on this subject?

- Kevin Buchs


[O] Losing tabs when tangling or editing

2012-05-23 Thread Michael Hannon
Greetings.  I was trying to set up a little demo in which I included a
Makefile inside a sh source-code block in an Org-mode file, then tangled the
file and ran make on the tangled file (either in the actual shell or in
another sh block in Org).

It appears that Org is removing tabs when it tangles the file, and the lack of
tabs causes make to complain.

I've appended a toy example which exhibits the problem.  BTW, if I edit the
source block via C-c ' I also lose the tabs, i.e., even before tangling.

Any thoughts about this?

Thanks,

-- Mike


$ cat Makefile.original 
hw:    hw.cpp
    g++ -o hw hw.cpp

$ grep -P \t Makefile.original 
hw:    hw.cpp
    g++ -o hw hw.cpp

$ make -f Makefile.original 
g++ -o hw hw.cpp

$ ./hw
Hello, world!

$ \rm hw

$ cat hw.org
* test preservation of tabs when tangling

#+BEGIN_SRC sh :tangle Makefile.tangled

hw:    hw.cpp
    g++ -o hw hw.cpp

#+END_SRC

$ make -f Makefile.tangled
Makefile.tangled:3: *** missing separator (did you mean TAB instead of 8
spaces?).  Stop.



Re: [O] new (LaTeX) exporter and date formatting

2012-05-23 Thread Andreas Leha
Hi Nicolas,

 I am exporting a document containing dates like this inactive one
 [2011-10-17 Mo].

 I do not want to change the displaying of dates in org mode (as that
 breaks indentation and point movement).  But I'd like this to be
 exported as Mo, 17.10.2011.  How do I do that?


[...]


 You can either add a filter in `org-export-filter-timestamp-functions',
 or implement your own function to handle timestamp objects. If you
 choose the latter, you can install the function in
 `org-e-latex-translate-alist' to overwrite current latex exporter
 behaviour, or use `org-export-define-derived-backend' to implement your
 own back-end.

 Assuming you want to overwrite current behaviour, something along the
 lines of the following (untested) should do the work:

 #+begin_src emacs-lisp
 (defun my-e-latex-timestamp (timestamp contents info)
   (let ((value (org-translate-time (org-element-property :value timestamp
 (setq value
   (replace-regexp-in-string
org-ts-regexp1
(lambda (text)
  (concat (save-match-data (org-trim (match-string 5 value))) , 
  (substring text 0 (1- (match-beginning 5)))
  (substring text (match-end 5
value))
 (case (org-element-property :type timestamp)
   ((active active-range) (format org-e-latex-active-timestamp-format 
 value))
   ((inactive inactive-range)
(format org-e-latex-inactive-timestamp-format value))
   (otherwise (format org-e-latex-diary-timestamp-format value)

 (add-to-list 'org-e-latex-translate-alist 'my-e-latex-timestamp)
 #+end_src

Thanks a lot for that elaborate response.  It got me where I wanted to be!


 Side note:
 Ideally, in my opinion, the LaTeX-exporter would honor the
 #+LANGUAGE: XX
 setting and change the babel-settings accordingly

 That seems reasonable. Is there any translation table between language
 symbols and Babel options?

Not that I am aware of.  But we could start one quite easily.  I got
this list of LaTeX-babel supported languages from
http://www.tug.org/texlive/Contents/live/texmf-dist/doc/generic/babel/babel.pdf:
(just a quick hack...)

| LaTeX babel  | lang symbol |
|--+-|
| acadian  | ??  |
| albanian | sq  |
| afrikaans| af  |
| american | en-us   |
| australian   | en-au   |
| austrian | de-at   |
| bahasa   | ??  |
| indonesian   | id  |
| indon| ??  |
| bahasai  | ??  |
| malay| ms  |
| meyalu   | ??  |
| bahasam  | ??  |
| basque   | eu  |
| brazil   | bt-br   |
| brazilian| bt-br   |
| breton   | ??  |
| british  | en-gb   |
| bulgarian| bg  |
| canadian | en-ca   |
| canadien | fr-ca   |
| catalan  | ca  |
| croatian | hr  |
| czech| cs  |
| danish   | da  |
| dutch| nl  |
| english  | en  |
| esperanto| ??  |
| estonian | et  |
| finnish  | fi  |
| francais | fr  |
| frenchb  | fr  |
| french   | fr  |
| galician | gl  |
| german   | de  |
| germanb  | de  |
| greek| el  |
| hungarian| hu  |
| icelandic| is  |
| interlingua  | ??  |
| irish| en-ie   |
| italian  | it  |
| latin| la  |
| lowersorbian | sr  |
| magyar   | ??  |
| nagari   | ??  |
| naustrian| de-at   |
| newzealand   | en-nz   |
| ngerman  | de-de   |
| norsk| no-no   |
| samin| ??  |
| nynorsk  | no-no   |
| polish   | pl  |
| portuges | pt  |
| portuguese   | pt  |
| romanian | ro  |
| russian  | ru  |
| sanskrit | sa  |
| scottish | en-gb   |
| serbian  | sr  |
| slovak   | sk  |
| slovene  | sl  |
| spanish  | es  |
| swedish  | sv  |
| tamil| ta  |
| turkish  | tr  |
| ukrainian| uk  |
| uppersorbian | sb  |
| welsh| cy  |
| UKenglish| en-gb   |
| USenglish| en-us   |


Regards,
Andreas




Re: [O] new LaTeX exporter hook

2012-05-23 Thread Andreas Leha
Hi Jambunathan and Nicolas,


 the new LaTeX exporter does not seem to run the
 org-export-latex-final-hook.  Is there an equivalent?

 You are looking for `:filter-final-output' within
 `org-export-filters-alist'.


[...]


 Example follows:

 #+begin_src emacs-lisp
 (defun my-e-latex-final-filter (contents backend info)
   (if (not (eq backend 'e-latex)) contents
 ...
 modify contents
 ...
 new-contents))
 #+end_src



Thank you for your input!

Works nicely now (even if the hook system was slightly easier to
use...).

Cheers,
Andreas




[O] preview latex fragments

2012-05-23 Thread Andreas Leha
Hi all,

I experience a problem with the preview of latex fragments:  I can not
change the foreground color (in org-format-latex-options).  On a dark
background, the black fragments are barely visible.

The settings for background and scale (in the same variable) are
honored, though.

Is this a bug or some mis-configuration on my end?

Regards,
Andreas




Re: [O] Entities

2012-05-23 Thread Nicolas Goaziou
Hello,

Mark E. Shoulson m...@kli.org writes:

 There's a small bug in rendering the entities when org-pretty-entities
 is on (I get the feeling that org-pretty-entities is not a very
 commonly-used feature). The entities \sup1 \sup2 \sup3 and \there4 are
 not rendered properly. The regex detecting entities apparently doesn't
 catch numbers at the end, except for the special case of fractions. I've
 added the others to the special-casing and attach a patch for it; I
 hope I managed to include the changelog properly (is git format-patch -
 -attach the way to go?).

This looks good. You should add a title to your patch, like Fix
detection of entities ending with a number or org-entities: Add some
entities.

Also, please capitalize the word after the colons.

 Also attached is another patch that might or might not be useful.
 Sometimes it can be a problem when you can't type, say, asterisks
 around a word when you NEED asterisks around the word, not a boldface
 word (I'd been getting around it by using Unicode characters that look
 like asterisks, like ∗). The way to do it right is to use the \ast
 entity, which expands to the right thing but doesn't affect
 formatting. There's also already a \tilde entity, to allow putting in
 tildes without accidentally setting something verbatim. I added
 entities for the remaining markup characters: \plus, \under, \equal,
 and \slash. \under might be particularly handy when avoiding
 subscripting (which raises the question of if there should be an
 \asciicirc (or something) entity for ^ also).

I think they are all useful. Though, asciicirc already exists as circ.

Could you modify slightly your changelogs before I apply the patches?

Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Re: Can't make org-install.el

2012-05-23 Thread Achim Gratz
Sebastien Vauban writes:
 Though, after restarting Emacs, I do have:

 File mode specification error: (void-function org-find-library-dir)

Could you please specify how to elicit that particular message from an
'emacs -Q -nw' session?

 I see that there is no autoload cookie for it in `org-compat.el':
[...]
 Can a macro be autoloaded as well?

I don't think so (not in the same way a defun is autoloaded anyway).
But what do you need this for?


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] Smart quotes

2012-05-23 Thread Nicolas Goaziou
Hello,


Mark E. Shoulson m...@kli.org writes:

 Smart quotes can be annoying when they aren't smart enough. But when
 they work you can miss them. I'm attaching a patch that defines a
 custom variable org-smart-quotes (nil by default), which when non-nil
 causes the  and ' characters to display as “smart” quotes, hopefully
 the right ones. They're still ' and  in the underlying text, just
 overlaid with “”.

This is not related to entities, so code shouldn't be in org-entities.el.

Also, quotes are dependent on locale[fn:1]. English/US only quotes look
like a niche to me. Would it be possible to modify the patch and have
this feature handle LANGUAGE keyword, or at least have a support for it?


Regards,

[fn:1] https://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks

-- 
Nicolas Goaziou



Re: [O] Problem Installing Info Files

2012-05-23 Thread Achim Gratz
Ian Barton writes:
 I have found the problem, the clue was in the error message:) When I
 was using Debian/Ubuntu I got fed up of trying to get the info file to
 install in the correct place. Using a large bit of duck tape, I put
 it in:
[...]
 Since this isn't an info directory it doesn't contain a dir file for
 install-info to update, so make-info complains.

 I have now stuck some duck tape on the Makefile and changed make-info
 to a simple cp command to get the file into the place where I want
 it.

Why not remove the duck tape altogether and let 'make install' stick the
info file where it belongs?


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves




[O] [PATCH] Fix for displaying entities ending in a number

2012-05-23 Thread Mark E. Shoulson

On 05/23/2012 05:53 PM, Nicolas Goaziou wrote:

Hello,

Mark E. Shoulsonm...@kli.org  writes:


There's a small bug in rendering the entities when org-pretty-entities
is on (I get the feeling that org-pretty-entities is not a very
commonly-used feature). The entities \sup1 \sup2 \sup3 and \there4 are
not rendered properly. The regex detecting entities apparently doesn't
catch numbers at the end, except for the special case of fractions. I've
added the others to the special-casing and attach a patch for it; I
hope I managed to include the changelog properly (is git format-patch -
-attach the way to go?).

This looks good. You should add a title to your patch, like Fix
detection of entities ending with a number or org-entities: Add some
entities.

Also, please capitalize the word after the colons.


I was trying to copy the format seen in other patches on the list; I 
guess I missed some details.  I've set the subject of this thread as 
I've seen done with other patches, and I attach only a single patch, as 
requested by the website, and created the changelog with C-x 4 a and 
everything.  I hope I got it right.


Other patch follows under separate cover.



Could you modify slightly your changelogs before I apply the patches?

Thank you.


Regards,



From 9b8e1b56c5c60720f985ea2b26952702c6c730a6 Mon Sep 17 00:00:00 2001
From: Mark Shoulson m...@kli.org
Date: Wed, 23 May 2012 20:17:40 -0400
Subject: [PATCH] Fix for displaying entities ending in a number

* lisp/org.el (org-fontify-entities): Fix bug: The entities \sup[123] and
  \there4 were not prettified when org-pretty-entities was enabled.

TINYCHANGE
---
 lisp/org.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0b00851..c44c7ab 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5966,7 +5966,7 @@ needs to be inserted at a specific position in the font-lock sequence.)
 (when org-pretty-entities
   (catch 'match
 	(while (re-search-forward
-		\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)
+		\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)
 		limit t)
 	  (if (and (not (org-in-indented-comment-line))
 		   (setq ee (org-entity-get (match-string 1)))
-- 
1.7.7.6



[O] [PATCH] Add entities for /, +, _, =

2012-05-23 Thread Mark E. Shoulson

On 05/23/2012 05:53 PM, Nicolas Goaziou wrote:

Hello,

Mark E. Shoulsonm...@kli.org  writes:

Also attached is another patch that might or might not be useful.
Sometimes it can be a problem when you can't type, say, asterisks
around a word when you NEED asterisks around the word, not a boldface
word (I'd been getting around it by using Unicode characters that look
like asterisks, like ∗). The way to do it right is to use the \ast
entity, which expands to the right thing but doesn't affect
formatting. There's also already a \tilde entity, to allow putting in
tildes without accidentally setting something verbatim. I added
entities for the remaining markup characters: \plus, \under, \equal,
and \slash. \under might be particularly handy when avoiding
subscripting (which raises the question of if there should be an
\asciicirc (or something) entity for ^ also).

I think they are all useful. Though, asciicirc already exists as circ.


I hadn't counted \circ because it expands under Unicode to ˆ (U+02C6) 
and not to the true ascii circumflex ^ (U+005E); the point of these 
entities is to represent ascii characters that otherwise would confuse 
things.  Maybe \circ should expand to ^; maybe there should be another 
entity for it (maybe neither).


Anyway; attaching the relevant patch (changelog tweaked), once again 
hoping I got the formatting and everything right.


~mark

From 4d6c4ccc90fd181f446ff4c7d56f5c980ec9d940 Mon Sep 17 00:00:00 2001
From: Mark Shoulson m...@kli.org
Date: Wed, 23 May 2012 21:53:35 -0400
Subject: [PATCH] Add entities for /, +, _, =

* org-entities.el (org-entities): Add new entities for characters
  which could cause formatting changes if typed directly.
---
 lisp/org-entities.el |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index 8b5b3f3..fce3b68 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -260,6 +260,10 @@ loaded, add these packages to `org-export-latex-packages-alist'.
 (lt \\textless{} nil lt;   )
 (gt \\textgreater{} nil gt;   )
 (tilde \\~{} nil tilde; ~ ~ ~)
+(slash / nil / / / /)
+(plus + nil + + + +)
+(under \\_ nil _ _ _ _)
+(equal = nil = = = =)
 (dagger \\textdagger{} nil dagger; [dagger] [dagger] †)
 (Dagger \\textdaggerdbl{} nil Dagger; [doubledagger] [doubledagger] ‡)
 
-- 
1.7.7.6



Re: [O] Smart quotes

2012-05-23 Thread Mark E. Shoulson

On 05/23/2012 06:17 PM, Nicolas Goaziou wrote:

Hello,


Mark E. Shoulsonm...@kli.org  writes:


Smart quotes can be annoying when they aren't smart enough. But when
they work you can miss them. I'm attaching a patch that defines a
custom variable org-smart-quotes (nil by default), which when non-nil
causes the  and ' characters to display as “smart” quotes, hopefully
the right ones. They're still ' and  in the underlying text, just
overlaid with “”.

This is not related to entities, so code shouldn't be in org-entities.el.

Agreed.



Also, quotes are dependent on locale[fn:1]. English/US only quotes look
like a niche to me. Would it be possible to modify the patch and have
this feature handle LANGUAGE keyword, or at least have a support for it?
Hm.  I like the idea, but it raises some questions for me.  It would be 
particularly good if this could share code/custom variables with the 
pieces of the (new) exporter that make smart quotes on export.  That way 
we could be sure that what it looks like onscreen would also be what it 
looked like when exported.  Looking at contrib/lisp/org-e-latex.el at an 
upcoming exporter for such things, I see a variable org-e-latex-quotes, 
which has nice language-aware parts... but misses an important point.  
Each language gets to define one regexp for opening quotes, one for 
closing quotes, and one for single quotes.  But don't we want to talk 
about (at least) two levels of quotes, see your own reference[fn:1]?  
Single quotes would be for inner, second-level quotes (if we're using 
double straight quotes according to (American) English usage, I would 
guess we'd be using single straight quotes the same way).  That works 
okay for English, where a single apostrophe not part of a grouping 
construct is going to be interpreted as a close single quote and look 
right for an apostrophe.  It might not work so good in French where 
apostrophes are also used, but also single guillemets for inner-level 
quotes.  Does the setup there need to be smarter, or at least more 
extensible, to allow for more than exactly three entries?  Clever enough 
regexps could distinguish inner quotes from apostrophes, etc.  
Should/can we consider extending this for the new exporters?


(I'm looking forward to HTML and ODT exporters that can do smart quotes; 
the straight quotes are really the main jarring things about using Org 
as a lightweight markup and exporting into something fancier)


~mark