[O] Bug: Capture templates: file-olp

2015-05-07 Thread Florian Lindner
Hello,

I just noticed, that if I use a capture template like 

(p foo entry (file+olp  foo) * %?\n%t\n%i)

It complains about:

Template key: 
org-find-olp: Wrong type argument: stringp, nil

It works when using

(p foo entry (file+olp org-default-notes-file foo) * %?\n%t\n%i)

However, documentation claims:

If that file name is the empty string, it defaults to org-default-notes-
file.

http://orgmode.org/manual/Template-elements.html#Template-elements

org-mode that was shipped with Emacs 24.5.

Is that a known bug? Or is it no bug at all?

Best Regards,
Florian




Re: [O] Bug: Export to html fails when link to header in non existing file in document present

2015-05-07 Thread Rainer M Krug
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Rasmus ras...@gmx.us writes:

 Actually, the error you found is more interesting than what I first
 though, as any link with anchors will trigger the error, it seems.
 org-publish-cache must be non-nil, which seems to linger on publishing a
 project.

 Correct. External references can only be solved using publishing.

 From 8e1dd6c43e8a358a85a8034825c475199bd2ffb7 Mon Sep 17 00:00:00 2001
 From: Rasmus ras...@gmx.us
 Date: Wed, 6 May 2015 15:44:26 +0200
 Subject: [PATCH] ox-html: Improve links with search

 * ox-html.el (org-html-link): Handle links with search when
   not using Publish.

 Thank you.

 However, I fixed it at ox-publish.el's level in
 e42c1611094a689f77f09cc66c5a50fb1e3ac7bb instead, and throw an error
 instead of a warning.

OK - I can see the error now:

,
| user-error: Reference 29 in file inst/matlab/org/profil5.m cannot be 
resolved without publishing
`

This helps finding it - thanks.
I don't think it would be possible to give a line number for the org
file where the link is? Or is it possible to jump directly in org to
reference 29?

What would be really nice is an option which makes it possible to export
the file to html and just leave the non-resolvable links as
non-resolvable links in the html and gives a list of all warnings for
this links.

In my case, I just would like to ave the html export to share results
and the links are mainly for my reference and possibly the final
publish.

Is this somehow possible?

Thanks,

Rainer




 Regards,

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


signature.asc
Description: PGP signature


Re: [O] paste from clip to code block

2015-05-07 Thread Sebastien Vauban
John Kitchin wrote:
 I have these templates defined in my setup:

 ;; * Expansions for blocks [...]

 ;; add sh for shell
 (add-to-list 'org-structure-template-alist
  '(sh #+BEGIN_SRC sh\n?\n#+END_SRC src
 lang=\shell\\n?\n/src))

Note that the language should be `shell' in Org from Git (not sure about
MELPA, which I don't use). That'll be so in Org 8.3 as well.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Inline LaTeX formulae

2015-05-07 Thread Eric S Fraga
On Wednesday,  6 May 2015 at 13:35, Titus von der Malsburg wrote:

[...]

 So if the problem is only due to mistaken optimization, it would perhaps
 be best to just revert to the previous code.

Or if the optimisation was key to getting acceptable performance,
maybe discourage the use of $...$ and emphasise the use of \(...\).  The
latter is less fragile and is easy to generate by typing $ using the
following function and binding:

