[O] [PATCH] ox-taskjuggler.el: Check return code instead of error buffer

2018-05-18 Thread Grégoire Jadi
Hello orgmode@,

I've recently tried taskjuggler and it reports some warnings about
Fixnum: https://github.com/taskjuggler/TaskJuggler/issues/200

However, this warnings do not prevent taskjuggler from exporting a
report. This patch checks the return code instead of the error buffer to
determine if the export process was successful or not.

WDYT?
Best,

From 7113e79ef8a9cd476873d278e1a4124be2f20f12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= 
Date: Fri, 18 May 2018 10:30:38 +0200
Subject: [PATCH] ox-taskjuggler.el: Check return code instead of error buffer

* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-compile): Check the
return code of the taskjuggler call instead of the error buffer to
determine if the export by taskjuggler was successful or not (ignore
warnings). Also, do not erase the output buffer as it is already done
by `shell-command'.
---
 contrib/lisp/ox-taskjuggler.el | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 5dd9b2202..125cf7891 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -998,18 +998,16 @@ Return a list of reports."
   (let ((outbuf (get-buffer-create "*Org Taskjuggler Output*")))
 	(unless (file-directory-p out-dir)
 	  (make-directory out-dir t))
-	(with-current-buffer outbuf (erase-buffer))
-	(shell-command
-	 (replace-regexp-in-string
-	  "%f" (shell-quote-argument full-name)
-	  (replace-regexp-in-string
-	   "%o" (shell-quote-argument out-dir)
-	   org-taskjuggler-process-command t t) t t) outbuf)
-	;; Collect standard errors from output buffer.
-	(setq errors (org-taskjuggler--collect-errors outbuf)))
-  (if (not errors)
-	  (message "Process completed.")
-	(error (format "TaskJuggler failed with errors: %s" errors
+	(if (zerop (shell-command
+		(replace-regexp-in-string
+		 "%f" (shell-quote-argument full-name)
+		 (replace-regexp-in-string
+		  "%o" (shell-quote-argument out-dir)
+		  org-taskjuggler-process-command t t) t t) outbuf))
+	(message "Process completed.")
+	  ;; Collect standard errors from output buffer.
+	  (setq errors (org-taskjuggler--collect-errors outbuf))
+	  (error (format "TaskJuggler failed with errors: %s" errors)
 (file-expand-wildcards (format "%s/*.html" out-dir
 
 (defun org-taskjuggler--collect-errors (buffer)
-- 
2.16.2



signature.asc
Description: PGP signature


Re: [O] [PATCH] org-manual, org.texi: Fix typo in variable name

2018-03-30 Thread Grégoire Jadi
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> daim...@omecha.info (Grégoire Jadi) writes:
>
>> Hello,
>>
>> Here is a patch to fix a small typo in the manual.
>
> Applied. Thank you.

Thanks.

>> I haven't followed the recent development of org-mode so I don't know
>> what is the new process regarding the manual. Thus, I patched both the
>> =org-manual.org= and =org.texi=.
>
> For the time being, I suggest to patch "org-manual.org" only. "org.texi"
> will be re-generated from "org.texi" from time to time. You can also
> regenerate it just after modifying "org-manual.org", of course.

Ok.

Thank you.
Best,
> Regards,


signature.asc
Description: PGP signature


[O] [PATCH] org-manual, org.texi: Fix typo in variable name

2018-03-29 Thread Grégoire Jadi
Hello,

Here is a patch to fix a small typo in the manual. I haven't followed
the recent development of org-mode so I don't know what is the new
process regarding the manual. Thus, I patched both the =org-manual.org=
and =org.texi=.

From 9f030f2e8e37e4d36245234878435a79677b1511 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= 
Date: Thu, 29 Mar 2018 08:29:55 +0200
Subject: [PATCH] org-manual, org.texi: Fix typo in variable name

---
 doc/org-manual.org | 4 ++--
 doc/org.texi   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 35ab95134..61a572084 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6398,7 +6398,7 @@ prompted about what to do with it.
 
  #+cindex: @samp{CLOCK_MODELINE_TOTAL}, property
  #+cindex: @samp{LAST_REPEAT}, property
- #+vindex: org-clock-modeline-total
+ #+vindex: org-clock-mode-line-total
  #+vindex: org-clock-in-prepare-hook
  While the clock is running, Org shows the current clocking time
  in the mode line, along with the title of the task.  The clock
@@ -21022,7 +21022,7 @@ this to ~org-clock-in-prepare-hook~.
 [fn:73] The last reset of the task is recorded by the =LAST_REPEAT=
 property.
 
-[fn:74] See also the variable ~org-clock-modeline-total~.
+[fn:74] See also the variable ~org-clock-mode-line-total~.
 
 [fn:75] The corresponding in-buffer setting is: =#+STARTUP:
 lognoteclock-out=.
diff --git a/doc/org.texi b/doc/org.texi
index b78a22ef2..190e07fda 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -7064,7 +7064,7 @@ clock stopped.
 
 @cindex @samp{CLOCK_MODELINE_TOTAL}, property
 @cindex @samp{LAST_REPEAT}, property
-@vindex org-clock-modeline-total
+@vindex org-clock-mode-line-total
 @vindex org-clock-in-prepare-hook
 While the clock is running, Org shows the current clocking time
 in the mode line, along with the title of the task.  The clock
@@ -7078,7 +7078,7 @@ the @samp{CLOCK_MODELINE_TOTAL} property.  It may have the values
 @samp{current} to show only the current clocking instance, @samp{today} to
 show all time clocked on this tasks today---see also the
 variable @code{org-extend-today-until}, @code{all} to include all time, or
-@code{auto} which is the default@footnote{See also the variable @code{org-clock-modeline-total}.}.  Clicking with
+@code{auto} which is the default@footnote{See also the variable @code{org-clock-mode-line-total}.}.  Clicking with
 @kbd{mouse-1} onto the mode line entry pops up a menu with
 clocking options.
 
-- 
2.16.2



signature.asc
Description: PGP signature


Re: [O] emacs laggs with saving clipboard to X clipboard manager

2018-03-03 Thread Grégoire Jadi
Joseph Vidal-Rosset  writes:

> Hello everybody,
>
> I apologize,  I know  that this  topic is org-mode  specific, but  it is
> related to emacs.
>
> My problem is exactly the same that is explained here :
> [[https://github.com/syl20bnr/spacemacs/issues/9691]]
> and my OS  is the same (Gnu Linux  Debian 9).  I do not  succeed to find
> the solution,  knowing that I need  to copy and paste  in emacs elements
> that are outside emacs.
>
> Your help is welcome. 

FWIW, this is a known issue.
See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29170

I use the same workaround a S. Fraga:
: (setq x-selection-timeout 10)

Best,



signature.asc
Description: PGP signature


[O] bug in org parsing

2016-12-31 Thread Grégoire Jadi
Hi,

I've found what I think is a bug in orgmode parsing.
When the following file is parsed :
* Test
#+BEGIN_SRC emacs-lisp :exports results :results raw drawer
(format "* Test2")
#+END_SRC

#+RESULTS:
:RESULTS:
* Test2
:END:

The (truncated) result of `org-element-parse-buffer' is :
(src-block
 (:language \"emacs-lisp\" :switches nil :parameters \":exports results
:results raw drawer\" :begin 8 :end 98 :number-lines nil
:preserve-indent nil :retain-labels t :use-labels t :label-fmt nil
:value \"(format \\\"* Test2\\\")\\n\" :post-blank 1 :post-affiliated 8
:parent #2))
(paragraph
 (:begin 98 :end 119 :contents-begin 109 :contents-end 119 :post-blank 0
:post-affiliated 109 :results
 (\"\")
 :parent #2)
 #(\":RESULTS:\\n\" 0 10
   (:parent #3)))

That is, it generates a PARAGRAPH which seems incorrect.

However, when the following file is parsed :

* Test
#+BEGIN_SRC emacs-lisp :exports results :results raw drawer
(format "- Test2")
#+END_SRC

#+RESULTS:
:RESULTS:
- Test2
:END:

The truncated result of `org-element-parse-buffer' is :
(src-block
 (:language \"emacs-lisp\" :switches nil :parameters \":exports results
:results raw drawer\" :begin 8 :end 98 :number-lines nil
:preserve-indent nil :retain-labels t :use-labels t :label-fmt nil
:value \"(format \\\"- Test2\\\")\\n\" :post-blank 1 :post-affiliated 8
:parent #2))
(drawer
 (:begin 98 :end 133 :drawer-name \"RESULTS\" :contents-begin 119
:contents-end 127 :post-blank 0 :post-affiliated 109 :results
 (\"\")
 :parent #2))

That is, it generates a DRAWER, which seems correct.

WDYT?



signature.asc
Description: OpenPGP digital signature


[O] bug when generating org text then exporting to html

2016-12-31 Thread Grégoire Jadi
Hi all,

With the following file :
* Test
#+BEGIN_SRC elisp :results drawer :exports results
(format "* My Headline")
#+END_SRC


When I export this file to HTML, I expect to have the same result as if
I had the following file :
* Test
* My Headline

However, the exporter also include a paragraph with :RESULTS:.

WDYT?

I'm using Org mode version 9.0.3 (release_9.0.3-134-g517fed).



signature.asc
Description: OpenPGP digital signature


[O] bug when generating org text then exporting to html

2016-12-31 Thread Grégoire Jadi
Hi all,

With the following file :
* Test
#+BEGIN_SRC elisp :results drawer :exports results
(format "* My Headline")
#+END_SRC


When I export this file to HTML, I expect to have the same result as if
I had the following file :
* Test
* My Headline

However, the exporter also include a paragraph with :RESULTS:.

WDYT?

I'm using Org mode version 9.0.3 (release_9.0.3-134-g517fed).



signature.asc
Description: OpenPGP digital signature


Re: [O] elfeed and orgmode integaration?

2015-12-07 Thread Grégoire Jadi

Xebar Saram writes:

> Hi all
>
> I was wondering if anyone uses elfeed and org and how people integrate it 
> into orgmode.
>
> It would be great if anyone can share code dealing with capturing from elfeed 
> into org, linking and any other uses people are coming up with

There is elfeed-org[1] to manage entries from
an org file and I'm working on a PR to link to entries with org-mode[2].

1: https://github.com/remyhonig/elfeed-org
2: https://github.com/remyhonig/elfeed-org/pull/18

Best,

-- 
Grégoire Jadi


signature.asc
Description: PGP signature


Re: [O] org-crypt & multiple recipients

2015-10-26 Thread Grégoire Jadi

Eric S Fraga writes:

> On Sunday, 25 Oct 2015 at 18:39, Nick Anderson wrote:
>> I was playing with org-crypt today and it's pretty nifty.
>>
>> While encrypting things for myself is the primary use case, I have other
>> team members that also use org-mode. It occurred to me that it would be
>> neat if I could specify a list of users to encrypt a node for. Then we
>> could share an org file and a node could be decrypted by individual.
>
> This is fundamentally difficult with a public key encryption system: you
> would have to have separate copies of the encrypted text, one for each
> recipient?
>
> Maybe you could have a separate private/public key pair that is shared
> for group work instead?

GPG supports multiple-recipient with --recipient
See
https://stackoverflow.com/questions/597188/encryption-with-multiple-different-keys/23725786#23725786

And the answer below explains how GPG/PGP does to not have to copy the
text for each recipient.
https://stackoverflow.com/questions/597188/encryption-with-multiple-different-keys/28206835#28206835

Best,

-- 
Grégoire Jadi


signature.asc
Description: PGP signature


Re: [O] [PATCH] Fix `org-capture-templates' type declaration

2015-10-25 Thread Grégoire Jadi

Nicolas Goaziou writes:

> Hello,

Hi,

Thanks for the reply.

> Grégoire Jadi <gregoire.j...@univ-nantes.fr> writes:
>
>> The attached patch fix the type declaration of org-capture-templates by
>> allowing the user to use file, variable, function and sexp as target's
>> file to match the documentation
>
> Thank you.
>
>> -(file :tag "  File"))
>> +(choice :tag "  File"
>> +file variable function sexp))
>
> Shouldn't there be an entry for each type instead of stuffing everything
> within "File" descriptor ?

With my patch, the customization interface looks like this
- for a file :
Target location: Value Menu File:
  File: Value Menu File: ~/org/notes.org

- for a variable :
Target location: Value Menu File:
  File: Value Menu Variable: nil

- for a function :
Target location: Value Menu File:
  File: Value Menu Function: ignore

- for an Emacs Lisp form :
Target location: Value Menu File:
  File: Value Menu Lisp expression: nil

What kind of rendering do you think would be better/clearer?

Best,
> Regards,

-- 
Grégoire Jadi


signature.asc
Description: PGP signature


Re: [O] [PATCH] Fix `org-capture-templates' type declaration

2015-10-25 Thread Grégoire Jadi

Nicolas Goaziou writes:

> Grégoire Jadi <gregoire.j...@univ-nantes.fr> writes:
>
>> With my patch, the customization interface looks like this
>> - for a file :
>> Target location: Value Menu File:
>>   File: Value Menu File: ~/org/notes.org
>>
>> - for a variable :
>> Target location: Value Menu File:
>>   File: Value Menu Variable: nil
>>
>> - for a function :
>> Target location: Value Menu File:
>>   File: Value Menu Function: ignore
>>
>> - for an Emacs Lisp form :
>> Target location: Value Menu File:
>>   File: Value Menu Lisp expression: nil
>>
>> What kind of rendering do you think would be better/clearer?
>
> :tag " File" is misleading. Perhaps " File, variable, function or
> S-expression" would be clearer, if a bit longish.

That's too long IMHO.

> Not sure how to make this beast clearer anyway.

Me neither.

If anyone has an opinion on this, s/he is welcome!

This patch can wait a little until we find a satisfactory solution.
AFAIK noone has reported this bug :)


Best,

-- 
Grégoire Jadi


signature.asc
Description: PGP signature


[O] [PATCH] Fix `org-capture-templates' type declaration

2015-10-24 Thread Grégoire Jadi
Hi,

The attached patch fix the type declaration of org-capture-templates by
allowing the user to use file, variable, function and sexp as target's
file to match the documentation

(org) Template elements
> Most target specifications contain a file name. If that file name is the
> empty string, it defaults to ‘org-default-notes-file’. A file can also
> be given as a variable, function, or Emacs Lisp form.

OK to push?

From 00aa68469d51420c71f77801514c17a8464c8e2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <gregoire.j...@univ-nantes.fr>
Date: Sat, 24 Oct 2015 19:27:58 +0200
Subject: [PATCH] lisp/org-capture.el: Fix `org-capture-templates' type
 declaration

* lisp/org-capture.el(org-capture-templates): Fix `org-capture-templates' type
declaration to match its documentation.

Allow the use of file, variable, function or Emacs Lisp form as target file as
specified by the docstring.
---
 lisp/org-capture.el | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 58b578b..9d24a6f 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -298,32 +298,39 @@ calendar|  %:type %:date"
 		  (choice :tag "Target location"
 			  (list :tag "File"
 (const :format "" file)
-(file :tag "  File"))
+(choice :tag "  File"
+	file variable function sexp))
 			  (list :tag "ID"
 (const :format "" id)
 (string :tag "  ID"))
 			  (list :tag "File & Headline"
 (const :format "" file+headline)
-(file   :tag "  File")
+(choice :tag "  File"
+	file variable function sexp)
 (string :tag "  Headline"))
 			  (list :tag "File & Outline path"
 (const :format "" file+olp)
-(file   :tag "  File")
+(choice :tag "  File"
+	file variable function sexp)
 (repeat :tag "Outline path" :inline t
 	(string :tag "Headline")))
 			  (list :tag "File & Regexp"
 (const :format "" file+regexp)
-(file   :tag "  File  ")
+(choice :tag "  File  "
+	file variable function sexp)
 (regexp :tag "  Regexp"))
 			  (list :tag "File & Date tree"
 (const :format "" file+datetree)
-(file :tag "  File"))
+(choice :tag "  File"
+	file variable function sexp))
 			  (list :tag "File & Date tree, prompt for date"
 (const :format "" file+datetree+prompt)
-(file :tag "  File"))
+(choice :tag "  File"
+	file variable function sexp))
 			  (list :tag "File & function"
 (const :format "" file+function)
-(file :tag "  File")
+(choice :tag "  File"
+	file variable function sexp)
 (sexp :tag "  Function"))
 			  (list :tag "Current clocking task"
 (const :format "" clock))
-- 
1.9.1


-- 
Grégoire Jadi


signature.asc
Description: PGP signature


[O] [PATCH] ob-python: Fix python session initialization

2015-10-01 Thread Grégoire Jadi
Hi,

There is a bug in ob-python, the parameters aren't used to initialize
the session. Here is a patch that fixes it.

OK to push ?

* lisp/ob-python.el (org-babel-execute:python): Send params to 
`org-babel-python-initiate-session'.

It was not possible to configure the sesssion with custom parameters.
For example, the python interpreter with :python
> BEGIN_SRC python :session my-session :python ipython
---
 lisp/ob-python.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 3a9b8f6..f2e6f66 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -74,7 +74,7 @@ This will typically be either `python' or `python-mode'."
   "Execute a block of Python code with Babel.
 This function is called by `org-babel-execute-src-block'."
   (let* ((session (org-babel-python-initiate-session
-  (cdr (assoc :session params
+  (cdr (assoc :session params)) params))
  (result-params (cdr (assoc :result-params params)))
  (result-type (cdr (assoc :result-type params)))
 (return-val (when (and (eq result-type 'value) (not session))
-- 

-- 
Grégoire Jadi


signature.asc
Description: PGP signature


Re: [O] [PATCH] ob-python: Fix python session initialization

2015-10-01 Thread Grégoire Jadi

Grégoire Jadi writes:

> Hi,
>
> There is a bug in ob-python, the parameters aren't used to initialize
> the session. Here is a patch that fixes it.

Err, discard this. It's not enough to fix the bug since
`org-babel-python-initiate-session' doesn't use the params either. I'll
come back later with a correct patch (unless someone else is faster ;)).

Sorry for the noise.

Cheers

> OK to push ?
>
> * lisp/ob-python.el (org-babel-execute:python): Send params to 
> `org-babel-python-initiate-session'.
>
> It was not possible to configure the sesssion with custom parameters.
> For example, the python interpreter with :python
>> BEGIN_SRC python :session my-session :python ipython
> ---
>  lisp/ob-python.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/ob-python.el b/lisp/ob-python.el
> index 3a9b8f6..f2e6f66 100644
> --- a/lisp/ob-python.el
> +++ b/lisp/ob-python.el
> @@ -74,7 +74,7 @@ This will typically be either `python' or `python-mode'."
>"Execute a block of Python code with Babel.
>  This function is called by `org-babel-execute-src-block'."
>(let* ((session (org-babel-python-initiate-session
> -(cdr (assoc :session params
> +(cdr (assoc :session params)) params))
>   (result-params (cdr (assoc :result-params params)))
>   (result-type (cdr (assoc :result-type params)))
>(return-val (when (and (eq result-type 'value) (not session))
> -- 

-- 
Grégoire Jadi


signature.asc
Description: PGP signature


Re: [O] info for org not found in emacs

2012-12-07 Thread Grégoire Jadi
Rainer M Krug r.m.k...@gmail.com writes:

 Hi

 I am using org from git using the following commands (in a script):

 ##
 cd ~/.emacs.d/org-mode-git/org-mode
 git checkout master
 git fetch --tags origin
 git pull
 git gc
 git checkout master
 make clean
 make
 make autoloads
 make doc
 make info
 ##

 But I can't find the info file and get the error message Info-find-file: 
 Info file org does not
 exist.

 How can I tell where emacs can find the info file (I assume it is in the doc/ 
 subdirectory?)?

(add-to-list 'Info-default-directory-list
 (expand-file-name ~/.emacs.d/org-mode-git/org-mode/doc))


 Thanks,

 Rainer

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