Re: [O] Macros in included file not expanded in batch export

2014-07-15 Thread Suvayu Ali
Hi Nick,

On Mon, Jul 14, 2014 at 10:50:53PM -0400, Nick Dokos wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  Hi,
 
  I am trying to export to LaTeX in batch mode, but it seems the exporter
  ignores macros defined in included files when exporting in batch mode.
 
  I tried to export like this:
 
$ emacs --eval (require 'ox-latex) include-test.org \
  --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs
 
$ emacs --batch --eval (require 'ox-latex) include-test.org \
  --eval '(org-LaTeX-export-to-latex nil nil nil t)'
 
  The first one exports correctly, the second doesn't.  The org files, and
  the good and bad exported TeX files are attached.
 
 
 I haven't tried it but --batch implies -q, so it may be that the second
 form is missing something essential from your init file - maybe?

Indeed!  I wasn't aware --batch implies -q, I had checked the man page
before using it, but it isn't there.  Probably it is hidden somewhere in
the manual.

Although, I can't think of what config it must be.  As far as I recall I
do not have anything related to include files or macro expansion.

Anyway, thank you :).

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Test failures

2014-07-15 Thread Achim Gratz
Nick Dokos ndokos at gmail.com writes:
 Apparently these tests assume that the org info file can be found, but
 the `make clea'n that is done at the beginning of make test wipes it
 out. That's probably because I'm working out of the cloned git tree, but
 if possible, I would like `make test' to work in that case.  My
 workaround for now is to add `make info' in targets.mk:

Actually it needs just about _any_ Org info file, it's not looking
specifically for the one from the Git tree, but depending on how your Emacs
installation looks like it may not find one.  I really don't think this is a
good test anyway, but pulling in the info target (as a dependency, not as an
actual make invocation) is too heavy-handed.  The test should actually
provide the info file (and set up info path) specifically for testing,
patches welcome.


Regards,
Achim.






Re: [O] Macros in included file not expanded in batch export

2014-07-15 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Hi Nick,

 On Mon, Jul 14, 2014 at 10:50:53PM -0400, Nick Dokos wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  Hi,
 
  I am trying to export to LaTeX in batch mode, but it seems the exporter
  ignores macros defined in included files when exporting in batch mode.
 
  I tried to export like this:
 
$ emacs --eval (require 'ox-latex) include-test.org \
  --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs
 
$ emacs --batch --eval (require 'ox-latex) include-test.org \
  --eval '(org-LaTeX-export-to-latex nil nil nil t)'
 
  The first one exports correctly, the second doesn't.  The org files, and
  the good and bad exported TeX files are attached.
 
 
 I haven't tried it but --batch implies -q, so it may be that the second
 form is missing something essential from your init file - maybe?

 Indeed!  I wasn't aware --batch implies -q, I had checked the man page
 before using it, but it isn't there.  Probably it is hidden somewhere in
 the manual.


See

(info (emacs) Initial options)

-- 
Nick




Re: [O] emails written in Org Mode

2014-07-15 Thread Alan Schmitt
On 2014-07-15 02:57, Thorsten Jolitz tjol...@gmail.com writes:

 Hadn't have the time to try Gnorb, but the combination of gnusorg is
 definitely interesting for me.

I highly recommend this library. I haven't scratched the surface, but
one great aha moment was when I was reading in email in gnus and saw
a message in the minibuffer about a relevant task from my todo list.

I mostly use it to track waiting for sent email: after sending an
email, with one keystroke I can create a waiting for task with a link to
the sent email. I also use it to create reply to tasks.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpeGWvGaEiQS.pgp
Description: PGP signature


Re: [O] emails written in Org Mode

2014-07-15 Thread Joseph Vidal-Rosset
Hello,

This is very interesting indeed. But is there somewhere a good tutorial to
read or video to see ? It would be helpful for people who want to use Gnus
+ Org-mode in optimal way.

Best wishes,

Jo.


2014-07-15 16:11 GMT+02:00 Alan Schmitt alan.schm...@polytechnique.org:

 On 2014-07-15 02:57, Thorsten Jolitz tjol...@gmail.com writes:

  Hadn't have the time to try Gnorb, but the combination of gnusorg is
  definitely interesting for me.

 I highly recommend this library. I haven't scratched the surface, but
 one great aha moment was when I was reading in email in gnus and saw
 a message in the minibuffer about a relevant task from my todo list.

 I mostly use it to track waiting for sent email: after sending an
 email, with one keystroke I can create a waiting for task with a link to
 the sent email. I also use it to create reply to tasks.

 Alan

 --
 OpenPGP Key ID : 040D0A3B4ED2E5C7



Re: [O] Babel : python generate org source block with an extra comma before * characters

2014-07-15 Thread Roland DONAT
Thorsten Jolitz tjolitz at gmail.com writes:

 
 Roland DONAT roland.donat at gmail.com writes:
 
  To do so, I tried to use de drawer option. It gives me the good result 
  with a drawer but then when I export my org buffer to latex, the drawers 
  :RESULTS: is also exported which is not cool...
 
 Did you try header args ':exports code ' or ':exports none'?
 

Sorry for the late reply and thanks for your post.

Yes I did and it does't work since these options do exactly what they are 
supposed to. So :  
- :exports code just exports my python source code.
- :exports none exports nothing.

But unfortunately I realised that the BEGIN_ORG drawer was also exported 
which is not what I want.

So, I will create another post on that specific subject.

Cheers.






[O] :RESULTS: drawer exported in LaTeX

2014-07-15 Thread Roland DONAT
Dear Orgmode community,

I have this piece of python code that generate Orgmode text :

#+NAME: test
#+HEADER: :session test1
#+HEADER: :results value drawer
#+BEGIN_SRC python   
a = ** H1\nblabla\n** H2\nbloblo
a
#+END_SRC

#+RESULTS: test
:RESULTS:
** H1
blabla
** H2
bloblo
:END:

But when I export my document in LaTeX, the :RESULTS: drawer appears in the 
final pdf which it's not cool...

I have a d:nil in my OPTIONS header.

My configuration :
- Org 8.2.5h on Linux Mint 16. 
- Python 3

Any help would be much appreciated! Thanks.

Roland.





Re: [O] Excluding habits from Diary?

2014-07-15 Thread Aric Gregson
Aric Gregson aorc...@mac.com writes:

 The main improvement for me would be to repress the introduction of
 habits into the diary output. I have not been able to accomplish this
 thus far, and am unsure of how I might go about trying to do so.

The way I have worked around this is to set the habits to show only for
the present day in the agenda. They are then not exported into the diary
calendar unless you export the present day. This works just fine. 

Aric




Re: [O] :RESULTS: drawer exported in LaTeX

2014-07-15 Thread Nick Dokos
Roland DONAT roland.do...@gmail.com writes:

 Dear Orgmode community,

 I have this piece of python code that generate Orgmode text :

 #+NAME: test
 #+HEADER: :session test1
 #+HEADER: :results value drawer
 #+BEGIN_SRC python   
 a = ** H1\nblabla\n** H2\nbloblo
 a
 #+END_SRC

 #+RESULTS: test
 :RESULTS:
 ** H1
 blabla
 ** H2
 bloblo
 :END:

 But when I export my document in LaTeX, the :RESULTS: drawer appears in the 
 final pdf which it's not cool...

 I have a d:nil in my OPTIONS header.


There is either a bug in the parser or a drawer cannot contain headlines
(probably the latter): running org-element-parse-buffer on the following:

--8---cut here---start-8---
#+STARTUP: noindent
#+OPTIONS: toc:nil

* foo
:RESULTS:

** foo1
blabla
bloblo
:END:

* Local variables   
  :noexport:

# Local Variables:
# org-export-with-drawers: (RESULTS)
# End:
--8---cut here---end---8---


gives me:

--8---cut here---start-8---
(org-data nil
  (section
   (:begin 1 :end 41 :contents-begin 1 :contents-end 40 :post-blank 1 
:parent #0)
   (keyword
(:key \STARTUP\ :value \noindent\ :begin 1 :end 21 :post-blank 
0 :post-affiliated 1 :parent #1))
   (keyword
(:key \OPTIONS\ :value \toc:nil\ :begin 21 :end 40 :post-blank 
0 :post-affiliated 21 :parent #1)))
  (headline
   (:raw-value \foo\ :begin 41 :end 87 :pre-blank 0 :contents-begin 
47 :contents-end 86 :level 1 :priority nil :tags nil :todo-keyword nil 
:todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp 
nil :title
   (#(\foo\ 0 3
  (:parent #1)))
   :parent #0)
   (section
(:begin 47 :end 58 :contents-begin 47 :contents-end 57 :post-blank 
1 :parent #1)
(paragraph
 (:begin 47 :end 57 :contents-begin 47 :contents-end 57 :post-blank 
0 :post-affiliated 47 :parent #2)
 #(\:RESULTS:\\n\ 0 10
   (:parent #3
   (headline
(:raw-value \foo1\ :begin 58 :end 86 :pre-blank 0 :contents-begin 
66 :contents-end 86 :level 2 :priority nil :tags nil :todo-keyword nil 
:todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp 
nil :title
(#(\foo1\ 0 4
   (:parent #2)))
:parent #1)
(section
 (:begin 66 :end 87 :contents-begin 66 :contents-end 86 :post-blank 
1 :parent #2)
 (paragraph
  (:begin 66 :end 80 :contents-begin 66 :contents-end 80 
:post-blank 0 :post-affiliated 66 :parent #3)
  #(\blabla\\nbloblo\\n\ 0 14
(:parent #4)))
 (drawer
  (:begin 80 :end 86 :drawer-name \END\ :contents-begin nil 
:contents-end nil :post-blank 0 :post-affiliated 80 :parent #3)
  (headline
   (:raw-value \Local variables\ :begin 87 :end 198 :pre-blank 1 
:contents-begin 133 :contents-end 198 :level 1 :priority nil :tags
   (\noexport\)
   :todo-keyword nil :todo-type nil :post-blank 0 
:footnote-section-p nil :archivedp nil :commentedp nil :title
   (#(\Local variables\ 0 15
  (:parent #1)))
   :parent #0)
   (section
(:begin 133 :end 198 :contents-begin 133 :contents-end 198 
:post-blank 0 :parent #1)
(comment
 (:begin 133 :end 198 :value \Local
  Variables:\\norg-export-with-drawers:
  (\\\RESULTS\\\)\\nEnd:\ :post-blank 0 :post-affiliated 133
  :parent #2)

--8---cut here---end---8---

so :RESULTS: is somehow misinterpreted as a paragraph and :END: as an
empty drawer, instead of as the end of the RESULTS drawer.

If there is no headline inside the drawer, then there is no
misinterpretation, IOW the following works:

--8---cut here---start-8---
#+STARTUP: noindent
#+OPTIONS: toc:nil

* foo
:RESULTS:

blabla
bloblo
:END:

* Local variables   
  :noexport:

# Local Variables:
# org-export-with-drawers: (RESULTS)
# End:
--8---cut here---end---8---

The final verdict has to be issued by Nicolas however. If it's not a
bug, then you will have to modify your method (I would have said that
raw is the best solution, but since you have already rejected that,
I'm not sure what else to suggest).

--
Nick




Re: [O] :RESULTS: drawer exported in LaTeX

2014-07-15 Thread Roland DONAT
Nick Dokos ndokos at gmail.com writes:

 
 Roland DONAT roland.donat at gmail.com writes:
 
  Dear Orgmode community,
 
  I have this piece of python code that generate Orgmode text :
 
  #+NAME: test
  #+HEADER: :session test1
  #+HEADER: :results value drawer
  #+BEGIN_SRC python   
  a = ** H1\nblabla\n** H2\nbloblo
  a
  #+END_SRC
 
  #+RESULTS: test
  :RESULTS:
  ** H1
  blabla
  ** H2
  bloblo
  :END:
 
  But when I export my document in LaTeX, the :RESULTS: drawer appears in 
the 
  final pdf which it's not cool...
 
  I have a d:nil in my OPTIONS header.
 
 
 There is either a bug in the parser or a drawer cannot contain headlines
 (probably the latter): running org-element-parse-buffer on the following:
 
 --8---cut here---start-8---
 #+STARTUP: noindent
 #+OPTIONS: toc:nil
 
 * foo
 :RESULTS:
 
 ** foo1
 blabla
 bloblo
 :END:
 
 * Local variables 
   
:noexport:
 
 # Local Variables:
 # org-export-with-drawers: (RESULTS)
 # End:
 --8---cut here---end---8---
 
 gives me:
 
 --8---cut here---start-8---
 (org-data nil
 (section
  (:begin 1 :end 41 :contents-begin 1 :contents-end 40 :post-blank 
1 :parent #0)
  (keyword
   (:key \STARTUP\ :value \noindent\ :begin 1 :end 21 :post-
blank 0 :post-affiliated 1 :parent #1))
  (keyword
   (:key \OPTIONS\ :value \toc:nil\ :begin 21 :end 40 :post-
blank 0 :post-affiliated 21 :parent #1)))
 (headline
  (:raw-value \foo\ :begin 41 :end 87 :pre-blank 0 :contents-
begin 47 :contents-end 86 :level 1
 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 
:footnote-section-p nil
 :archivedp nil :commentedp nil :title
  (#(\foo\ 0 3
 (:parent #1)))
  :parent #0)
  (section
   (:begin 47 :end 58 :contents-begin 47 :contents-end 57 :post-
blank 1 :parent #1)
   (paragraph
(:begin 47 :end 57 :contents-begin 47 :contents-end 57 :post-
blank 0 :post-affiliated 47 :parent #2)
#(\:RESULTS:\\n\ 0 10
  (:parent #3
  (headline
   (:raw-value \foo1\ :begin 58 :end 86 :pre-blank 0 :contents-
begin 66 :contents-end 86 :level 2
 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 
:footnote-section-p nil
 :archivedp nil :commentedp nil :title
   (#(\foo1\ 0 4
  (:parent #2)))
   :parent #1)
   (section
(:begin 66 :end 87 :contents-begin 66 :contents-end 86 :post-
blank 1 :parent #2)
(paragraph
 (:begin 66 :end 80 :contents-begin 66 :contents-end 80 :post-
blank 0 :post-affiliated 66 :parent #3)
 #(\blabla\\nbloblo\\n\ 0 14
   (:parent #4)))
(drawer
 (:begin 80 :end 86 :drawer-name \END\ :contents-begin nil 
:contents-end nil :post-blank 0
 :post-affiliated 80 :parent #3)
 (headline
  (:raw-value \Local variables\ :begin 87 :end 198 :pre-blank 1 
:contents-begin 133 :contents-end 198
 :level 1 :priority nil :tags
  (\noexport\)
  :todo-keyword nil :todo-type nil :post-blank 0 
:footnote-section-p nil :archivedp nil :commentedp
 nil :title
  (#(\Local variables\ 0 15
 (:parent #1)))
  :parent #0)
  (section
   (:begin 133 :end 198 :contents-begin 133 :contents-end 198 
:post-blank 0 :parent #1)
   (comment
(:begin 133 :end 198 :value \Local
 Variables:\\norg-export-with-drawers:
 (\\\RESULTS\\\)\\nEnd:\ :post-blank 0 :post-affiliated 133
 :parent #2)
 
 --8---cut here---end---8---
 
 so :RESULTS: is somehow misinterpreted as a paragraph and :END: as an
 empty drawer, instead of as the end of the RESULTS drawer.
 
 If there is no headline inside the drawer, then there is no
 misinterpretation, IOW the following works:
 
 --8---cut here---start-8---
 #+STARTUP: noindent
 #+OPTIONS: toc:nil
 
 * foo
 :RESULTS:
 
 blabla
 bloblo
 :END:
 
 * Local variables 
   
:noexport:
 
 # Local Variables:
 # org-export-with-drawers: (RESULTS)
 # End:
 --8---cut here---end---8---
 
 The final verdict has to be issued by Nicolas however. If it's not a
 bug, then you will have to modify your method (I would have said that
 raw is the best solution, but since you have already rejected that,
 I'm not sure what else to suggest).
 
 --
 Nick
 
 

Thank you very much for your analysis!

You're right, there is something wrong between the parser and 

[O] random weekly event

2014-07-15 Thread Ivan Kanis
Hi,

I need to have org agenda (and then appt) manage an event once a week.
The catch is that is should happen at a random day and hour.

My thinking is that populating programmatically a year entry is probably
the sanest way to go about it.

Has anyone else done it?

Ivan
-- 
Repeated reboots of the system failed to solve problem.
-- BOFH excuse #20



Re: [O] Problem with org-mode after upgradiing to org 8

2014-07-15 Thread Sean O'Halpin
Hi,

This might be something to do with the order in which package
initialization and the loading of your init.el file happen. I use the
following alias to put my local org-mode git repo paths ahead of
anything emacs does on launch (in startup.el or site-start.el, etc.):

: alias emacs='/usr/local/bin/emacs --eval '\''(progn (add-to-list
(quote load-path) ~/.emacs.d/org-mode/lisp) (add-to-list (quote
load-path) ~/.emacs.d/org-mode/contrib/lisp))'\'''

This doesn't seem like a very elegant solution though - I too would
like to know what the 'proper' way to do this is (if there is one).

Regards,
Sean

On Mon, Jul 14, 2014 at 12:05 PM, Roland Everaert reveatw...@gmail.com wrote:
 org-mode will makes me crazy. After a deep review (well rewrite my entire
 configuration based on norang's one) org-mode is working again, but its the
 version bundled with emacs that seems to be loaded and not the one I
 downloaded from the git repository.


 My emacs configuration is structured like so:

 ~/.emacs.d/init.el
 ~/.emacs.d/site-lisp/ -- contains alot of lisp codes including the
 directory of org.


 At the top of the init.el file I put the following:

 (let ((default-directory ~/.emacs.d/site-lisp/))
   (normal-top-level-add-to-load-path '(.))
   (normal-top-level-add-subdirs-to-load-path))


 I, later, load a file containing all my org-mode configuration. That file is
 located in ~/.emacs.d/site-lisp/. I load that file in this way:

 (load-library my-org-mode-config)

  At the top of that configuration file is written:

 (add-to-list 'load-path (expand-file-name
 ~/.emacs.d/site-lisp/org-mode/lisp))
 (add-to-list 'load-path (expand-file-name
 ~/.emacs.d/site-lisp/org-mode/contrib/lisp))
 (add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\)$ . org-mode))

 (require 'org)


 So I don't understand why M-x org-version gives me:

 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @
 /usr/share/emacs/24.3/lisp/org/)


 Any help welcomed,


 Roland.

 On Fri, Jul 4, 2014 at 4:21 PM, John Hendy jw.he...@gmail.com wrote:

 On Fri, Jul 4, 2014 at 5:55 AM, Roland Everaert reveatw...@gmail.com
 wrote:
  Hi,
 
  After further investigation, it is the call to the function
  (org-agenda-to-appt) inside the function bh/org-agenda-to-appt that is
  causing the error.
 
  The body of the function:
 
  ; Erase all reminders and rebuilt reminders for today from the agenda
  (defun bh/org-agenda-to-appt ()
(interactive)
(setq appt-time-msg-list nil)
   (org-agenda-to-appt)
  )

 I know approximately nothing about elisp... but my intuitive
 interpretation is that it's setting the variable appt-time-msg-list to
 the value nil. When I do M-x help RET appt-msg-[TAB], I don't get any
 completions listed. Does that variable still exist?

 When googling that variable, I find evidence of people referring to
 it, but I'm not sure it's built into emacs -- are you sure you don't
 need to add something else, such as appt.el?
 - http://www.emacswiki.org/emacs-en/appt.el


 John

 
 
  I will deactivate the call to bh/org-agenda-to-appt, so I can have a
  normal
  life again and use emacs and org-mode without any problem. I will review
  and
  clean my configuration when times permit.
 
  I am anyway curious to know why that function call generate such error.
 
  Thanks for your help,
 
 
  Roland.
 
 
 
 
  On Thu, Jul 3, 2014 at 10:10 AM, Roland Everaert reveatw...@gmail.com
  wrote:
 
  Hi John,
 
  I am using Bernt's configuration (at least a part of it) for years
  without
  problems until I switch to org 8.
 
  I hame commented most of my init.el file and uncomment bits of
  configuration lines one at a time. and I have found where is located
  the
  problem. I have know to investigate why it is a problem.
 
  The offending line is (bh/org-agenda-to-appt), this is one of the
  function
  from the configuration of Bernt, so I have now to check my version
  against
  the one on his page to see if he doesn't update it.
 
  And to answer your question, the loaded version of org-mode is
  Org-mode
  version beta_8.3 (beta_8.3-16-g16c71d6 @
  /home/reveatwork/.emacs.d/site-lisp/org-mode/lisp/)
 
  I will also perform a make clean  make of my installation of
  org-mode
  just in case some their is some garbage left from previous version.
 
 
  Thanks for your help,
 
 
  Roland.
 
 
 
 
 
  On Tue, Jul 1, 2014 at 5:55 PM, John Hendy jw.he...@gmail.com wrote:
 
  On Tue, Jul 1, 2014 at 5:04 AM, Roland Everaert reveatw...@gmail.com
  wrote:
   I have upgraded using git on a Linux fedora 20 64 bit.
  
   I perform the following commands from the directory of org-mode:
  
   make clean
   git pull
   make
 
  I usually do git pull  make clean  make, but don't know if that
  makes a difference, so that's probably fine.
 
   I have also read the following page:
   http://orgmode.org/worg/org-8.0.html
  
   And search for all variables in my configuration that start with
   org-export,
   but I have none of them.
 
  Well, I'm 

[O] Scheduled tasks: total time since last DONE

2014-07-15 Thread Fletcher Charest
Dear all,

I'm sorry if this is a common question but I had trouble finding the right
keywords.

I am a little puzzled by the way scheduled tasks work. I will give an
example. Let's have this task:

* TODO Clean the kitchen
SCHEDULED: 2014-07-20 jeu. .+1w

If I'm lazy and don't do it for one whole week, on 2014-07-27 I will see
this in my agenda:

Scheduled:  TODO Clean the kitchen

But I would really like to see this instead:

Sched. 7x:  TODO Clean the kitchen

This way I could see it's been 7 days I didn't do it, and tasks would be
better organized in the agenda. RIght now, a task that I have to do on a
weekly basis never has a number greater than '6x', and even if it hasn't
been done for months, it still appears on the bottom of the list in the
agenda, with a small number.

So is there a way to correct this? How do you proceed?

Thank you very much for your help!

Regards,

FC


Re: [O] proposal to make C-c C-c not remove latex overlays

2014-07-15 Thread John Kitchin
I actually love C-c C-c to run code blocks! Maybe I should just bind it
to f5 or something, I am just so used to C-cC-c now!

Grant Rettke g...@wisdomandwonder.com writes:

 On Mon, Jul 14, 2014 at 7:33 PM, Aaron Ecay aarone...@gmail.com wrote:
 The first is to use the C-c C-v C-e binding to execute source blocks
 rather than C-c C-c.

 Like this?

 (setq org-babel-no-eval-on-ctrl-c-ctrl-c +1)



-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] proposal to make C-c C-c not remove latex overlays

2014-07-15 Thread John Kitchin
Aaron Ecay aarone...@gmail.com writes:

Thanks for the advice idea, that is a nice one. It doesn't work for me
like this though:

#+BEGIN_SRC emacs-lisp
(defadvice org-ctrl-c-ctrl-c (around latex-overlays)
  ignore latex overlays in C-cC-c
  (let ((org-latex-fragment-image-overlays nil))
ad-do-it))
#+END_SRC

maybe because that is a buffer local variable?

 Hi John,

 2014ko uztailak 14an, John Kitchin-ek idatzi zuen:
 
 I am using org-mode files with equations and code blocks in lectures,
 and it is problematic that C-c C-c removes the equation overlays when
 running a code block. First, you have to press C-c C-c twice to run the
 block, since the first one gets rid of the equations, but then you have
 run C-c C-x C-l to get the equations back! and the cycle repeats
 throughout a lecture.
 
 I would prefer that the equations stay untouched, and that the code
 blocks run without modifying them. 
 
 I think the best behavior would be for C-c C-x C-l to toggle the
 equations, and to remove the C-c C-c behavior for latex overlays
 completely. But it would be ok if this was done by a C-c C-c hook
 function, so that a user could remove the latex overlay without touching
 the org-code.
 
 Maybe a new function like this:
 
 #+BEGIN_SRC emacs-lisp
 (defun org-toggle-latex-overlays (arg)
   Toggle LaTeX fragments.
   (interactive P)
   (if org-latex-fragment-image-overlays
   (org-remove-latex-fragment-image-overlays)
 (org-preview-latex-fragment arg)))
 #+END_SRC
 
  could be added. Any thoughts?

 I don’t have a comment on the substance of the proposal, but rather two
 suggestions for workarounds.

 The first is to use the C-c C-v C-e binding to execute source blocks
 rather than C-c C-c.

 The second is to let-bind ‘org-latex-fragment-image-overlays’ to nil
 in an advice around the ‘org-ctrl-c-ctrl-c’ function, allowing you to
 still use the more convenient C-c C-c binding.

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] random weekly event

2014-07-15 Thread Thorsten Jolitz
Ivan Kanis i...@kanis.fr writes:

 Hi,

 I need to have org agenda (and then appt) manage an event once a week.
 The catch is that is should happen at a random day and hour.

 My thinking is that populating programmatically a year entry is probably
 the sanest way to go about it.

 Has anyone else done it?

This is not an arcane scientific solution, but should give a random
timestamp for between tomorrow and the end of the current week. You
could write a function (using run-with-timer) that runs this sunday at
00:00h and inserts a todo item with the returned timestamp into an
agenda file:

#+begin_src emacs-lisp
(defun tj/return-random-timestamp-this-week ()
   Insert random timestamp for this week.
  (interactive)
  (let* ((cal-info (decode-time (current-time)))
 (dow (nth 6 cal-info))
 (year (nth 5 cal-info))
 (month (nth 4 cal-info))
 (day (nth 3 cal-info))
 (hour (nth 2 cal-info))
 (random-day (+ day (1+ (random (- 5 dow)
 (random-hour (random 23))
 (random-minute (random 59))
 (random-second (random 59)))
(format-time-string %D %R
   (encode-time random-second
random-minute
random-hour
random-day
month
year

#+end_src

#+results:
: tj/return-random-timestamp-this-week


#+begin_src emacs-lisp :results raw
(let (res)
 (dotimes (i 10 res)
   (setq res (concat
  res
  (format %d: %s\n
 (1+ i)
 (tj/return-random-timestamp-this-week))
#+end_src

#+results:
1: 07/17/14 17:39
2: 07/16/14 18:18
3: 07/18/14 19:21
4: 07/17/14 12:58
5: 07/16/14 15:30
6: 07/16/14 16:17
7: 07/16/14 04:10
8: 07/16/14 21:37
9: 07/17/14 19:22
10: 07/16/14 13:39


-- 
cheers,
Thorsten




Re: [O] random weekly event

2014-07-15 Thread Thorsten Jolitz
Thorsten Jolitz tjol...@gmail.com writes:

 Ivan Kanis i...@kanis.fr writes:

 #+begin_src emacs-lisp
 (defun tj/return-random-timestamp-this-week ()
Insert random timestamp for this week.
   (interactive)
   (let* ((cal-info (decode-time (current-time)))
(dow (nth 6 cal-info))
(year (nth 5 cal-info))
(month (nth 4 cal-info))
(day (nth 3 cal-info))
(hour (nth 2 cal-info))
(random-day (+ day (1+ (random (- 5 dow)
(random-hour (random 23))
(random-minute (random 59))
(random-second (random 59)))
 (format-time-string %D %R
  (encode-time random-second
   random-minute
   random-hour
   random-day
   month
   year


ups, should be probably rather this:
 
,
| (random-day (+ day (1+ (random (- 7 dow)
`

limit is not included, see

,[ C-h f random RET ]
| random is a built-in function in `C source code'.
| 
| (random optional LIMIT)
| 
| Return a pseudo-random number.
| All integers representable in Lisp, i.e. between `most-negative-fixnum'
| and `most-positive-fixnum', inclusive, are equally likely.
| 
| With positive integer LIMIT, return random number in interval [0,LIMIT).
| With argument t, set the random number seed from the current time and pid.
| With a string argument, set the seed based on the string's contents.
| Other values of LIMIT are ignored.
| 
| See Info node `(elisp)Random Numbers' for more details.
| 
| [back]
`

-- 
cheers,
Thorsten




Re: [O] random weekly event

2014-07-15 Thread Thorsten Jolitz
Thorsten Jolitz tjol...@gmail.com writes:

 ups, should be probably rather this:
  
 ,
 | (random-day (+ day (1+ (random (- 7 dow)
 `

grrr ... (- 6 dow) of course 

-- 
cheers,
Thorsten




Re: [O] proposal to make C-c C-c not remove latex overlays

2014-07-15 Thread Nick Dokos
John Kitchin jkitc...@andrew.cmu.edu writes:

 Aaron Ecay aarone...@gmail.com writes:

 Thanks for the advice idea, that is a nice one. It doesn't work for me
 like this though:

 #+BEGIN_SRC emacs-lisp
 (defadvice org-ctrl-c-ctrl-c (around latex-overlays)
   ignore latex overlays in C-cC-c
   (let ((org-latex-fragment-image-overlays nil))
 ad-do-it))
 #+END_SRC

 maybe because that is a buffer local variable?


You probably forgot to activate it:

(ad-activate 'org-ctrl-c-ctrl-c)

-- 
Nick




Re: [O] proposal to make C-c C-c not remove latex overlays

2014-07-15 Thread Grant Rettke
C-c C-v C-e might seem like a lot but it nice to have control and be
sure when code is getting evaluated.

That said, I do have a more obvious one using super which is indeed, super:

(local-set-key (kbd s-t) 'org-babel-tangle)
(local-set-key (kbd s-e) 'org-babel-execute-maybe)
Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Tue, Jul 15, 2014 at 4:00 PM, John Kitchin jkitc...@andrew.cmu.edu wrote:
 I actually love C-c C-c to run code blocks! Maybe I should just bind it
 to f5 or something, I am just so used to C-cC-c now!

 Grant Rettke g...@wisdomandwonder.com writes:

 On Mon, Jul 14, 2014 at 7:33 PM, Aaron Ecay aarone...@gmail.com wrote:
 The first is to use the C-c C-v C-e binding to execute source blocks
 rather than C-c C-c.

 Like this?

 (setq org-babel-no-eval-on-ctrl-c-ctrl-c +1)



 --
 ---
 John Kitchin
 Professor
 Doherty Hall A207F
 Department of Chemical Engineering
 Carnegie Mellon University
 Pittsburgh, PA 15213
 412-268-7803
 http://kitchingroup.cheme.cmu.edu



Re: [O] emails written in Org Mode

2014-07-15 Thread Eric Abrahamsen
Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:

 Hello,

 This is very interesting indeed. But is there somewhere a good
 tutorial to read or video to see ? It would be helpful for people who
 want to use Gnus + Org-mode in optimal way.

Someone asked me about a screencast recently, around the same time that
I realized the README isn't actually very readable! Part of getting the
package Elpa-ready will also be writing a proper Info manual.

For the time being, the very basics of email tracking (though Gnorb does
a lot more) would look like this:

1. Start by making a TODO which represents a message that you have to
   send. That could be using plain old capture on an incoming message
   you want to reply to. Or using gnorb-gnus-outgoing-do-todo on a
   message while you're composing it. Or just typing out a TODO. One way
   or the other, you want a TODO heading that contains a mailto link, or
   a bbdb link, or a gnus message link (or some combination thereof).

2. Call gnorb-org-handle-mail on that heading. You'll end up composing a
   message of some sort.

3. Send the message. You'll be taken back to the original TODO heading,
   and prompted to take a note or change the TODO state. For example,
   from EMAIL to WAIT. It's useful to enable state-change logging.

4. Wait for a reply. When you get it, Gnorb will know (I hope) that the
   reply is relevant to the original TODO, and will prompt you to call
   gnorb-gnus-incoming-do-todo on the message. Do that.

5. Again you'll be taken back to the TODO, and prompted to take a note
   or change the TODO state -- for example, from WAIT to REPLY. A link
   to the received message can (and should) be inserted into the
   state-change drawer.

6. Go back to step two, and repeat until your email conversation is
   done.

What it boils down to is calling gnorb-org-handle-mail on your TODO
heading, and gnorb-gnus-incoming-do-todo on received messages.
Everything else is gravy. (But there's a lot of gravy!)

The moment something doesn't work the way you like it, look at the
customization options.

Maybe what I need here is a diagram...

Eric

 2014-07-15 16:11 GMT+02:00 Alan Schmitt 
 alan.schm...@polytechnique.org:

 On 2014-07-15 02:57, Thorsten Jolitz tjol...@gmail.com writes:

  Hadn't have the time to try Gnorb, but the combination of gnus
 org is
  definitely interesting for me.

 I highly recommend this library. I haven't scratched the surface,
 but
 one great aha moment was when I was reading in email in gnus
 and saw
 a message in the minibuffer about a relevant task from my todo
 list.

 I mostly use it to track waiting for sent email: after sending
 an
 email, with one keystroke I can create a waiting for task with a
 link to
 the sent email. I also use it to create reply to tasks.

 Alan

 --
 OpenPGP Key ID : 040D0A3B4ED2E5C7



Re: [O] emails written in Org Mode

2014-07-15 Thread Eric Abrahamsen
Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:

 Hello,

 This is very interesting indeed. But is there somewhere a good
 tutorial to read or video to see ? It would be helpful for people who
 want to use Gnus + Org-mode in optimal way.

Someone asked me about a screencast recently, around the same time that
I realized the README isn't actually very readable! Part of getting the
package Elpa-ready will also be writing a proper Info manual.

For the time being, the very basics of email tracking (though Gnorb does
a lot more) would look like this:

1. Start by making a TODO which represents a message that you have to
   send. That could be using plain old capture on an incoming message
   you want to reply to. Or using gnorb-gnus-outgoing-do-todo on a
   message while you're composing it. Or just typing out a TODO. One way
   or the other, you want a TODO heading that contains a mailto link, or
   a bbdb link, or a gnus message link (or some combination thereof).

2. Call gnorb-org-handle-mail on that heading. You'll end up composing a
   message of some sort.

3. Send the message. You'll be taken back to the original TODO heading,
   and prompted to take a note or change the TODO state. For example,
   from EMAIL to WAIT. It's useful to enable state-change logging.

4. Wait for a reply. When you get it, Gnorb will know (I hope) that the
   reply is relevant to the original TODO, and will prompt you to call
   gnorb-gnus-incoming-do-todo on the message. Do that.

5. Again you'll be taken back to the TODO, and prompted to take a note
   or change the TODO state -- for example, from WAIT to REPLY. A link
   to the received message can (and should) be inserted into the
   state-change drawer.

6. Go back to step two, and repeat until your email conversation is
   done.

What it boils down to is calling gnorb-org-handle-mail on your TODO
heading, and gnorb-gnus-incoming-do-todo on received messages.
Everything else is gravy. (But there's a lot of gravy!)

The moment something doesn't work the way you like it, look at the
customization options.

Maybe what I need here is a diagram...

Eric

 2014-07-15 16:11 GMT+02:00 Alan Schmitt 
 alan.schm...@polytechnique.org:

 On 2014-07-15 02:57, Thorsten Jolitz tjol...@gmail.com writes:

  Hadn't have the time to try Gnorb, but the combination of gnus
 org is
  definitely interesting for me.

 I highly recommend this library. I haven't scratched the surface,
 but
 one great aha moment was when I was reading in email in gnus
 and saw
 a message in the minibuffer about a relevant task from my todo
 list.

 I mostly use it to track waiting for sent email: after sending
 an
 email, with one keystroke I can create a waiting for task with a
 link to
 the sent email. I also use it to create reply to tasks.

 Alan

 --
 OpenPGP Key ID : 040D0A3B4ED2E5C7