#+begin_src emacs-lisp 
  ;; from Nicolas Richard theonewiththeevill...@yahoo.fr
  ;; Date: Fri, 8 Mar 2013 16:23:02 +0100
  ;; Message-ID: 87vc913oh5@yahoo.fr
  (defun yf/org-electric-dollar nil
  When called once, insert \\(\\) and leave point in between.
  When called twice, replace the previously inserted \\(\\) by one $.
(interactive)
(if (and (looking-at )) (looking-back ())
(progn (delete-char 2)
   (delete-char -2)
   (insert $))
  (insert \\(\\))
  (backward-char 2)))
  (define-key org-mode-map (kbd $) 'yf/org-electric-dollar)
#+end_src

The problem with $ in org mode is that it is a valid standalone
character (i.e. currency symbol).  Having it perform two functions
(symbol and LaTeX directive) makes it difficult to optimise
performance.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-820-gd92ef9



Re: [O] Bug: org-return-indent does not work properly with description lists (i.e ending with double colon)

2015-05-07 Thread Leo Ufimtsev
Hello, 

If I have a list item with a double colon, with the cursor at the end:like:

- Hello World :: |


And press C-c (org-return-indent), then the cursor is at position 0 on the next 
line:

- Hello World :: 
|

But based on the behavior of a regular list item, one would expect it to be on 
position 2 like:

- Hello World :: 
  |

The current workaround is to have something after the colon. 
- Hello World :: . |
then it indents correctly.

Using Emacs 25.0.50.4 w/ org-mode from this morning.

Thank you

Leo




Re: [O] [PATCH] org-timer.el: Use hh:mm:ss format instead of minutes

2015-05-07 Thread Nicolas Goaziou
Brice Waegenire brice@gmail.com writes:

 Thanks for help on this!
 Here is the last version of the patch taking into account all of your
 comments.

Thank you.

(read-from-minibuffer
 -   How many minutes left? 
 -   (if (not (eq org-timer-default-timer 0))
 -   (number-to-string org-timer-default-timer))
 +   How much time left? (minutes or h:mm:ss) 
 +   (when (not (string-equal org-timer-default-timer 0))

Nitpick: `unless'

 +   (eval org-timer-default-timer))

Since `org-timer-default-timer' is a string, there's no need to eval it.

BTW, did you sign FSF papers already? If not, you need to add TINYCHANGE
to the end of the commit message.


Regards,



Re: [O] org-attach + git annex not working

2015-05-07 Thread Nicolas Goaziou
Hello,

Erik Hetzner e...@e6h.org writes:

 The following patch fixes this issue.

 diff --git a/lisp/org-attach.el b/lisp/org-attach.el
 index 1737ec1..b843d48 100644
 --- a/lisp/org-attach.el
 +++ b/lisp/org-attach.el
 @@ -276,7 +276,7 @@ the ATTACH_DIR property) their own attachment directory.
Commit changes to git if `org-attach-directory' is properly initialized.
  This checks for the existence of a \.git\ directory in that directory.
(let* ((dir (expand-file-name org-attach-directory))
 -  (git-dir (vc-git-root dir))
 +  (git-dir (expand-file-name .git (vc-git-root dir)))
(changes 0))
  (when (and git-dir (executable-find git))
(with-temp-buffer

Thank you.

Could you send it again using git format-patch, with a proper commit
message?


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org-babel-ref-parse needs to set current buffer to the buffer of the marker [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)]

2015-05-07 Thread Nicolas Goaziou
Hello,

Oleg Sivokon olegsivo...@gmail.com writes:

 I've been having this problem for a while, and now I think I found its
 culprit: The org-babel-ref-parse function will try to move the point in
 a wrong buffer (a temporary buffer with the contents of the buffer being
 exported), while doing so, it will not switch to this temporary buffer.
 Below is what I did to deal with it:

 (defun org-babel-ref-parse (assignment)
   Parse a variable ASSIGNMENT in a header argument.
 If the right hand side of the assignment has a literal value
 return that value, otherwise interpret as a reference to an
 external resource and find its value using
 `org-babel-ref-resolve'.  Return a list with two elements.  The
 first element of the list will be the name of the variable, and
 the second will be an emacs-lisp representation of the value of
 the variable.
   (when (string-match org-babel-ref-split-regexp assignment)
 (let ((var (match-string 1 assignment))
 (ref (match-string 2 assignment)))
   (cons (intern var)
   (let ((out (save-excursion
(when org-babel-current-src-block-location
;; Added this line, to avoid
;; Marker points into wrong buffer error
  (set-buffer (marker-buffer 
 org-babel-current-src-block-location))
  (goto-char org-babel-current-src-block-location))
(org-babel-read ref

Using `with-current-buffer' is more appropriate since the change is
temporary.


Could you provide a patch using git format-patch, with a proper commit
message?

Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] Inline LaTeX formulae

2015-05-07 Thread Nicolas Goaziou
Hello,

Titus von der Malsburg malsb...@posteo.de writes:

 Rasmus’ proposal is simple and correctly implements what is specified in
 the manual.  Below is a patch that implements this solution.  Does
 anyone see a concrete problem?  If not, it should be merged.

I do: you removed end of line matcher. Also, I do not see the point of
matching \s_.

You also need to update `org-latex-regexps' accordingly.

Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Export to html fails when link to header in non existing file in document present

2015-05-07 Thread Nicolas Goaziou
Rainer M Krug rai...@krugs.de writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Rasmus ras...@gmx.us writes:

 Actually, the error you found is more interesting than what I first
 though, as any link with anchors will trigger the error, it seems.
 org-publish-cache must be non-nil, which seems to linger on publishing a
 project.

 Correct. External references can only be solved using publishing.

 From 8e1dd6c43e8a358a85a8034825c475199bd2ffb7 Mon Sep 17 00:00:00 2001
 From: Rasmus ras...@gmx.us
 Date: Wed, 6 May 2015 15:44:26 +0200
 Subject: [PATCH] ox-html: Improve links with search

 * ox-html.el (org-html-link): Handle links with search when
   not using Publish.

 Thank you.

 However, I fixed it at ox-publish.el's level in
 e42c1611094a689f77f09cc66c5a50fb1e3ac7bb instead, and throw an error
 instead of a warning.

 OK - I can see the error now:

 ,
 | user-error: Reference 29 in file inst/matlab/org/profil5.m cannot be 
 resolved without publishing
 `

 This helps finding it - thanks.
 I don't think it would be possible to give a line number for the org
 file where the link is?

This is not possible.

 Or is it possible to jump directly in org to reference 29?

You may use `org-open-link-from-string'.

 What would be really nice is an option which makes it possible to export
 the file to html and just leave the non-resolvable links as
 non-resolvable links in the html and gives a list of all warnings for
 this links.

I changed the error into a message, with a dummy link.


Regards,



[O] HTML export with custom_id tags

2015-05-07 Thread Lawrence Bottorff
I'm picking over Eric Schulte's web page (http://www.cs.unm.edu/~eschulte/),
and the base .org file it came from, and I see he has given his outline
headers (level **) a PROPERTIES drawer:

:PROPERTIES:
:CUSTOM_ID: research
:END

then in his .css file he has this:

#outline-container-research
{
   padding-top: 100px;
}

I can't find any sort of code that would be associating these two, so I
must assume this is a built-in org-mode HTML export feature. Is this true?
(Not really understanding the manual on HTML CSS, either.) If not, how are
these two associated?

LB


Re: [O] Inline LaTeX formulae

2015-05-07 Thread Titus von der Malsburg

On 2015-05-07 Thu 00:42, Eric S Fraga wrote:
 On Wednesday,  6 May 2015 at 13:35, Titus von der Malsburg wrote:

 [...]

 So if the problem is only due to mistaken optimization, it would perhaps
 be best to just revert to the previous code.

 Or if the optimisation was key to getting acceptable performance,
 maybe discourage the use of $...$ and emphasise the use of \(...\).  The
 latter is less fragile and is easy to generate by typing $ using the
 following function and binding:

 #+begin_src emacs-lisp 
   ;; from Nicolas Richard theonewiththeevill...@yahoo.fr
   ;; Date: Fri, 8 Mar 2013 16:23:02 +0100
   ;; Message-ID: 87vc913oh5@yahoo.fr
   (defun yf/org-electric-dollar nil
   When called once, insert \\(\\) and leave point in between.
   When called twice, replace the previously inserted \\(\\) by one $.
 (interactive)
 (if (and (looking-at )) (looking-back ())
 (progn (delete-char 2)
(delete-char -2)
(insert $))
   (insert \\(\\))
   (backward-char 2)))
   (define-key org-mode-map (kbd $) 'yf/org-electric-dollar)
 #+end_src

 The problem with $ in org mode is that it is a valid standalone
 character (i.e. currency symbol).  Having it perform two functions
 (symbol and LaTeX directive) makes it difficult to optimise
 performance.

The double use of the $ character makes things somewhat tricky,
true.  However, the org manual makes it perfectly clear how the $ sign
should be interpreted and earlier versions of org implemented that
specification.  Hence, there is no need to reeducate users about how
they should write inline formulas.  This is simply a bug and it should
be fixed.

Rasmus’ proposal is simple and correctly implements what is specified in
the manual.  Below is a patch that implements this solution.  Does
anyone see a concrete problem?  If not, it should be merged.

  Titus


org-element: Ensure correct detection of latex fragments

* org-element.el (org-element-latex-fragment-parser): Ensure correct
  detection of latex fragments in
  `org-element-latex-fragment-parser'.  Uses syntax tables to detect
  whitespaces and punctuation marks following the final $ sign.

In order to qualify as a math delimiter, the final $ sign of a LaTeX
fragment has to be followed by a whitespace or punctuation mark but the
regexp used in the previous code matched only a small number of
punctuation marks and therefore missed some latex fragments.


diff --git a/lisp/org-element.el b/lisp/org-element.el
index 7aab9f6..d0c0485 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2963,7 +2963,7 @@ Assume point is at the beginning of the LaTeX fragment.
 (search-forward $ nil t 2)
 (not (memq (char-before (match-beginning 0))
'(?\s ?\t ?\n ?, ?.)))
-(looking-at \\([- \t.,?;:'\]\\|$\\))
+(looking-at \\(\\s.\\|\\s-\\|\\s)\\|\\s\\\|\\s_\\))
 (point)))
(case (char-after (1+ (point)))
  (?\( (search-forward \\) nil t))




signature.asc
Description: PGP signature


Re: [O] Changing TODO status on non-current date

2015-05-07 Thread Peter Ley
I'd love to see something like this. I've been thinking about trying for
some time but haven't gotten around to it. I have no luck with the
mobileorg apps on Android, so I sometimes mark things that have a
context out of the house done on my phone and update org-mode later when
I get home, but then the log doesn't record it correctly, and as you
say, it doesn't work for habits if it's off by a day.



Re: [O] Bug: org-babel-ref-parse needs to set current buffer to the buffer of the marker [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)]

2015-05-07 Thread Oleg Sivokon
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Using `with-current-buffer' is more appropriate since the change is
 temporary.


 Could you provide a patch using git format-patch, with a proper commit
 message?

Hello Nicolas,

Please let me know if I didn't export the patch properly (patch
attached).

From fdc1409602b48ba5f4cd1b5be6264d8311b8b11c Mon Sep 17 00:00:00 2001
From: wvxvw olegsivo...@gmail.com
Date: Fri, 8 May 2015 00:14:11 +0300
Subject: [PATCH] Making sure the buffer pointed by
 org-babel-current-src-block-location is active when moving to the source
 block.

---
 lisp/ob-ref.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index b8a921e..81d4471 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -90,7 +90,9 @@ the variable.
 	(let ((out (save-excursion
 			 (when org-babel-current-src-block-location
 			   (goto-char (if (markerp org-babel-current-src-block-location)
-	  (marker-position org-babel-current-src-block-location)
+	  (with-current-buffer
+	  (marker-buffer org-babel-current-src-block-location)
+	(marker-position org-babel-current-src-block-location))
 	org-babel-current-src-block-location)))
 			 (org-babel-read ref
 	  (if (equal out ref)
-- 
2.1.0


Best,

Oleg


[O] Bug: TBLFM regexp doesn't account for possible white space after the pipe [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)]

2015-05-07 Thread Oleg Sivokon

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


When evaluating a formula, the regular expression used to locate the
formula will miss, if there is a white space after the rightmost pipe in
the last row, i.e.

|1|*
#+tblfm: vsum($1)

asterisk is where the extra space character appears.  Attached is my
attempt at patching it.

Best,

Oleg


Emacs  : GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.12)
 of 2015-05-03 on wvxvvw-laptop
Package: Org-mode version 8.2.2 (release_8.2.2-188-gc57372 @ 
/home/wvxvw/Projects/org-mode/lisp/)

From b91aeaf01f8f4a11f55cc60bbfd9c75e64d73554 Mon Sep 17 00:00:00 2001
From: wvxvw olegsivo...@gmail.com
Date: Fri, 8 May 2015 00:09:21 +0300
Subject: [PATCH] TBLFM regex account for white space after last column.

---
 lisp/org-table.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index a644008..3ca0e76 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -56,7 +56,7 @@ This can be used to add additional functionality after the table is sent
 to the receiver position, otherwise, if table is not sent, the functions
 are not run.)
 
-(defvar org-table-TBLFM-begin-regexp |\n[ \t]*#\\+TBLFM: )
+(defvar org-table-TBLFM-begin-regexp |\s-*\n[ \t]*#\\+TBLFM: )
 
 (defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
   Non-nil means use the optimized table editor version for `orgtbl-mode'.
-- 
2.1.0



Re: [O] Bug: org-toggle-heading breaks with double colon '::' list items.

2015-05-07 Thread Leo Ufimtsev


- Original Message -
 From: Nicolas Goaziou m...@nicolasgoaziou.fr
 To: Leo Ufimtsev lufim...@redhat.com
 Cc: Org Mode emacs-orgmode@gnu.org
 Sent: Wednesday, May 6, 2015 7:18:55 PM
 Subject: Re: [O] Bug: org-toggle-heading breaks with double colon '::' list   
 items.
 
 Hello,
 
 Leo Ufimtsev lufim...@redhat.com writes:
 
  If I have a list with colons like:
 
  - List a ::
Cheese
Bannana
  - List b ::
Pineapples
Tomatoes
 
  If I then select the entire list and call org-toggle-headings, then I would
  *expect* this:
 
  * List a
Cheese
Bannana
  * List b
Pineapples
Tomatoes
 
  But instead the first item is placed on the same line as the heading:
  * List a Cheese
Bannana
  * List b Pineapples
Tomatoes
 
 This should be fixed in 9aa69058bc4cbe3be088df9e96b18caf5359a3a8. Thank
 you.

I downloaded  tested. The fix works well. 
Thank you for the quick fix ^_^, life is much better now :-D.

 Regards,
 
 --
 Nicolas Goaziou
 
 

-- 
Leo Ufimtsev | Intern Software Engineer @ Eclipse Team