[O] bokeh, ob-ipython and org-mode HTML export

2017-11-04 Thread Deepak Cherian
I have a blog post up that might be of interest to some of you on this 
list: http://cherian.net/posts/bokeh-org-mode.html.


It looks at ways to embed interactive Javascript plots using bokeh when 
exporting org files to HTML (bokeh.pydata.org).


Feedback and suggestions welcome!

Deepak



Re: [O] org-capture-expand-file: Invalid file location: nil

2017-11-04 Thread Xi Shen
Hi Nicolas,

Sorry, I missed this one.

(global-set-key (kbd "C-c c") 'org-capture)

OK, thanks for the tip. The problem lies in the "org-capture-templates"
settings. I think in the past, it accept a "nil" argument. Now it expects
an empty string. Replacing nil with empty string solves my problem.


Regards,
David


On Sun, Nov 5, 2017 at 5:23 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Xi Shen  writes:
>
> > When I do C-c c, I got an error:
>
> I don't see any "c" template in your `org-capture-templates'.
>
> > org-capture-expand-file: Invalid file location: nil
> >
> > But (org-capture-expand-file "") returns the expected value. And the file
> > does exist. But (org-capture-expand-file nil) raise an error.
>
> This seems expected according to the docstring.
>
> > So I guess the function was given an erroneous value.
> >
> > My relevant settings are:
> >
> > (org-capture-templates
> >(quote
> > (("t" "Task" entry
> >   (file+headline nil "Tasks")
> >   "* TODO %? %^g")
> >  ("q" "Quick note" entry
> >   (file+datetree nil)
> >   "* [%<%H:%M>] %?"
>
> Have you tried to specify an actual filename, or the empty string,
> instead of using nil? Both `file+headline' and `file+datetree' expect
> some file to operate on.
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] Why is there no org-agenda-todo-next-keyword function?

2017-11-04 Thread Somelauw .
In an org-agenda buffer the following functions are defined and bound:
- org-agenda-todo-nextset (C-S-left)
- org-agenda-todo-previousset (C-S-right)
which change between sets of todo keywords.

Yet the following corresponding functions are missing:
- org-agenda-todo-next-keyword
- org-agenda-todo-previous-keyword
which should (if implemented) change between individual todo keywords.

That means that If I have the following setup:

```emacs-lisp
  (setq org-todo-keywords
'((sequence "TODO(t)" "|" "DONE(d)")
  (sequence "NEXT(n)" "|" "WAITING(w)")))
```

There is no way to change a task to DONE using C-S-left and C-S-right
bindings alone.

What's the reason that these functions are missing?



Re: [O] Bug? Encoding trouble in org-id-locations-load

2017-11-04 Thread Nicolas Goaziou
Hello,

Anders Johansson  writes:

> I tried changing the call to ~insert-file-contents-literally~ in
> ~org-id-locations-load~ to just ~insert-file-contents~ and this seemed
> to fix the behaviour (as correct decoding is done then?). I don’t know
> if there are other unwanted effects from using ~insert-file-contents~,
> but otherwise this seems to me to be a more correct solution.

Agreed. I applied your suggestion. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-store-link not working on a Gnus heading

2017-11-04 Thread Nicolas Goaziou
Hello,

Narendra Joshi  writes:

> I get an error
> `org-gnus-store-link: Invalid function: gnus-summary-article-header`
> when trying to get a link to an article in Gnus. Is this a known bug?

It is not a known bug, and I cannot reproduce it. BTW, I have
`gnus-summary-article-header' defined.

You may want to report a complete backtrace.

Regards,

-- 
Nicolas Goaziou



Re: [O] (setq org-html-with-latex nil) is ignored

2017-11-04 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Hi I want to sent the following message
>
> * Matlab code
> f=@(t,y)[-t*y^2];
> [t,y]=ode45(f,[0 1],1);
> t=[t(1),t(end)];
> y=[y(1),y(end)];
> disp('\begin{align*}')
> fprintf('t = [%g  \\quad %g]  \n', t)
> fprintf('y = [%g  \\qquad %g] \n', y)
> disp('\end{align*}')
>
>
> And I want to run org-mime-htmlize. When I do this the function
> complains about the incorrect latex syntax. So I set
> (setq org-html-with-latex nil),
> either like this or with customize-option
> I even check that it is indeed nil, run again
> org-mime-htmlize.
>
> But then I obtain the *same error* and now the variable is,
> magically, set to dvipng
>
>
> What the heck is going on?

"org-mime.el" hard-codes it at line 379:

  https://github.com/org-mime/org-mime/blob/master/org-mime.el#L379

You may want to report it upstream.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-capture-expand-file: Invalid file location: nil

2017-11-04 Thread Nicolas Goaziou
Hello,

Xi Shen  writes:

> When I do C-c c, I got an error:

I don't see any "c" template in your `org-capture-templates'.

> org-capture-expand-file: Invalid file location: nil
>
> But (org-capture-expand-file "") returns the expected value. And the file
> does exist. But (org-capture-expand-file nil) raise an error.

This seems expected according to the docstring.

> So I guess the function was given an erroneous value.
>
> My relevant settings are:
>
> (org-capture-templates
>(quote
> (("t" "Task" entry
>   (file+headline nil "Tasks")
>   "* TODO %? %^g")
>  ("q" "Quick note" entry
>   (file+datetree nil)
>   "* [%<%H:%M>] %?"

Have you tried to specify an actual filename, or the empty string,
instead of using nil? Both `file+headline' and `file+datetree' expect
some file to operate on.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-submit-bug-report takes ages to format the message buffer

2017-11-04 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Sorry I wanted to send a bug report on a different issue but it
> took/takes ages to format the corresponding message buffer using
> org-submit-bug-report.
>
> What could I do?

You could provide a profiler report with both

  M-x profiler-start

and 

  M-x elp-instrument-package.

Regards,

-- 
Nicolas Goaziou



Re: [O] Shouldn't org-back-to-heading skip inline tasks ?

2017-11-04 Thread Nicolas Goaziou
Hello,

Marc Ihm  writes:

> recently I have been surprised by the fact, that org-back-to-heading
> (or outline-back-to-heading, for that matter) does stop at inline
> tasks,
> as can be tried easily with this org-snippet:
>
>
> * foo
>
> *** Inline
> *** END
>
> M-x org-back-to-heading

Use `org-with-limited-levels' macro to ignore inlinetasks, e.g.:

  (org-with-limited-levels (org-back-to-heading))

This is how Org somewhat handles inlinetasks.

/me closes the can of worms.

Regards,

-- 
Nicolas Goaziou



[O] Bizarre gnuplot file creation error

2017-11-04 Thread Lawrence Bottorff
Trying the babel gnuplot the other day, I had trouble getting the results
to C-c C-c to actually materialize in the place I'd given. Taking the
example from the org-mode babel gnuplot page, (changing the location):

#+begin_src gnuplot :exports both :file omnigraphics/omnig10.png
reset

set title "Putting it All Together"

set xlabel "X"
set xrange [-15:15]
set xtics -15,2,15


set ylabel "Y"
set yrange [-15:15]
set ytics -15,2,15

f(x) = sqrt(x - 1) + 1
g(x) = x**3
h(x) = sqrt(-x - 1) + 1

plot f(x) w lp lw 1, g(x) w lp lw 1, h(x) w l lw 1
#+end_src

The system was not creating the png in the given folder. Finally it
occurred to me to look in another place where I'd previously been creating
org-mode gnuplot pngs -- and there it was! I could do C-c C-c again and
again and see new versions of the png being created each time in
yesterday's folder, i.e., not the location given with :file. So the
:file omnigraphics/omnig10.png was being blown off and org-mode internal
had remembered where I'd previously created pngs and kept creating them
there. I've tried to recreate this scenario with just the code snippet
above -- fresh (non-daemon) emacs processes, changing the :file location
each time -- and I've reproduced the problem sometimes. I've combed through
my personal init els and it's definitely nothing I'm telling it. Strange. .
. .

LB


[O] Shouldn't org-back-to-heading skip inline tasks ?

2017-11-04 Thread Marc Ihm

Hi,

recently I have been surprised by the fact, that org-back-to-heading (or 
outline-back-to-heading, for that matter) does stop at inline tasks,

as can be tried easily with this org-snippet:


* foo

*** Inline
*** END

M-x org-back-to-heading


In my opinion, the cursor should go straight up to the heading foo 
instead of stopping at the inlinetask.


To fix this behaviour, one could insert a modified version of
org-back-to-heading right into org-inlinetask.el like this:


(defun org-back-to-heading ()
  "Move to previous heading, skipping over inlinetasks."
  (let (prev)
(save-excursion
  (end-of-line)
  (while (and (setq prev (re-search-backward org-outline-regexp-bol 
nil t))

  (>= (outline-level) org-inlinetask-min-level
(if prev
(goto-char prev)
  (error (error "Before first headline at position %d in buffer %s"
(point) (current-buffer))


which does not yet accept an optional invisible-ok argument, however.

Would this be a useful change ?


Best regards,
Marc Ihm




Re: [O] using org-global-properties in capture templates

2017-11-04 Thread Xebar Saram
sorry to bother again but still stuck with this

i tried to add another org-global-property entry (i assume thats possible)
but then i didnt get completion for the second one.
this is what i used

(setq org-global-properties '(("Cuisine_ALL". "- Indian Thai Vietnamese
Asian Chinese Israeli Italian American EastEuro Mexican French Persian
Austrian Greek Fusion")))
(add-to-list 'org-global-properties '(("Rating_ALL". "- 1 2 3 4 5")))

can anyone point me to the correct syntax for adding additional
org-global-properties?

thx alot in advance

Z


On Sat, Oct 28, 2017 at 9:44 PM, Xebar Saram  wrote:

> thx so much
>
> that works well. i tried to add another org-global-property entry (i
> assume thats possible) but then i didnt get completion for the second one.
> this is what i used
>
> (setq org-global-properties '(("Cuisine_ALL". "- Indian Thai Vietnamese
> Asian Chinese Israeli Italian American EastEuro Mexican French Persian
> Austrian Greek Fusion")))
> (add-to-list 'org-global-properties '(("Rating_ALL". "- 1 2 3 4 5")))
>
> i assume my syntax is wrong?
>
> thx!
>
> Z
>
> On Sat, Oct 28, 2017 at 12:37 PM, Nicolas Goaziou 
> wrote:
>
>> Hello,
>>
>> Xebar Saram  writes:
>>
>> > ;; Effort and global properties
>> > (setq org-global-properties '(("Effort_ALL". "0 0:10 0:20 0:30 1:00 2:00
>> > 3:00 4:00 6:00 8:00")))
>> >
>> >
>> >
>> > (add-to-list 'org-capture-templates
>> > '("f" "Food"
>> > entry
>> > (file+headline (lambda () (concat pmm "/org/files/agenda/food.org"))
>> > "Inbox")
>> > "* COOK %^{Recipe Name}
>> > :PROPERTIES:
>> > :ID: %(org-id-uuid)
>> > :Effort_ALL: %^{Effort_ALL}p
>> > :END:
>> > "
>> > "Capture Template for food recipe"
>> > ))
>>
>> "XYZ_ALL" is a special property defining allowed values for "XYZ". In
>> you case, you will get completion for "Effort" with:
>>
>>   :Effort: %^{Effort}p
>>
>>
>> Regards,
>>
>> --
>> Nicolas Goaziou
>>
>
>


[O] org-submit-bug-report takes ages to format the message buffer

2017-11-04 Thread Uwe Brauer

Hi

Sorry I wanted to send a bug report on a different issue but it
took/takes ages to format the corresponding message buffer using
org-submit-bug-report.

What could I do?

Uwe Brauer 




[O] org-capture-expand-file: Invalid file location: nil

2017-11-04 Thread Xi Shen
Hi,

When I do C-c c, I got an error:

org-capture-expand-file: Invalid file location: nil

But (org-capture-expand-file "") returns the expected value. And the file
does exist. But (org-capture-expand-file nil) raise an error. So I guess
the function was given an erroneous value.

My relevant settings are:

(org-capture-templates
   (quote
(("t" "Task" entry
  (file+headline nil "Tasks")
  "* TODO %? %^g")
 ("q" "Quick note" entry
  (file+datetree nil)
  "* [%<%H:%M>] %?"

(setq org-default-notes-file (concat org-directory "/.notes"))

I did not change my configurations for a long time. Maybe some of them are
outdated?


Thanks,
David


Re: [O] [PATCH] org-capture: cannot abort cleanly after inserting at end of buffer

2017-11-04 Thread Xavier Martinez-Hidalgo
On Fri, Nov 3, 2017 at 10:22 PM, Nicolas Goaziou  wrote:

> Applied, with a slight twist. Thank you!

It does look much cleaner using 'copy-marker'. Thanks a lot for the review!

Regards,
--
Xavier Martinez-Hidalgo



[O] org-store-link not working on a Gnus heading

2017-11-04 Thread Narendra Joshi
Hello,

I get an error
`org-gnus-store-link: Invalid function: gnus-summary-article-header`
when trying to get a link to an article in Gnus. Is this a known bug?

Best,
Narendra





-- 
Narendra Joshi



Re: [O] Dynamic Org-capture Templates

2017-11-04 Thread Narendra Joshi
Eric Thomas  writes:

> Does anyone know how to approach creating dynamic Org-capture
> templates? I'm looking for IDO/Helm type of completion after a
> template has been selected. If string does not exist, it is created
> and added to future completions, similar to new files in emacs.
>
> Example:
>
> C-c c
> "a" (activity)
> Activity: math   (<--need completion here)
> Topic: multiplication   (<--need completion here)
> Date: 2017-09-11   (<--need default to todays date)
> Start time: 07:00 AM  (<--need to define AM/PM easily)
> Duration: 20   (<--easier way to capture time?)
> Unit: mins
>
> And
>
> C-c c
> "a" (activity)
> Activity: physical education (<--again, completion starts as "ph.." is typed)
> Type: Yoga (<--completion)
> Class: Level 2 flow  (<--completion)
> Date: 2017-09-11 (<--date picker of some kind)
> Start time: 07:00 AM   (<--define AM/PM easily)
> Duration: 90(<--easy method for capturing time)
> Unit: mins
>
>
> Maybe Org-capture templates are not the correct way to approach this?
> Any direction is appreciated.
>From doc string for `org-capture-templates`:
  %^{prompt}  Prompt the user for a string and replace this sequence with it.
  A default value and a completion table ca be specified like this:
  %^{prompt|default|completion2|completion3|...}.

I think to get completion you would need to dynamically build the value
for `org-capture-templates` which would include the completion
candidates for reach field. I think that's not a great way to do
it. Someone else can suggest a better way, I think. 

-- 
Narendra Joshi