Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-06-02 Thread Dror Atariah
I already tried three version: macports, build from sources and the bundled
version. All have this problem. So, I guess it has to do with the way emacs
interacts with my Python, but I don't know how to debug it.

Is there no one here that is a python/orgmode ninja that can give me a hand
here?

Thanks.
Dror

On Tue, Jun 2, 2015 at 2:21 PM, Ken Mankoff  wrote:

>
> Switch to an emacs that doesn't have this bug on your system. Try
> Homebrew-installed versions (although I know you aren't supposed to mix
> brew and macports, and I think you use macports).
>
>   -k.
>
> On 2015-06-02 at 01:49, Dror Atariah  wrote:
> > No ideas? Please, I really don't know how to tackle this. Thanks.
>
>


-- 
Dror Atariah, Ph.D.
de.linkedin.com/in/atariah


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-06-01 Thread Dror Atariah
No ideas? Please, I really don't know how to tackle this. Thanks.

--
Dror Atariah,  PhD
Sent from mobile; excuse my brevity.
On May 26, 2015 8:39 PM, "Dror Atariah"  wrote:

>
>
> On Tue, May 26, 2015 at 4:02 PM, Ken Mankoff  wrote:
>
>>
>>
>> Where you see everything printed twice. I notice that in addition, you
>> have
>>
>> > r/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/py6499_X0''', 'exec'));
>>
>> at the top of your buffer, and I do not. I think the "exec" might be
>> causing everything to echo as it runs, so everything is printed 2x, and
>> that confuses Org, and it is not able to capture your filename.
>>
>
> It is the most promising suspect so far, but still I don't understand
> where is it coming from? BTW, I noticed that it is not the same directory
> as the one where the generated temp files are stored.
>


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-26 Thread Dror Atariah
On Tue, May 26, 2015 at 4:02 PM, Ken Mankoff  wrote:

>
>
> Where you see everything printed twice. I notice that in addition, you have
>
> > r/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/py6499_X0''', 'exec'));
>
> at the top of your buffer, and I do not. I think the "exec" might be
> causing everything to echo as it runs, so everything is printed 2x, and
> that confuses Org, and it is not able to capture your filename.
>

It is the most promising suspect so far, but still I don't understand where
is it coming from? BTW, I noticed that it is not the same directory as the
one where the generated temp files are stored.


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-26 Thread Dror Atariah
On Tue, May 26, 2015 at 4:02 PM, Ken Mankoff  wrote:

>
> On 2015-05-26 at 09:26, Dror Atariah  wrote:
> >> #+BEGIN_SRC python :session with_matplotlib :results file :exports both
> >> import matplotlib
> >> matplotlib.use('Agg')
> >> import matplotlib.pyplot as plt
> >> fig=plt.figure(figsize=(3,2))# 4
> >> plt.plot([1,3,2])  # 3
> >> plt.savefig('myfig.png')  # 2
> >> 'myfig.png' # 1
> >> #+END_SRC
> >>
> >> #+RESULTS:
> >> [[file:myfig.png]]
> >>
> >
> > As I mentioned before, if I evaluate the second block as-is I get the
> > error. However, if I comment out all the lines except #1 then the code
> > returns the correct results block. Then, I started to add the numbered
> > lines. Adding #2 and #3 still doesn't break the behavior. Once adding
> line
> > #4 the behavior breaks. Maybe this observation can be helpful? This
> happens
> > both when starting Emacs -Q or without -Q.
>
>
> Still no solution but a few comments:
>
> 1) What you write here and on SE are not the same. Please cut-and-paste
> because details matter. For example, the SE code has "import
> matplotlib.pyplot" and then "plt.figure" but that code crashes because you
> did not import "as plt" like you do here...
>
I see. Let's focus on the code posted in this thread and assume that the
problem is not related to python mistakes.


>
> 2) It seems to be an echo issue. In my *with_matplotlib* buffer in Emacs,
> I see:
>
> #+BEGIN_EXAMPLE
> Python 2.7.9 |Anaconda 2.2.0 (x86_64)| (default, Dec 15 2014, 10:37:34)
> [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> Anaconda is brought to you by Continuum Analytics.
> Please check out: http://continuum.io/thanks and https://binstar.org
> >>> import matplotlib
> >>> matplotlib.use('Agg')
> >>> import matplotlib.pyplot as plt
> fig=plt.figure(figsize=(3,2))
> plt.plot([1,3,2])
>
> plt.savefig('myfig.png')
> 'myfig.png'
>
> open('/var/folders/bl/trcxdptd1_q4k6q5fdhvp2m0gn/T/babel-52565cmH/python-525659vF',
> 'w').write(str(_))
> 'org_babel_python_eoe'
> >>> []
> >>> 'myfig.png'
> >>> 'org_babel_python_eoe'
> >>>
> #+END_EXAMPLE
>
> Where you see everything printed twice. I notice that in addition, you have
>
> > r/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/py6499_X0''', 'exec'));
>
> at the top of your buffer, and I do not. I think the "exec" might be
> causing everything to echo as it runs, so everything is printed 2x, and
> that confuses Org, and it is not able to capture your filename.
>
This sounds like a promising hint. Where is this first line coming from?
How can I disable this double printing or figure out why is happening?



>
>   -k.
>
>


-- 
Dror Atariah, Ph.D.
de.linkedin.com/in/atariah


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-26 Thread Dror Atariah
On Mon, May 25, 2015 at 8:30 PM, John Kitchin 
wrote:

> With emacs -Q, and this org file:
>
> #+BEGIN_SRC emacs-lisp
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((emacs-lisp . t)
>(python . t)))
> #+END_SRC
>
> #+RESULTS:
>
> #+BEGIN_SRC python :session with_matplotlib :results file :exports both
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> fig=plt.figure(figsize=(3,2))# 4
> plt.plot([1,3,2])  # 3
> plt.savefig('myfig.png')  # 2
> 'myfig.png' # 1
> #+END_SRC
>
> #+RESULTS:
> [[file:myfig.png]]
>
>
As I mentioned before, if I evaluate the second block as-is I get the
error. However, if I comment out all the lines except #1 then the code
returns the correct results block. Then, I started to add the numbered
lines. Adding #2 and #3 still doesn't break the behavior. Once adding line
#4 the behavior breaks. Maybe this observation can be helpful? This happens
both when starting Emacs -Q or without -Q.


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-26 Thread Dror Atariah
On Tue, May 26, 2015 at 3:15 PM, Ken Mankoff  wrote:

>
> On 2015-05-26 at 09:11, Dror Atariah  wrote:
> > I use emacs that come from MacPorts, so for -Q option I start it using:
> > /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -Q
>
> Consider using different compilation options, and/or a different Emacs.app
> package. It seems like that might be the easiest way to solve this problem.
>
This problem also happens when I use the "standard" OS X Emacs.app

I really don't understand what's going on here. Most likely it has to to
with my settings, but how and how to debug is beyond my reach.

>
>   -k.
>



-- 
Dror Atariah, Ph.D.
de.linkedin.com/in/atariah


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-26 Thread Dror Atariah
On Tue, May 26, 2015 at 3:49 AM, Ken Mankoff  wrote:

>
> Nick Dokos removed from Cc.
>
> On 2015-05-25 at 14:22, Dror Atariah  wrote:
> > I tried to evaluate the problematic file using =emacs -Q= and the problem
> > is the same.
>
> Sorry I can't help much. It works on my system.
>
> The only difference I see is my python version:
>
> #+BEGIN_SRC python :session background :results raw
> import sys
> sys.version
> #+END_SRC
>
> #+RESULTS:
> 2.7.9 |Anaconda 2.2.0 (x86_64)| (default, Dec 15 2014, 10:37:34)
> [GCC 4.2.1 (Apple Inc. build 5577)]
>
I doesn't work also when I try to use the 2.7 version of Python.

>
> > Following is the section of my =init.el= that deals with org-mode (if you
> > need more, let me know):
>
> If the bug exists with "emacs -Q", then sending a large init file is just
> noise and not helpful. A minimum working example would be similar to your
> previous email, but include the necessary Org setup code to execute Python,
> and nothing else.
>
I believe this is the example that John provided; which doesn't work for
me...

How can I make sure that my emacs -Q is really "clean"?

>
>   -k.
>
>


-- 
Dror Atariah, Ph.D.
de.linkedin.com/in/atariah


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-26 Thread Dror Atariah
On Mon, May 25, 2015 at 8:30 PM, John Kitchin 
wrote:

> With emacs -Q, and this org file:
>
> #+BEGIN_SRC emacs-lisp
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((emacs-lisp . t)
>(python . t)))
> #+END_SRC
>
> #+RESULTS:
>
> #+BEGIN_SRC python :session with_matplotlib :results file :exports both
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> fig=plt.figure(figsize=(3,2))
> plt.plot([1,3,2])
> plt.savefig('myfig.png')
> 'myfig.png'
> #+END_SRC
>
> #+RESULTS:
> [[file:myfig.png]]
>
> I get what you expect to happen. In my customized emacs, I get something
> else that is more like you see.
>
I use emacs that come from MacPorts, so for -Q option I start it using:
/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -Q

Your minimal example doesn't work for me, and in the results block I get:

#+RESULTS:
[[file:]]

This is basically, the same problematic result that I get when using my
regular initialized emacs.


>
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Mon, May 25, 2015 at 2:22 PM, Dror Atariah  wrote:
>
>> On Mon, May 25, 2015 at 7:29 PM, Ken Mankoff  wrote:
>>
>>>
>>> On 2015-05-25 at 13:25, Dror Atariah  wrote:
>>> > I am sorry for reposting, but I'm still in the dark. Am I the only one
>>> who
>>> > experience this kind of issue?
>>>
>>> Don't know.
>>>
>>> > Did someone managed to reproduce the problem?
>>>
>>> I could not reproduce it.
>>>
>>> > Does anyone see this message? :)
>>>
>>> Yes.
>>>
>>
>> Thanks for your reply :)
>>
>>
>>>
>>> I'm on Mac too, which is where your problem is. Are you starting with
>>> "emacs -Q"? I haven't seen you post a full MWE with both =init.el= and =
>>> test.org=. You did provide a test Org file but it wasn't clear to me if
>>> that was being used with emacs -Q.
>>>
>>> I tried to evaluate the problematic file using =emacs -Q= and the
>> problem is the same.
>>
>> Following is the section of my =init.el= that deals with org-mode (if you
>> need more, let me know):
>>
>>
>> --8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
>> ;;;
>> ;; Org Mode related
>> ;;;
>>
>> (setq org-directory "~/Dropbox/org")
>>
>> ;; Set a location for the list of agena files
>> (setq org-agenda-files "~/.emacs.d/agenda_files")
>>
>> ;; Assigns org-mode to .org files
>> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
>> (define-key global-map "\C-cl" 'org-store-link)
>> (define-key global-map "\C-ca" 'org-agenda)
>> (setq org-log-done t)
>> (when window-system (require 'org-mouse))
>>
>> ;; Auto enable flyspell-mode
>> (add-hook 'org-mode-hook 'turn-on-flyspell)
>>
>> ;; Auto fill minor mode in org files
>> (add-hook 'org-mode-hook 'turn-on-auto-fill)
>>
>> ;; Enable org-indent-mode for org buffers
>> (add-hook 'org-mode-hook
>>   (lambda ()(org-indent-mode t)) t)
>>
>> ;; Use text-mode abbrev table in org-mode
>> (add-hook 'org-mode-hook '(lambda () (setq local-abbrev-table
>> text-mode-abbrev-table)))
>>
>> ;; Enables selection using SHIFT, while maintaining useful actions
>> ;; related to SHITF in org
>> (setq org-support-shift-select 't)
>>
>> ;; Enable smart qoutes (http://stackoverflow.com/q/15097114/671013)
>> (setq org-export-with-smart-quotes t)
>>
>> ;; Customize the TODO-like keywords
>> (setq org-use-fast-todo-selection t)
>> (setq org-todo-keywords
>>   '((sequence "TODO(t)" "PROCESS(p@/!)" "|" "DONE(d!)" "CANCELED(c@
>> /!)")))
>> (setq org-todo-keyword-faces
>>   (quote (("TODO" :foreground "red" :weight bold)
>>   ("PROCESS" :foreground "blue" :weight bold)
>>   ("DONE" :f

Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-25 Thread Dror Atariah
On Mon, May 25, 2015 at 7:29 PM, Ken Mankoff  wrote:

>
> On 2015-05-25 at 13:25, Dror Atariah  wrote:
> > I am sorry for reposting, but I'm still in the dark. Am I the only one
> who
> > experience this kind of issue?
>
> Don't know.
>
> > Did someone managed to reproduce the problem?
>
> I could not reproduce it.
>
> > Does anyone see this message? :)
>
> Yes.
>

Thanks for your reply :)


>
> I'm on Mac too, which is where your problem is. Are you starting with
> "emacs -Q"? I haven't seen you post a full MWE with both =init.el= and =
> test.org=. You did provide a test Org file but it wasn't clear to me if
> that was being used with emacs -Q.
>
> I tried to evaluate the problematic file using =emacs -Q= and the problem
is the same.

Following is the section of my =init.el= that deals with org-mode (if you
need more, let me know):

--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
;;;
;; Org Mode related
;;;

(setq org-directory "~/Dropbox/org")

;; Set a location for the list of agena files
(setq org-agenda-files "~/.emacs.d/agenda_files")

;; Assigns org-mode to .org files
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
(when window-system (require 'org-mouse))

;; Auto enable flyspell-mode
(add-hook 'org-mode-hook 'turn-on-flyspell)

;; Auto fill minor mode in org files
(add-hook 'org-mode-hook 'turn-on-auto-fill)

;; Enable org-indent-mode for org buffers
(add-hook 'org-mode-hook
  (lambda ()(org-indent-mode t)) t)

;; Use text-mode abbrev table in org-mode
(add-hook 'org-mode-hook '(lambda () (setq local-abbrev-table
text-mode-abbrev-table)))

;; Enables selection using SHIFT, while maintaining useful actions
;; related to SHITF in org
(setq org-support-shift-select 't)

;; Enable smart qoutes (http://stackoverflow.com/q/15097114/671013)
(setq org-export-with-smart-quotes t)

;; Customize the TODO-like keywords
(setq org-use-fast-todo-selection t)
(setq org-todo-keywords
  '((sequence "TODO(t)" "PROCESS(p@/!)" "|" "DONE(d!)" "CANCELED(c@
/!)")))
(setq org-todo-keyword-faces
  (quote (("TODO" :foreground "red" :weight bold)
  ("PROCESS" :foreground "blue" :weight bold)
  ("DONE" :foreground "forest green" :weight bold)
  ("CANCELLED" :foreground "forest green" :weight bold
(setq org-log-into-drawer t)

;; Capture-org
(setq org-default-notes-file (concat org-directory "/notes.org"))
(define-key global-map "\C-cc" 'org-capture)

(setq org-capture-templates
  (quote (("t" "todo" entry (file (concat org-directory "/gtd.org"))
   "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
  ("n" "note" entry (file (concat org-directory "/gtd.org"))
   "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
  ("j" "Journal" entry (file+datetree (concat org-directory "/
diary.org"))
   "* %?\n%U\n" :clock-in t :clock-resume t)
  ("v" "Vocabulary" entry
   (file+headline (concat org-directory "/vocab.org")
  "Vocabulary")
   "* %^{The word} :drill:\n:PROPERTIES:\n:Part-of-speech:
%^{Part of speech|verb|noun|adj|adv}\n:END:\n %t\n %^{Extended word (may be
empty)} \n** Answer \n%^{The definition}")
  )))

;; Make use of refTeX in org-mode
(defun org-mode-reftex-setup ()
  "Setups RefTeX to be used with a org file. Code is based on
http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/.

Once you run this, you will be asked to set a master file of the org."
  (interactive)
  (load-library "reftex")
  (and (buffer-file-name)
   (file-exists-p (buffer-file-name))
   (reftex-parse-all))
  (define-key org-mode-map (kbd "C-c )") 'reftex-citation)
  )

;; Open indirect buffer in new frame
(setq org-indirect-buffer-display 'new-frame)

;; Set common TAGS
;; Check:
http://sachachua.com/blog/2008/01/tagging-in-org-plus-bonus-code-for-timeclocks-and-tags/
(setq org-tag-alist '(
  ("PRIVATE" . ?p)
  (:startgroup . nil)
  ("WORK

Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-25 Thread Dror Atariah
I am sorry for reposting, but I'm still in the dark. Am I the only one who
experience this kind of issue? Did someone managed to reproduce the
problem? Does anyone see this message? :)

On Sat, May 23, 2015 at 8:49 PM, Dror Atariah  wrote:

> I am still helpless here. Any idea how to debug the problem? I would be
> happy to provide any kind of help, but I just cannot do it myself.
>
> Further findings:
> 1) I don't think that matplotlib changes Python's '_', since the tmp file
> that contains the content of '_' is correct.
> 2) Somehow, emacs/orgmode fails to extract the filename.
> 3) It doesn't work also when using emacs 24.5 and orgmode 8.2.10.
>
>
> Following is an org file that tries to summarize the issue:
>
> #+TITLE: Integrate matplotlib figures in an org mode buffer
> * Goal
> The ultimate goal is to use org-babel as a replacement of IPython. The
> first motivation is to enable an easier version controling of the
> document. The first challenge I faced is integration of plots returned
> by ~matplotlib~ in the org buffer.
> * Capturing filename
>
> I would like to use (babel) orgmode as an interactive python
> notebook. Therefore, in order to allow the various code blocks to
> "know" each other, it is important to use the ~:session~
> option. However, once ~:session~ is used, together with ~matplotlib~
> the desired behavior is no longer in place.
>
> * Clean testing, no Matplotlib
> For the sake of testing, the following merely suppose to return the
> filename
>
> #+BEGIN_SRC python :session no_matplotlib :results file :exports both
> x = 'hello '
> y = 'world'
> z = x + y
> 'foo.bar'
> #+END_SRC
>
> #+RESULTS:
> [[file:foo.bar]]
>
> *Passed* Indeed, the ~RESULTS~ block contains a link to the filename
> indicated by the last string.
>
> * Importing Matplotlib
>
> The following minimal example should generate a simple figure,
> ~myfig.png~, and orgmode should capture it and interpret it as a
> filename to be used by the following ~RESULTS~ block.
>
> #+BEGIN_SRC python :session with_matplotlib :results file :exports both
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> fig=plt.figure(figsize=(3,2))
> plt.plot([1,3,2])
> plt.savefig('myfig.png')
> 'myfig.png'
> #+END_SRC
>
> #+RESULTS:
> [[file:]]
>
> *Failed!* This time, it doesn't work anymore. The file ~myfig.png~ is
>  properly generated, but the last string is not captured by
>  ~matplotlib~. Following is the content of the corresponding
>  interactive python session:
>
> #+BEGIN_SRC
> Process with_matplotlib finished
> Python 3.4.3 (default, Mar 10 2015, 14:53:35)
> [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> >>> >>> ,
> '''/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/py32771xVI''', 'exec'));
> import matplotlib
> >>> import matplotlib
> matplotlib.use('Agg')
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> import matplotlib.pyplot as plt
> fig=plt.figure(figsize=(3,2))
> fig=plt.figure(figsize=(3,2))
> plt.plot([1,3,2])
> plt.plot([1,3,2])
> plt.savefig('myfig.png')
> plt.savefig('myfig.png')
> 'myfig.png'
> 'myfig.png'
>
>
> open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-32771x4j/python-32771-fO',
> 'w').write(str(_))
> open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-32771x4j/python-32771-fO',
> 'w').write(str(_))
>
>
>
>
> 'org_babel_python_eoe'
> 'org_babel_python_eoe'
> >>> []
> >>> 'myfig.png'
> >>> >>> 9
> >>> >>> >>> 'org_babel_python_eoe'
> >>>
> #+END_SRC
>
> * Some background
>
> ** Python Version
> #+BEGIN_SRC python :session background :results raw
> import sys
> sys.version
> #+END_SRC
>
> #+RESULTS:
> 3.4.3 (default, Mar 10 2015, 14:53:35)
> [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
>
> ** Matplotlib version
> #+BEGIN_SRC python :session background :results raw
> import matplotlib
> matplotlib.__version__
> #+END_SRC
>
> #+RESULTS:
> 1.4.3
>
> ** System
> I am running Emacs version ~GNU Emacs 24.5.1 (x86_64-apple-darwin14.1.0,
> NS apple-appkit-1344.72) of 2015-04-19 on tenten-slave.macports.org~
>
> The orgmode version is: ~Org-mode version 8.2.10
> (8.2.10-40-gc763fa-elpaplus @
> /Users/drorata/.emacs.d/elpa/org-plus-contrib-20150518/)~
>
> ** Stackoverflow reference
> I also posted a question in the SE network:
> [[
> http://emacs.stackexchange.com/questions/11075/org-mode-python-session-does-not-return-a-file-name
> ]]
>
> * Question
> So, my question is how to tackle/debug this issue? Can someone give me
> a hand here? That would be really great! Thanks!
>
>


-- 
Dror Atariah, Ph.D.
de.linkedin.com/in/atariah


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-23 Thread Dror Atariah
I am still helpless here. Any idea how to debug the problem? I would be
happy to provide any kind of help, but I just cannot do it myself.

Further findings:
1) I don't think that matplotlib changes Python's '_', since the tmp file
that contains the content of '_' is correct.
2) Somehow, emacs/orgmode fails to extract the filename.
3) It doesn't work also when using emacs 24.5 and orgmode 8.2.10.


Following is an org file that tries to summarize the issue:

#+TITLE: Integrate matplotlib figures in an org mode buffer
* Goal
The ultimate goal is to use org-babel as a replacement of IPython. The
first motivation is to enable an easier version controling of the
document. The first challenge I faced is integration of plots returned
by ~matplotlib~ in the org buffer.
* Capturing filename

I would like to use (babel) orgmode as an interactive python
notebook. Therefore, in order to allow the various code blocks to
"know" each other, it is important to use the ~:session~
option. However, once ~:session~ is used, together with ~matplotlib~
the desired behavior is no longer in place.

* Clean testing, no Matplotlib
For the sake of testing, the following merely suppose to return the filename

#+BEGIN_SRC python :session no_matplotlib :results file :exports both
x = 'hello '
y = 'world'
z = x + y
'foo.bar'
#+END_SRC

#+RESULTS:
[[file:foo.bar]]

*Passed* Indeed, the ~RESULTS~ block contains a link to the filename
indicated by the last string.

* Importing Matplotlib

The following minimal example should generate a simple figure,
~myfig.png~, and orgmode should capture it and interpret it as a
filename to be used by the following ~RESULTS~ block.

#+BEGIN_SRC python :session with_matplotlib :results file :exports both
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
plt.savefig('myfig.png')
'myfig.png'
#+END_SRC

#+RESULTS:
[[file:]]

*Failed!* This time, it doesn't work anymore. The file ~myfig.png~ is
 properly generated, but the last string is not captured by
 ~matplotlib~. Following is the content of the corresponding
 interactive python session:

#+BEGIN_SRC
Process with_matplotlib finished
Python 3.4.3 (default, Mar 10 2015, 14:53:35)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> >>> ,
'''/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/py32771xVI''', 'exec'));
import matplotlib
>>> import matplotlib
matplotlib.use('Agg')
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
plt.plot([1,3,2])
plt.savefig('myfig.png')
plt.savefig('myfig.png')
'myfig.png'
'myfig.png'


open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-32771x4j/python-32771-fO',
'w').write(str(_))
open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-32771x4j/python-32771-fO',
'w').write(str(_))




'org_babel_python_eoe'
'org_babel_python_eoe'
>>> []
>>> 'myfig.png'
>>> >>> 9
>>> >>> >>> 'org_babel_python_eoe'
>>>
#+END_SRC

* Some background

** Python Version
#+BEGIN_SRC python :session background :results raw
import sys
sys.version
#+END_SRC

#+RESULTS:
3.4.3 (default, Mar 10 2015, 14:53:35)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]

** Matplotlib version
#+BEGIN_SRC python :session background :results raw
import matplotlib
matplotlib.__version__
#+END_SRC

#+RESULTS:
1.4.3

** System
I am running Emacs version ~GNU Emacs 24.5.1 (x86_64-apple-darwin14.1.0, NS
apple-appkit-1344.72) of 2015-04-19 on tenten-slave.macports.org~

The orgmode version is: ~Org-mode version 8.2.10
(8.2.10-40-gc763fa-elpaplus @
/Users/drorata/.emacs.d/elpa/org-plus-contrib-20150518/)~

** Stackoverflow reference
I also posted a question in the SE network:
[[
http://emacs.stackexchange.com/questions/11075/org-mode-python-session-does-not-return-a-file-name
]]

* Question
So, my question is how to tackle/debug this issue? Can someone give me
a hand here? That would be really great! Thanks!


[O] Capturing file name from python session when using matplotlib

2015-05-11 Thread Dror Atariah
* Capturing filename

I would like to use (babel) orgmode as an interactive python
notebook. Therefore, in order to allow the various code blocks to
"know" each other, it is important to use the ~:session~
option. However, once ~:session~ is used, together with ~matplotlib~
the desired behavior is no longer in place.

* Clean testing, no Matplotlib
For the sake of testing, the following merely suppose to return the filename

#+BEGIN_SRC python :session no_matplotlib :results file :exports both
x = 'hello '
y = 'world'
z = x + y
'foo.bar'
#+END_SRC

#+RESULTS:
[[file:foo.bar]]

*Passed* Indeed, the ~RESULTS~ block contains a link to the filename
indicated by the last string.

* Importing Matplotlib

The following minimal example should generate a simple figure,
~myfig.png~, and orgmode should capture it and interpret it as a
filename to be used by the following ~RESULTS~ block.

#+BEGIN_SRC python :session with_matplotlib :results file
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
plt.savefig('myfig.png')
'myfig.png'
#+END_SRC

#+RESULTS:
[[file:]]

*Failed!* This time, it doesn't work anymore. The file ~myfig.png~ is
 properly generated, but the last string is not captured by
 ~matplotlib~. Following is the content of the corresponding
 interactive python session:

#+BEGIN_SRC
Python 3.4.3 (default, Feb 27 2015, 00:22:26)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> >>> ,
'''/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/py27084Z6S''', 'exec'));
import matplotlib
import matplotlib
matplotlib.use('Agg')
>>> matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
plt.plot([1,3,2])
plt.savefig('myfig.png')
plt.savefig('myfig.png')
'myfig.png'
'myfig.png'


open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-2708423D/python-27084mEZ',
'w').write(str(_))
open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-2708423D/python-27084mEZ',
'w').write(str(_))




'org_babel_python_eoe'
'org_babel_python_eoe'
>>> >>> >>> >>> []
>>> 'myfig.png'
>>> >>> 9
>>> >>> >>> 'org_babel_python_eoe'
>>>
#+END_SRC

* Some background

** Python Version
#+BEGIN_SRC python :session background :results output
import sys
sys.version
#+END_SRC

#+RESULTS:
: import sys
: >>> sys.version
: '3.4.3 (default, Feb 27 2015, 00:22:26) \n[GCC 4.2.1 Compatible Apple
LLVM 6.0 (clang-600.0.56)]'
: sys.executable
: '/Users/drorata/py-envs/generic3.4/bin/python'
:
:

** System
I am running Emacs version ~GNU Emacs 24.4.51.1 (x86_64-apple-darwin14.1.0,
NS apple-appkit-1344.72) of 2015-02-02 on boxname.local~

The orgmode version is: ~Org-mode version 8.2.10
(8.2.10-40-gc763fa-elpaplus @
/Users/username/.emacs.d/elpa/org-plus-contrib-20150504/)~

** Stackoverflow reference
I also posted a question in the SE network:
[[
http://emacs.stackexchange.com/questions/11075/org-mode-python-session-does-not-return-a-file-name
]]

* Question
So, my question is how to tackle/debug this issue? Can someone give me
a hand here? That would be really great! Thanks!

-- 
Dror Atariah, Ph.D.
de.linkedin.com/in/atariah


Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-05 Thread Dror Atariah
Obviously, I have the directory in place, and the file is actually saved
properly in it. The version is use is:
Org-mode version 8.2.10 (8.2.10-40-gc763fa-elpaplus @
/Users/drorata/.emacs.d/elpa/org-plus-contrib-20150504/)

Finally, here is the output that I have in the python interactive session:

---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
>>> import matplotlib
import matplotlib
>>> matplotlib.use('Agg')
matplotlib.use('Agg')
import matplotlib.pyplot as plt
>>> import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
>>> fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
>>> plt.plot([1,3,2])
fig.tight_layout()
fig.tight_layout()
plt.savefig('images/myfig.png')
plt.savefig('images/myfig.png')
'images/myfig.png' # return this to org-mode
'images/myfig.png' # return this to org-mode


open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-22151hFS/python-22151B4O',
'w').write(str(_))
open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b18gn/T/babel-22151hFS/python-22151B4O',
'w').write(str(_))




'org_babel_python_eoe'
'org_babel_python_eoe'
[]
>>> 'images/myfig.png'
>>> >>> 16
>>> >>> >>> 'org_babel_python_eoe'
>>>
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<-------

>From this it seems like the right thing happens, but still org doesn't
manage to capture it. I'm still in the dark. At work I manage to get the
images inserted properly and it is simply fabulous! I want it also on my
mac!!! :)

Thanks in advance,
Dror



On Sat, May 2, 2015 at 7:11 PM, Nick Dokos  wrote:

> Dror Atariah  writes:
>
> > How can I solve this problem?
>
> I should have added: ... after I create the "images" directory.
> I don't think the savefig() can do that.
>
>
>


[O] [Orgmode] Unable to capture the file name generated using matplotlib

2015-05-02 Thread Dror Atariah
Consider the following example (from the documentation):

---8<---8<---8<---8<---8<---8<---8<---8<---8<---
#+begin_src python :session :results file
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
fig.tight_layout()
plt.savefig('images/myfig.pdf')
'images/myfig.pdf' # return this to org-mode
#+end_src
---8<---8<---8<---8<---8<---8<---8<---8<---8<---

It should return something like

---8<---8<---8<---8<---8<---8<---8<---8<---8<---
#+RESULTS:
[[file:images/myfig.pdf]]
---8<---8<---8<---8<---8<---8<---8<---8<---8<---

But for me it returns merely

---8<---8<---8<---8<---8<---8<---8<---8<---8<---
#+RESULTS:
[[file:]]
---8<---8<---8<---8<---8<---8<---8<---8<---8<---

That is, it doesn't capture the file name that should be the last
evaluation.

How can I solve this problem?


Re: [O] org-mode and python pandas

2015-04-29 Thread Dror Atariah
Using the tabulate python module it is possible to have the following
"inline" workaround:

8<8<8<8<8<8<8<
#+BEGIN_SRC python :results raw
import pandas as pd
import numpy as np
from tabulate import tabulate

df = pd.DataFrame(np.random.random((4,3)), columns=['A','B','C'])
print("foo")
return(tabulate(df, headers="keys", tablefmt="orgtbl"))
#+END_SRC

#+RESULTS:
|   |A |B |C |
|---+--+--+--|
| 0 | 0.754799 | 0.492722 | 0.144595 |
| 1 | 0.198475 | 0.417721 | 0.083459 |
| 2 | 0.645011 | 0.444857 | 0.278874 |
| 3 | 0.314883 |   0.7521 | 0.789418 |
8<8<8<8<8<8<8<

However, this is not optimal, mainly because it pollutes the code block.
Note, that the :results is set to `raw`.

A brief discussion with Dov, yielded the following better workaround:
8<8<8<8<
8<8<8<
(setq org-babel-python-wrapper-method "
def main():
%s

res = main()
if 'pandas.core.frame.DataFrame' in str(type(res)):
from tabulate import tabulate
out = tabulate(res, headers='keys', tablefmt='orgtbl')
else:
out = str(res)

open('%s', 'w').write(out)")
8<8<8<8<
8<8<8<

This allows a nice output of pandas.DataFrame (again when using :results
raw). Unfortunately, this wrapper has no influence in the case when
:session is used. To that end, it is possible to hack

8<8<8<8<
8<8<8<
(defun org-babel-python-evaluate-session
(session body &optional result-type result-params)
  "Pass BODY to the Python process in SESSION.
If RESULT-TYPE equals 'output then return standard output as a
string.  If RESULT-TYPE equals 'value then return the value of the
last statement in BODY, as elisp."
  (let* ((send-wait (lambda () (comint-send-input nil t) (sleep-for 0 5)))
 (dump-last-value
  (lambda
(tmp-file pp)
(mapc
 (lambda (statement) (insert statement) (funcall send-wait))
 (if pp
 (list
  "import pprint"
  (format "open('%s', 'w').write(pprint.pformat(_))"
  (org-babel-process-file-name tmp-file 'noquote)))
   (list (format "_org_tmp = _;

if 'pandas.core.frame.DataFrame' in str(type(_org_tmp)):
from tabulate import tabulate
_org_out = tabulate(_org_tmp, headers='keys', tablefmt='orgtbl')
else:
_org_out = _org_tmp

open('%s', 'w').write(str(_org_out))"
 (org-babel-process-file-name tmp-file
  'noquote)))
 (input-body (lambda (body)
   (mapc (lambda (line) (insert line) (funcall send-wait))
 (split-string body "[\r\n]"))
   (funcall send-wait)))
 (results
  (case result-type
(output
 (mapconcat
  #'org-babel-trim
  (butlast
   (org-babel-comint-with-output
   (session org-babel-python-eoe-indicator t body)
 (funcall input-body body)
 (funcall send-wait) (funcall send-wait)
 (insert org-babel-python-eoe-indicator)
 (funcall send-wait))
   2) "\n"))
(value
 (let ((tmp-file (org-babel-temp-file "python-")))
   (org-babel-comint-with-output
   (session org-babel-python-eoe-indicator nil body)
 (let ((comint-process-echoes nil))
   (funcall input-body body)
   (funcall dump-last-value tmp-file
(member "pp" result-params))
   (funcall send-wait) (funcall send-wait)
   (insert org-babel-python-eoe-indicator)
   (funcall send-wait)))
   (org-babel-eval-read-file tmp-file))
(unless (string= (substring org-babel-python-eoe-indicator 1 -1)
results)
  (org-babel-result-cond result-params
results
(org-babel-python-table-or-string results)
8<8<8<8<
8<8<8<

This works, but I would be surprised if this hack meets org-mode's
standards. Nevertheless, maybe someone would find it useful.

What do you think? How can it be improved?

Best,
Dror


[O] Scope of properties as variables for babel blocks

2014-09-16 Thread Dror Atariah
#+title: Scope of properties as variables for babel blocks
* Overview

I have the following scenario in mind: =func1= and =func2= are two
functions that can be executed in two modes: =foo= and =bar=. Each
mode yields a different set of results, that have to be discussed,
separately, in two different subtrees.

The goal is to have one subtree where they are executed in one mode
and a second subtree for the other mode.

The functions are defined in a dedicated [[Code][subtree]].

* Bar setting

Now, I want to execute the function in =bar= mode:
#+PROPERTY:  var mode="bar"

#+CALL: func1()

#+RESULTS:
: default

#+CALL: func2()

#+RESULTS:
: default

* Foo setting

In this node I want to execute  the functions in =foo= mode:
#+PROPERTY:  var mode="foo"

#+CALL: func1()

#+RESULTS:
: default

#+CALL: func2()

#+RESULTS:
: default

* Code
#+name: func1
#+begin_src python
return mode
#+end_src

#+RESULTS: func1
: foo

#+name: func2
#+begin_src python
return mode
#+end_src

#+RESULTS: func2
: default-val

* Question:

How can I implement this kind of workflow in a reproducible org mode
document?


Re: [O] specifying the coding language resulting from a a :results code source block

2014-09-12 Thread Dror Atariah
Indeed, this seems to do the trick!
Thanks!

On Thu, Sep 11, 2014 at 8:19 PM, Ista Zahn  wrote:

> Can't you just do
>
> #+begin_src foo :wrap src bar
>hello world
> #+end_src
>
> ?
>
> Best,
> Ista
>
>
> On Thu, Sep 11, 2014 at 5:11 AM, Dror Atariah  wrote:
> > Is there some change in the status of this issue? Can one now specify the
> > language of the result?
> >
> > Cheers,
> > Dror
> >
> > --
> > Mahalo Tom,
> >
> > It looks like that's what I'll be doing for the ruby block.  That said,
> it
> > would be great if the :results code argument would allow a language
> > specification.
> >
> > Greg
> >
> >
> > On Jun 27, 2012, at 10:22 AM, Thomas S. Dye wrote:
> >
> >> Greg Tucker-Kellogg  writes:
> >>
> >>> I have a Ruby block that creates some dot code.  I'd like to be able
> >>> to have the #+RESULTS block enclosed
> >>> in a src block that starts "#+BEGIN_SRC dot".  Using :results value
> >>> code generates the enclosing SRC block,
> >>> but using the same language (Ruby) used to generate the code.  Is
> >>> there a way to specify the coding language
> >>> of a generated #+RESULTS  src block?
> >>>
> >>> Thanks,
> >>>
> >>> Greg
> >>>
> >> Aloha Greg,
> >>
> >> This works for me with an emacs-lisp code block named harris-matrix that
> >> generates dot code.
> >>
> >> #+header: :var input=harris-matrix
> >> #+header: :file temp.pdf
> >> #+header: :cmdline -Tpdf
> >> #+header: :results output
> >> #+BEGIN_SRC dot
> >> $input
> >> #+END_SRC
> >>
> >> It's not quite what you were after, but it might help?
> >>
> >> All the best,
> >> Tom
> >>
> >> --
> >> Thomas S. Dye
> >> http://www.tsdye.com
>


[O] [babel][table] Passing argument to Python code block using org-sbe

2014-09-12 Thread Dror Atariah
Consider the following code:

-8<--
#+NAME: test
#+BEGIN_SRC python :var x="foobar"
return len(x)
#+END_SRC
-8<--

It is possible to call this, as follows:

-8<--
#+CALL: test(x="fb")
-8<--

However, I fail to call this function and pass an argument to it when using
org-sbe:
-8<--
| 6 | #ERROR |
#+TBLFM: @1$1='(org-sbe test)::@1$2='(org-sbe test (x ("fb")))
-8<--

I tried several possibilities, but nothing worked. Is it at all possible?

Thanks in advance,
Dror

PS: I posted also a SE question: http://stackoverflow.com/q/25789183/671013


Re: [O] specifying the coding language resulting from a a :results code source block

2014-09-11 Thread Dror Atariah
Is there some change in the status of this issue? Can one now specify the
language of the result?

Cheers,
Dror

--
Mahalo Tom,

It looks like that's what I'll be doing for the ruby block.  That said, it
would be great if the :results code argument would allow a language
specification.

Greg


On Jun 27, 2012, at 10:22 AM, Thomas S. Dye wrote:

> Greg Tucker-Kellogg  writes:
>
>> I have a Ruby block that creates some dot code.  I'd like to be able
>> to have the #+RESULTS block enclosed
>> in a src block that starts "#+BEGIN_SRC dot".  Using :results value
>> code generates the enclosing SRC block,
>> but using the same language (Ruby) used to generate the code.  Is
>> there a way to specify the coding language
>> of a generated #+RESULTS  src block?
>>
>> Thanks,
>>
>> Greg
>>
> Aloha Greg,
>
> This works for me with an emacs-lisp code block named harris-matrix that
> generates dot code.
>
> #+header: :var input=harris-matrix
> #+header: :file temp.pdf
> #+header: :cmdline -Tpdf
> #+header: :results output
> #+BEGIN_SRC dot
> $input
> #+END_SRC
>
> It's not quite what you were after, but it might help?
>
> All the best,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com


[O] Unable to use org-sbe

2014-09-11 Thread Dror Atariah
I'm trying to use org-sbe but keep failing... I'm trying to use the example
that can be found in the documentation of ob-table.el and the second column
is filled with #ERROR.

Here is the related output piped to *Messages*:

Re-applying formulas to full table...(line 10)
Re-applying formulas to 10 lines...done
Re-applying formulas...done [2 times]


I would be happy to provide further information, if only I'd know where to
look for it.

Org version:
Org-mode version 8.2.7c (8.2.7c-61-g4b9146-elpaplus @
/my/path/.emacs.d/elpa/org-plus-contrib-20140908/)

Thanks in advance,
Dror


Re: [O] Google + org-mode agenda? can it be done?

2014-03-12 Thread Dror Atariah
It seems like the function "org-export-icalendar-combine-agenda-files" (as 
discussed in the first link provided by @Matt) has to be replace with 
"org-icalendar-combine-agenda-files" when working with a new version of org. Am 
I right?

Cheers,
Dror
On Mar 5, 2014, at 22:50 PM, Matt Lundin wrote:

> Sharon Kimble  writes:
> 
>> Can the google calendar work with org-mode agenda please? I haven't
>> seen any indication that it can be done when I've been googling around.
>> But I thought that I would ask anyway. 
> 
> Synchronization is not seamless, but it can be accomplished with some
> setup. See:
> 
> http://orgmode.org/worg/org-tutorials/org-google-sync.html
> 
>> And on the same tack, can google tasks work with org-modes TODO lists
>> please?
> 
> This tool does bi-directional synchronization (org-files <-> google
> tasks). Note: it synchronizes files, not the agenda's todo list.
> 
> https://bitbucket.org/edgimar/michel-orgmode
> 
> Matt



[O] [BUG] Problem with org-mobile.el

2014-02-17 Thread Dror Atariah
In the past (http://article.gmane.org/gmane.emacs.orgmode/79803/) I had a 
problem with pushing using org-mobile, and it was solved as detailed in 
(http://thread.gmane.org/gmane.emacs.orgmode/79856/focus=79876). Indeed now the 
patch can be found in ELPA, but it still introduces the same problem as 
reported above. 

My setting is:
Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-03-13 on bob.porkrind.org
Package: Org-mode version 8.2.4 (8.2.4-3-g7fe99a-elpa @ 
/Users/drorata/.emacs.d/elpa/org-plus-contrib-20140217/)

Line #463 in org-mobile.el is:
((eq (car x) :grouptags) nil)

which should be the fix. I could fix the issue by moving this line after the 
following one, have:

((eq (car x) :newline) nil)
((eq (car x) :grouptags) nil)

for lines #463-464 instead of 

((eq (car x) :grouptags) nil)
((eq (car x) :newline) nil)

which is the current state.

Can someone verify this?

Best,
Dror

Re: [O] Unable to push to org-mobile

2014-01-20 Thread Dror Atariah
I'm sorry I keep bugging with this... ;)

On Dec 14, 2013, at 22:06 PM, Nick Dokos wrote:

> Nick Dokos  writes:
> 
>> Dror Atariah  writes:
>> 
>>> 2. What's next? I believe this is a bug... How can I report it?
>> 
>> Consider it reported - thanks for checking it. I'll push the proposed fix 
>> later
>> on today. If it is wrong, we can revert it later, but at least for now
>> it seems to fix the bug.
>> 
> 
> I pushed the patch.

I believe that the patch is wrong. The line
"((eq (car x) :grouptags) nil)" is currently (as per the version of ELPA) #463, 
but it yields the same error as the one I reported initially. I moved it to 
line #464 (right after the one with ":newline") and it solved the issue. 

1. Does it make sense?
2. If it does, then why?
3. Maybe you want to correct this?

All the best and cheers,
Dror


Re: [O] Unable to push to org-mobile

2014-01-12 Thread Dror Atariah

On Jan 12, 2014, at 14:26 PM, Bastien wrote:

> Hi Dror,
> 
> Dror Atariah  writes:
> 
>> So what's the point of the daily updates of the ELPA packages?
> 
> To get bug fixed when you use ELPA.

Wasn't the issue discussed originally in this thread a bug (and its fix)? Why 
it is not reflected in the ELPA? I just want to understand what's going on... 
No criticism or anything like that :)

Best,
Dror


Re: [O] Unable to push to org-mobile

2014-01-12 Thread Dror Atariah
On Jan 12, 2014, at 13:53 PM, Bastien wrote:

> Dror Atariah  writes:
> 
>> Update: I have just updated from ELPA, and the patch is not
>> there... I had to re-patch the missing line.
> 
> The ELPA packages are built from the maint branch, from the
> master branch, so patches in the master branch do not show up
> there, that's why you had to re-patch this.
So what's the point of the daily updates of the ELPA packages?

Best,
Dror



Re: [O] Unable to push to org-mobile

2014-01-12 Thread Dror Atariah

On Dec 15, 2013, at 15:17 PM, Nick Dokos wrote:

> Dror Atariah  writes:
> 
>> On Dec 14, 2013, at 22:06 PM, Nick Dokos wrote:
>> 
>>> Nick Dokos  writes:
>>> 
>>>> Dror Atariah  writes:
>>>> 
>>>>> 2. What's next? I believe this is a bug... How can I report it?
>>>> 
>>>> Consider it reported - thanks for checking it. I'll push the proposed fix 
>>>> later
>>>> on today. If it is wrong, we can revert it later, but at least for now
>>>> it seems to fix the bug.
>>>> 
>>> 
>>> I pushed the patch.
>> 
>> Does it mean that I could update the installation through ELPA tomorrow and 
>> the patch will be there?
>> 
> I don't think so - I pushed the patch to the master branch of the git
> repo. But I'm not clear on what happens next, so somebody else will have
> to answer your question.
Update: I have just updated from ELPA, and the patch is not there... I had to 
re-patch the missing line.

Best,
Dror


Re: [O] Unable to push to org-mobile

2013-12-14 Thread Dror Atariah

On Dec 14, 2013, at 22:06 PM, Nick Dokos wrote:

> Nick Dokos  writes:
> 
>> Dror Atariah  writes:
>> 
>>> 2. What's next? I believe this is a bug... How can I report it?
>> 
>> Consider it reported - thanks for checking it. I'll push the proposed fix 
>> later
>> on today. If it is wrong, we can revert it later, but at least for now
>> it seems to fix the bug.
>> 
> 
> I pushed the patch.

Does it mean that I could update the installation through ELPA tomorrow and the 
patch will be there?

Thanks for your help!
Dror


Re: [O] Unable to push to org-mobile

2013-12-14 Thread Dror Atariah
On Dec 13, 2013, at 23:08 PM, Nick Dokos wrote:

> Dror Atariah  writes:
> 
>> Managed to get [backtrace] output... 
>> 
>> You can find it here: https://gist.github.com/drorata/7950857
>> 
>> I could not find my way in this output... :(
>> 
> 
> If you look at the top of the backtrace it shows this:
> 
> ,
> | Debugger entered--Lisp error: (wrong-type-argument sequencep :grouptags)
> | mapconcat(identity ("PRIVATE" "{" "WORK" :grouptags "WORK@mittagseminar" 
> "WORK@open_questions" "WORK@diss" "WORK@CV" "}" "{" "IT" :grouptags 
> "IT@emacs" "IT@git" "IT@TeX" "}" "{" "PROG" :grouptags "PROG@mathematica" 
> "PROG@cgal" "}" "}" "4freeTime" "bms_friday" "emacs" "interesting_questions" 
> "mittagseminar" "Mittagsseminar" "NOTE" "private" "results" "work" "Yvinec" 
> "Ziegler") " ")
> | (insert "#+TAGS: " (mapconcat (quote identity) tags " ") "\n")
> | ...
> | org-mobile-create-index-file()
> `
> 
> The mapconcat line can be evaluated on its own - it does not depend on
> anything else. If you cut and paste it into your *scratch* buffer and
> modify it slightly like this:
> 
> --8<---cut here---start->8---
> (mapconcat 'identity '("PRIVATE" "{" "WORK" :grouptags "WORK@mittagseminar" 
> "WORK@open_questions" "WORK@diss" "WORK@CV" "}" "{" "IT" :grouptags 
> "IT@emacs" "IT@git" "IT@TeX" "}" "{" "PROG" :grouptags "PROG@mathematica" 
> "PROG@cgal" "}" "}" "4freeTime" "bms_friday" "emacs" "interesting_questions" 
> "mittagseminar" "Mittagsseminar" "NOTE" "private" "results" "work" "Yvinec" 
> "Ziegler") " ")
> --8<---cut here---end--->8---
> 
> and evaluate it with C-j, you get the exact error. Now look in
> org-mobile-create-index-file for the call
> 
> 
> (insert "#+TAGS: " (mapconcat 'identity tags " ") "\n")
> 
> You'll find it on line 470 (at least in the version I'm using).
> Before this line there is this code:
> 
> ...
> (setq def-tags (mapcar
> (lambda (x)
>   (cond ((null x) nil)
> ((stringp x) x)
> ((eq (car x) :startgroup) "{")
> ((eq (car x) :endgroup) "}")
> ((eq (car x) :newline) nil)
> ((listp x) (car x
> def-tags))
> (setq def-tags (delq nil def-tags))
> (setq tags (org-delete-all def-tags tags))
> (setq tags (sort tags (lambda (a b) (string< (downcase a) (downcase b)
> (setq tags (append def-tags tags nil))
> (insert "#+TAGS: " (mapconcat 'identity tags " ") "\n")
> ...
> 
> You'll notice that :startgroup is replaced by { , :endgroup is
> replaced by } and :newline is deleted - but there is no mention of
> :grouptags which leads me to suspect that there should be an extra
> line in there, perhaps
> 
> ((eq (car x) :grouptags) nil)
> 
> Maybe you can try it - better yet, maybe somebody who has some idea of
> how org-mobile works should take a look. I note that if I delete the
> :grouptags instances in the mapconcat call above, it completes without
> error.
Bingo! Adding this line allowed me to complete org-mobile-push successfully! 
Amazing. I have three closing questions:

1. What made you look into lines #460-464? Now when you pointed, it is somehow 
straightforward to check line #470, but there seems to be no indication 
regarding the broken code.
2. What's next? I believe this is a bug... How can I report it?
3. Finally, in the meanwhile, till the bug-fix is out, what is the best 
practice to maintain this patch locally?

Thanks a lot for your hand It was great having it!
Dror
> 
> Nick




Re: [O] Unable to push to org-mobile

2013-12-13 Thread Dror Atariah

On Dec 13, 2013, at 20:51 PM, Nick Dokos wrote:

> Dror Atariah  writes:
> 
>> On Dec 13, 2013, at 16:08 PM, Nick Dokos wrote:
>> 
>>> Dror Atariah  writes:
>>> 
>>>> Today I realized that I cannot execute successfully 'org-mobile-push'. In 
>>>> particular here is the output from '*Messages*':
>>>> 
>>>> Creating agendas...
>>>> Agenda written to Org file /Users/drorata/Dropbox/MobileOrg/agendas.org
>>>> Creating agendas...done
>>>> Saving all Org-mode buffers...
>>>> (No files need saving)
>>>> Saving all Org-mode buffers... done
>>>> Copying files...
>>>> Writing index file...
>>>> org-mobile-create-index-file: Wrong type argument: sequencep, :grouptags
>>>> 
>>>> I first step I took was to update the package; now 'org-version' yields 
>>>> "Org-mode version 8.2.4 (8.2.4-3-g7fe99a-elpa @
>>>> /Users/user/.emacs.d/elpa/org-plus-contrib-20131209/)". However,
>>>> problem is still
>>>> here.
>>>> 
>>>> Next I don't really know what to do... I have all my emacs' settings in 
>>>> https://github.com/drorata/emacs_setup
>>>> 
>>>> How can I debug this problem and solve it?
>>> 
>>> In the same way that you debug all such problems: toggle debug-on-error,
>>> try to do org-mobile-push again and look at the resulting backtrace (or
>>> post it so others can look at it).
>> I evaluated (setq debug-on-error t), and then executed org-mobile-push 
>> again. There was no output in the *Backtrace* buffer 
>> 
> 
> Try deleting the org-mobile.elc file and reloading org-mobile.el. Then
> try evaluating
> 
> (let ((debug-on-error t))
>  (org-mobile-push))
> 
> and see if that gives you a backtrace.

Managed to get output... 

You can find it here: https://gist.github.com/drorata/7950857

I could not find my way in this output... :(

>>> A shot in the dark: what's the value of org-tag-alist?
>> The value of org-tag-alist is:
>> 
>> (("PRIVATE" . 112)
>> (:startgroup)
>> ("WORK" . 119)
>> (:grouptags)
>> ("WORK@mittagseminar" . 109)
>> ("WORK@open_questions" . 105)
>> ("WORK@diss" . 100)
>> ("WORK@CV")
>> (:endgroup \.nil)
>  ^
> This looks strange to me, although it's not clear it would cause the
> problem even if it is wrong (which it may or may not be).
Indeed strange, and probably a typo. There was a missing space. I corrected 
this before taking the measures you mentioned above.
> 
> Nick
> 

Best,
Dror

Re: [O] Unable to push to org-mobile

2013-12-13 Thread Dror Atariah

On Dec 13, 2013, at 16:08 PM, Nick Dokos wrote:

> Dror Atariah  writes:
> 
>> Today I realized that I cannot execute successfully 'org-mobile-push'. In 
>> particular here is the output from '*Messages*':
>> 
>> Creating agendas...
>> Agenda written to Org file /Users/drorata/Dropbox/MobileOrg/agendas.org
>> Creating agendas...done
>> Saving all Org-mode buffers...
>> (No files need saving)
>> Saving all Org-mode buffers... done
>> Copying files...
>> Writing index file...
>> org-mobile-create-index-file: Wrong type argument: sequencep, :grouptags
>> 
>> I first step I took was to update the package; now 'org-version' yields 
>> "Org-mode version 8.2.4 (8.2.4-3-g7fe99a-elpa @ 
>> /Users/user/.emacs.d/elpa/org-plus-contrib-20131209/)". However, problem is 
>> still
>> here.
>> 
>> Next I don't really know what to do... I have all my emacs' settings in 
>> https://github.com/drorata/emacs_setup
>> 
>> How can I debug this problem and solve it?
> 
> In the same way that you debug all such problems: toggle debug-on-error,
> try to do org-mobile-push again and look at the resulting backtrace (or
> post it so others can look at it).
I evaluated (setq debug-on-error t), and then executed org-mobile-push again. 
There was no output in the *Backtrace* buffer 

> A shot in the dark: what's the value of org-tag-alist?
The value of org-tag-alist is:

(("PRIVATE" . 112)
 (:startgroup)
 ("WORK" . 119)
 (:grouptags)
 ("WORK@mittagseminar" . 109)
 ("WORK@open_questions" . 105)
 ("WORK@diss" . 100)
 ("WORK@CV")
 (:endgroup \.nil)
 (:startgroup)
 ("IT" . 73)
 (:grouptags)
 ("IT@emacs")
 ("IT@git")
 ("IT@TeX")
 (:endgroup)
 (:startgroup)
 ("PROG" . 112)
 (:grouptags)
 ("PROG@mathematica")
 ("PROG@cgal")
 (:endgroup)
 (:endgroup)
 ("4freeTime" . 52))

What should be the next step?

Thanks in advance!
Dror


[O] Unable to push to org-mobile

2013-12-13 Thread Dror Atariah
Today I realized that I cannot execute successfully 'org-mobile-push'. In 
particular here is the output from '*Messages*':

Creating agendas...
Agenda written to Org file /Users/drorata/Dropbox/MobileOrg/agendas.org
Creating agendas...done
Saving all Org-mode buffers...
(No files need saving)
Saving all Org-mode buffers... done
Copying files...
Writing index file...
org-mobile-create-index-file: Wrong type argument: sequencep, :grouptags

I first step I took was to update the package; now 'org-version' yields 
"Org-mode version 8.2.4 (8.2.4-3-g7fe99a-elpa @ 
/Users/user/.emacs.d/elpa/org-plus-contrib-20131209/)". However, problem is 
still here.

Next I don't really know what to do... I have all my emacs' settings in 
https://github.com/drorata/emacs_setup

How can I debug this problem and solve it?

[O] Line breaks in org-mode having version control in mind

2013-11-03 Thread Dror Atariah
I am trying to extend my usage of org, and one of the things I want to 
integrate is version controlling of my org files. This is obviously straight 
forward, but I am wondering about the best line breaking approach to use. In my 
LaTeX docs I maintain one physical line per sentence [1]. This way, when I 
change one word in a paragraph, it affects only one line, and looking for 
differences between versions is easy. Otherwise, when using fill-paragraph for 
instance, one gets messy changes of the file, as the one word change can 
influence the whole paragraph.

Therefore, as I mentioned, in LaTeX I use visual-line-mode and I insert 
manually line breaks at the end of sentences (or where *I* find appropriate). 
What would be the best practice for org? I understand that visual-line-mode has 
some problems when it comes to tables... What other issues are there? What do 
you do when you keep your org file under VC? 

Thanks in advance,
Dror

[1] http://tex.stackexchange.com/a/4378/412


Re: [O] Markup (blod for instance) over line breaks

2013-10-13 Thread Dror Atariah

On Oct 14, 2013, at 07:11 AM, Eric Abrahamsen wrote:

> Dror Atariah  writes:
> 
>> Dear org-moders,
>> 
>> It might be terribly simple, but I failed to find a solution. How can
>> I mark several words as bold (or emphasized or any similar markup),
>> in particular if the words spans over *more then one line*?
>> 
>> A similar problem can occur when one is pasting a long line into an
>> org-mode buffer and then, after it is being broken into shorter
>> lines, you try to make it bold.
>> 
>> The documentation (http://orgmode.org/org.html#Emphasis-and-monospace
>> ) states that this kind of markup is aimed at words - so it might not
>> support sentences and in particula r long ones... Is it correct?
>> 
>> Thanks in advance,
>> Dror
> 
> I use autofill mode, and then change the value of
> `org-emphasis-regexp-components'. That variable is a list, the fifth
> element of which says how many newlines the emphasis markers will allow.
> I set it to three:
> 
> (setf (nth 4 org-emphasis-regexp-components) 3)
Thanks for the tip. It somehow didn't help. I did "M-x org-reload" after 
setting this, but it didn't help spanning the italic in my case over several 
lines.


Cheers,
Dror


Re: [O] Markup (blod for instance) over line breaks

2013-10-13 Thread Dror Atariah

On Oct 13, 2013, at 22:22 PM, Marcin Borkowski wrote:

> Dnia 2013-10-13, o godz. 21:58:20
> Dror Atariah  napisał(a):
> 
>> 
>> On Oct 13, 2013, at 21:38 PM, Marcin Borkowski wrote:
>> 
>>> Dnia 2013-10-13, o godz. 20:49:30
>>> Dror Atariah  napisał(a):
>>> 
>>>> Dear org-moders,
>>>> 
>>>> It might be terribly simple, but I failed to find a solution. How
>>>> can I mark several words as bold (or emphasized or any similar
>>>> markup), in particular if the words spans over *more then one
>>>> line*?
>>>> 
>>>> A similar problem can occur when one is pasting a long line into an
>>>> org-mode buffer and then, after it is being broken into shorter
>>>> lines, you try to make it bold.
>>>> 
>>>> The documentation
>>>> (http://orgmode.org/org.html#Emphasis-and-monospace) states that
>>>> this kind of markup is aimed at words - so it might not support
>>>> sentences and in particular long ones... Is it correct?
>>> 
>>> Not really an answer, but does visual-line-mode help in your use
>>> case?
>> It does help. Doesn't org-mode has some sort of dedicated
>> line-breaking mechanism? How would you turn it into a complete
>> solution?
> 
> Not that I know of.  Basically, "lines" may be /visual/ (i.e., broken by
> the display engine at spaces etc., but the whole paragraph is one long
> line in the file) or /physical/ (i.e., with newline characters at the
> end of each line).  In Emacs, you an use M-q to "fill" a paragraph
> (more or less, convert from visual to physical lines), and something
> along the lines of C-u 9 9 9 9 9 C-x f M-q to "unfill" a paragraph.
> (There are also "unfill" functions (quod google), though they are not
> part of stock Emacs.)
> 
> There is an ongoing discussion on which is better, too long to repeat
> any of the arguments here.  For a LaTeX-centric approach, see e.g.
> http://tex.stackexchange.com/questions/4376/good-strategy-for-line-breaks-with-paragraphs-of-latex-source
> (note that Emacs's longline-mode was a predecessor of visual-line-mode).
In this case I suppose I will revert to visual-line-mode, just like I have in 
my LaTeX buffers. 

> And indeed, bold/italic spanning more than a few words might not be a
> good idea.  And in cases it is, it's problably better to define a
> specialized "environment" (in LaTeX lingo) - like one for theorems
> (which are often typeset in italics).
What is the org-mode's equivalent of LaTeX's environment? That COULD be very 
helpful.

Thanks,
Dror


Re: [O] Markup (blod for instance) over line breaks

2013-10-13 Thread Dror Atariah

On Oct 13, 2013, at 21:38 PM, Marcin Borkowski wrote:

> Dnia 2013-10-13, o godz. 20:49:30
> Dror Atariah  napisał(a):
> 
>> Dear org-moders,
>> 
>> It might be terribly simple, but I failed to find a solution. How can
>> I mark several words as bold (or emphasized or any similar markup),
>> in particular if the words spans over *more then one line*?
>> 
>> A similar problem can occur when one is pasting a long line into an
>> org-mode buffer and then, after it is being broken into shorter
>> lines, you try to make it bold.
>> 
>> The documentation
>> (http://orgmode.org/org.html#Emphasis-and-monospace) states that this
>> kind of markup is aimed at words - so it might not support sentences
>> and in particular long ones... Is it correct?
> 
> Not really an answer, but does visual-line-mode help in your use case?
It does help. Doesn't org-mode has some sort of dedicated line-breaking 
mechanism? How would you turn it into a complete solution?

Best,
Dror


[O] Markup (blod for instance) over line breaks

2013-10-13 Thread Dror Atariah
Dear org-moders,

It might be terribly simple, but I failed to find a solution. How can I mark 
several words as bold (or emphasized or any similar markup), in particular if 
the words spans over *more then one line*?

A similar problem can occur when one is pasting a long line into an org-mode 
buffer and then, after it is being broken into shorter lines, you try to make 
it bold.

The documentation (http://orgmode.org/org.html#Emphasis-and-monospace) states 
that this kind of markup is aimed at words - so it might not support sentences 
and in particular long ones... Is it correct?

Thanks in advance,
Dror

Re: [O] Unable to finalize capture

2013-10-04 Thread Dror Atariah
On Oct 4, 2013, at 23:04 PM, Nick Dokos wrote:

> Dror Atariah  writes:
> 
>>> M-x locate-library RET org RET
>> Returns:
>> Library is file ~/.emacs.d/elpa/org-plus-contrib-20130930/org.elc
> 
> N.B. Never used elpa, so take with appropriately sized grain of salt.
> 
> Not sure whether this is a problem, but why is org.elc in the main
> directory and not under
> 
> ~/.emacs.d/elpa/org-plus-contrib-20130930/org/lisp?
> 
> Maybe you are using a left-over org.elc?

Probably, this is somehow the case... I think the directory structure that you 
can see is the default one of ELPA - I don't think I tweaked it.


>>> and
>>> 
>>> M-x list-load-path-shadows RET
>> Returns (I hope I collected only the relevant entries):
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
>> /Users/user_name/.emacs.d/elpa/org-20130930/org
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
>> /Users/user_name/.emacs.d/elpa/org-20130812/org
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
>> /Users/user_name/.emacs.d/elpa/org-20130923/org
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130812/org
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130923/org
>> /Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
>> /Applications/Emacs.app/Contents/Resources/lisp/org/org
>> 
>> I guess that the above output suggests that org-mode is properly installed 
>> (via ELPA), isn't it? I'm afraid that I am not hinted by this output.
>> 
> 
> Check that your org.el does include the definition  of the variable.
> Then load the uncompiled version using an explicit path:
The file "~/.emacs.d/elpa/org-plus-contrib-20130930/org.el" contains the 
definition of the variable "org-bookmark-names-plist"

> M-x load-file RET /Users/user_name/.emacsd./elpa//org/lisp/org.el RET
> 
> *Now* is the variable defined? If so, does capture work?
Indeed, loading it manually, solved the problem.

> I'd probably clean up the .elc files and compile anew. Then restart
> emacs.
I didn't know how to recompile the files, and what exactly do you mean by 
cleaning the .elc's; so I did something else. I removed the old directories of 
org-mode from the ELPA directory, restarted emacs and it  now seems to work 
fine.

Thanks and all the best,
Dror


Re: [O] Unable to finalize capture

2013-10-04 Thread Dror Atariah
On Oct 4, 2013, at 14:56 PM, Nick Dokos wrote:

> Dror Atariah  writes:
> 
>> It seems like after the last update I've made to org-mode the
>> capturing of notes does not work properly. Currently I have version
>> 8.0.7 (20130930) from the ELPA. Hitting C-c c (i.e. org-capture)
>> brings the list of capture templates and then I can choose one of them
>> to open a buffer where I can actually entry the note. The problem is
>> that once I'm done, hitting C-c C-c doesn't close the capturing
>> buffer. The content is saved in the right place but I'm not returned
>> to the place where I started the capturing. In the *Messages* buffer I
>> get the following error: org-capture-finalize: Symbol's value as
>> variable is void: org-bookmark-names-plist
>> 
> 
> org-bookmark-names-plist is defined in org.el. Try evaluating
> 
> (require 'org)
This evaluation can be found in my init file. I can evaluate this manually 
without any problem. 

> and seeing if the variable is now defined:
> 
> C-h v org-bookmark-names-plist RET
The variable is not defined. Thus, I guess I'm facing the following case in 
your answer:

> If the variable is not defined, check whether you have some old
> obsolete org.el lying around:
> 
> M-x locate-library RET org RET
Returns:
Library is file ~/.emacs.d/elpa/org-plus-contrib-20130930/org.elc

> and
> 
> M-x list-load-path-shadows RET
Returns (I hope I collected only the relevant entries):
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
/Users/user_name/.emacs.d/elpa/org-20130930/org
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
/Users/user_name/.emacs.d/elpa/org-20130812/org
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
/Users/user_name/.emacs.d/elpa/org-20130923/org
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130812/org
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130923/org
/Users/user_name/.emacs.d/elpa/org-plus-contrib-20130930/org hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org

I guess that the above output suggests that org-mode is properly installed (via 
ELPA), isn't it? I'm afraid that I am not hinted by this output.

What further steps can I take?


[O] Unable to finalize a capture

2013-10-04 Thread Dror Atariah
It seems like after the last update I've made to org-mode the capturing of 
notes does not work properly. Currently I have version 8.0.7 (20130930) from 
the ELPA. 

Hitting `C-c c` (i.e. org-capture) brings the list of capture templates and 
then I can choose one of them to open a buffer where I can actually entry the 
note. The problem is that once I'm done, hitting `C-c C-c` doesn't close the 
capturing buffer. The content is saved in the right place but I'm not returned 
to the place where I started the capturing. In the *Messages* buffer I get the 
following error: 
"org-capture-finalize: Symbol's value as variable is void: 
org-bookmark-names-plist"

I don't really know where to start debugging this problem. Any ideas?

I believe the following are all the related setting that I have:

;; Capture-org
(setq org-default-notes-file (concat org-directory "/notes.org"))
(define-key global-map "\C-cc" 'org-capture)

(setq org-capture-templates
 (quote (("t" "todo" entry (file (concat org-directory "/gtd.org"))
  "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
 ("n" "note" entry (file (concat org-directory "/gtd.org"))
  "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
 ("j" "Journal" entry (file+datetree (concat org-directory 
"/diary.org"))
  "* %?\n%U\n" :clock-in t :clock-resume t)
 ("v" "Vocabulary" entry
  (file+headline (concat org-directory "/vocab.org")
 "Vocabulary")
  "* %^{The word} :drill:\n:PROPERTIES:\n:Part-of-speech: %^{Part 
of speech|verb|noun|adj|adv}\n:END:\n %t\n %^{Extended word (may be empty)} 
\n** Answer \n%^{The definition}")
 )))


[O] Unable to finalize capture

2013-10-04 Thread Dror Atariah
It seems like after the last update I've made to org-mode the capturing of 
notes does not work properly. Currently I have version 8.0.7 (20130930) from 
the ELPA. Hitting C-c c (i.e. org-capture) brings the list of capture templates 
and then I can choose one of them to open a buffer where I can actually entry 
the note. The problem is that once I'm done, hitting C-c C-c doesn't close the 
capturing buffer. The content is saved in the right place but I'm not returned 
to the place where I started the capturing. In the *Messages* buffer I get the 
following error: org-capture-finalize: Symbol's value as variable is void: 
org-bookmark-names-plist

I don't really know where to start debugging this problem. Any ideas?

I believe the following are all the related setting that I have:

;; Capture-org
(setq org-default-notes-file (concat org-directory "/notes.org"))
(define-key global-map "\C-cc" 'org-capture)

(setq org-capture-templates
  (quote (("t" "todo" entry (file (concat org-directory "/gtd.org"))
   "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
  ("n" "note" entry (file (concat org-directory "/gtd.org"))
   "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
  ("j" "Journal" entry (file+datetree (concat org-directory 
"/diary.org"))
   "* %?\n%U\n" :clock-in t :clock-resume t)
  ("v" "Vocabulary" entry
   (file+headline (concat org-directory "/vocab.org")
  "Vocabulary")
   "* %^{The word} :drill:\n:PROPERTIES:\n:Part-of-speech: %^{Part 
of speech|verb|noun|adj|adv}\n:END:\n %t\n %^{Extended word (may be empty)} 
\n** Answer \n%^{The definition}")
  )))


Re: [O] Changing packages and their order in LaTeX export

2011-07-11 Thread Dror Atariah
>> I need to include 'amsmath' package in my LaTeX export. Using
>> #+LATEX_HEADER: \usepackage{xyz} adds it at the end of the list, and
>> then there are LaTeX related problems.
>> I tried to find where the default list is defined - it seems like it
>> is in org.el. However, I have several copies of this file, and I don't
>> know which one is the right one to change.
> 
> Does M-x customize-group RET org-export-latex RET show something that
> could be of interest to you.
This worked for me! Where did you find it in the manual? I looked there. 
Sometimes the manual's instructions are too cryptic for me - in the sense that 
I find the variable name, but I don't know how to change it.
> 
> As a user, in principle, you should refuse to look at elisp files. But
> it's a very good idea to look at the manuals though.
Thanks for the tip!

>> 2. If it is the org.el, then how can I tell which file is the one
>> which is used? Should I restart emacs after each edit of this file for
>> the changes to take effect?
Can you still answer this question? How can I ask emacs to tell me where is the 
file it is using and should I restart after each such change?

Thanks,
Dror




[O] Changing packages and their order in LaTeX export

2011-07-11 Thread Dror Atariah
I need to include 'amsmath' package in my LaTeX export. Using #+LATEX_HEADER: 
\usepackage{xyz} adds it at the end of the list, and then there are LaTeX 
related problems.

I tried to find where the default list is defined - it seems like it is in 
org.el. However, I have several copies of this file, and I don't know which one 
is the right one to change.

So, two questions:
1. Should I change the org.el or is it somewhere else?
2. If it is the org.el, then how can I tell which file is the one which is 
used? Should I restart emacs after each edit of this file for the changes to 
take effect?

Thanks!
Dror Atariah


Re: [O] Changing the font family in HTML export

2011-06-28 Thread Dror Atariah

On Jun 28, 2011, at 14:10 PM, Christian Moe wrote:

> Hi,
> 
> The tips you have received from others about customizing various variables 
> are likely to be what you want (will work for all your documents). But for 
> completeness' sake: to change things on a file-by-file basis, you can do it 
> Manuel's way, but without an external stylesheet, like this:
> 
> #+STYLE:html { font-family: Helvetica, sans-serif; font-size: 12pt; 
> }
> 
> Your custom CSS is included in the HEAD of the generated document, after the 
> default CSS, which it overrides.
This was most helpful actually! Thanks!
> 
> Yours,
> Christian
> 
> On 6/28/11 11:00 AM, Dror Atariah wrote:
>> This solved the problem. However, as you pointed out, in case I want to 
>> publish/share this generated html, I have to send as well another file, and 
>> it is not longer self contained. In the automatically, generated html, there 
>> is a section at the beginning:
>> --==--
>> 

Re: [O] Changing the font family in HTML export

2011-06-28 Thread Dror Atariah
This solved the problem. However, as you pointed out, in case I want to 
publish/share this generated html, I have to send as well another file, and it 
is not longer self contained. In the automatically, generated html, there is a 
section at the beginning:
--==--

[O] Changing the font family in HTML export

2011-06-28 Thread Dror Atariah
Dear org mode users,

I'm trying to change the font used when exporting .org to .html. At the moment, 
I get 
"

[O] Re: Update org-mode

2011-04-05 Thread Dror Atariah
Let me summarize the steps I carried out eventually, to use the package 
manager. Note, I am using emacs 23 based editor which was shipped with org-mode 
6.33.

* Updating
Follow the steps:
** Intsall the package manager
*** Download the =packages.el= file from
http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el.

Save in in =~/Library/elisp= for example.
*** Add the following code to the =.emacs=:
#+BEGIN_SRC elisp

(setq load-path (cons "~/Library/elisp" load-path))
(require 'package)
(package-initialize)

#+END_SRC

*** Verify
To verify this part, in /emacs/ hit =M-x list-packages RET org=. Here
you should see a list of optional packages. /Note:/ you may ignore the
warning: =failed to download org-mode archive=.
** Updating org-mode
*** Enter the =list-packages=
Hit =M-x list-packages RET=.

In there mark for installation by =i= the org package and the =x= for
the actual installation.
*** Restart emacs
*** Verify
Hit =M-x locate-library RET org= to verify the installation. You should now
have org-mode up and running.

Thank you all!
Dror

On Apr 1, 2011, at 18:24 PM, Jambunathan K wrote:

> Dror Atariah  writes:
> 
>> I tried to follow the update process described here:
>> http://orgmode.org/worg/org-faq.html under:
>> How do I keep current with bleeding edge development?
> 
> Search for ELPA in FAQ. Maybe that will work well for you ...
> 




Re: [O] Update org-mode

2011-04-03 Thread Dror Atariah
On Apr 3, 2011, at 11:55 AM, Christian Moe wrote:

> On 4/3/11 10:08 AM, Dror Atariah wrote:
>> # Where local software is found
>> #prefix=/usr/local
>> prefix=~/Applications
> 
> Hi,
> 
> Try
> 
> prefix=/Applications
> 
> without the tilde.

That made the trick! I'll try to follow and solve also the package-manager path.

THANKS!!!


[O] Re: Update org-mode

2011-04-03 Thread Dror Atariah
It seems like I have to install the package manager.

I followed the instructions in the org-mode FAQ. Added:

(setq load-path (cons "~/Library/elisp" load-path))
(require 'package)
(package-initialize)

To my .emacs, where packages.el located in ~/Library/elisp.

Then, when I restart Aquamacs I get the following error:

Warning (initialization): An error occurred while loading 
`/Users/drorata/.emacs':

Symbol's value as variable is void: package-subdirectory-regexp

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

What should I do?


Thanks for your time!!

Dror

On Apr 3, 2011, at 10:58 AM, Jambunathan K wrote:

> Dror Atariah  writes:
> 
>> Good morning Jambunathan,
>> 
>> I did consider this, however, I couldn't make this work for me
>> either. I think I'm running a too old version of Emacs/Aquamacs. If
>> you could help me set this up that would be great!!
> 
>> I am using Emacs 23.3.1 (i386-apple-darwin9.8.0, NS
>> apple-appkit-949.54) of 2011-03-19 on braeburn.aquamacs.org - Aquamacs
>> Distribution 2.2 on a mac OS 10.6.7.
> 
> I don't use Mac. But on my windows machine, I have installed
> ELPA/Orgmode on emacs-23.3.
> 
> Follow instructions in
> http://orgmode.org/worg/org-faq.html#installing-via-elpa
> 
> You have to install package manager first and then install new org-mode.
> 
> I don't know where exactly failure heppaned. Tell me which step
> failed. I would be able to help better.
> 
> Did Orgmode show up when you did M-x list-packages?
> 
> Jambunathan K.
> 

Dror Atariah
---
Landline:+49-30-43024501
Mobile: +49-176-67116376
Mobile (in IL): +972 54 5912389
IM:   dror...@gmail.com
   dror...@hotmail.com




Re: [O] Re: Update org-mode

2011-04-03 Thread Dror Atariah
I have added the following:

>>> (setq load-path (cons
>>>(expand-file-name "~/Library/elisp")
>>>load-path))
>>> (require 'org-install)

No change in the way Aquamacs+org-mode behaves. In particular version still 
shows 6.33x... :(


Re: [O] Update org-mode

2011-04-03 Thread Dror Atariah
@Christian: Here's my updated Makefile (at least the first part):

# Name of your emacs binary
EMACS=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs

# Where local software is found
#prefix=/usr/local
prefix=~/Applications

# Where local lisp files go.
lispdir   = $(prefix)/Aquamacs.app/Contents/Resources/lisp

# Where info files go.
infodir = $(prefix)/Aquamacs.app/Contents/Resources/info

Running the "make install" finally (after make && make doc) yielded a rather 
long process with lots of output. However, when I reopened Aquamacs and and 
.org file, the version checked still showed 6.33x

Anything I should do otherwise?

Thnx!

On Apr 2, 2011, at 22:13 PM, Christian Moe wrote:

> In the Makefile, what settings do you have under these headings?
> 
> # Name of your emacs binary
> # Where local software is found
> # Where local lisp files go.
> # Where info files go.
> 
> I'm one of the oddballs who compile and install every new Org version, 
> because in the start I thought that was the "right" way, and it's become a 
> habit.
> 
> The Makefile needs to point to the right paths for your Aquamacs application 
> and its site-lisp and info subdirectories. I don't use Aquamacs, but mutatis 
> mutandis it's probably similar to that for GNU Emacs on the Mac, namely:
> 
> # Name of your emacs binary
> EMACS=/Applications/Emacs.app/Contents/MacOS/emacs
> 
> # Where local software is found
> prefix=/Applications
> 
> # Where local lisp files go.
> lispdir = $(prefix)/Emacs.app/Contents/Resources/site-lisp
> 
> # Where info files go.
> infodir = $(prefix)/Emacs.app/Contents/Resources/info
> 
> I quickly found that git pulls would overwrite my hand-edited Makefile, and a 
> hand-edited Makefile caused conflicts on the next pull, and I didn't 
> understand git at all.
> 
> So I did a shell script that pulls org-mode, copies the Makefile, applies a 
> patch with the above changes to the Makefile, compiles and installs, and then 
> switches back the Makefile copy. Works for me.
> 
> Yours,
> Christian
> 
> 
> 
> On 4/1/11 5:20 PM, Dror Atariah wrote:
>> I tried to follow the update process described here:
>> http://orgmode.org/worg/org-faq.html under:
>> How do I keep current with bleeding edge development?
>> 
>> The only change I made was the place where I checked out the new version. 
>> Instead of ~/elisp I have ~/Library/elisp.
>> 
>> Everything went smooth, except that I had to add "sudo" before the "make 
>> install". Without the sudo, I got an "access denied" error. Anyway, at the 
>> end, I got no warnings and it seems like the process was smooth. But when I 
>> checked the version of org-mode in aquamacs it was still 6.33x
>> 
>> I am using Emacs 23.3.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
>>  of 2011-03-19 on braeburn.aquamacs.org - Aquamacs Distribution 2.2 on a mac 
>> OS 10.6.7.
>> 
>> What should I do in order to fix it?
>> 
>> Thanks in advance,
>> Dror
>> 
>> 
>> 
>> 
>> 
> 

Dror Atariah
---
Landline:+49-30-43024501
Mobile: +49-176-67116376
Mobile (in IL): +972 54 5912389
IM:   dror...@gmail.com
   dror...@hotmail.com




[O] Re: Update org-mode

2011-04-01 Thread Dror Atariah
> #+begin_src elisp
> (setq load-path (cons
> (expand-file-name "~/Library/elisp")
> load-path))
> (require 'org-install)
> #+end_src
> 
@Yagnesh: where should I plug this code into?





[O] Update org-mode

2011-04-01 Thread Dror Atariah
I tried to follow the update process described here:
http://orgmode.org/worg/org-faq.html under:
How do I keep current with bleeding edge development?

The only change I made was the place where I checked out the new version. 
Instead of ~/elisp I have ~/Library/elisp.

Everything went smooth, except that I had to add "sudo" before the "make 
install". Without the sudo, I got an "access denied" error. Anyway, at the end, 
I got no warnings and it seems like the process was smooth. But when I checked 
the version of org-mode in aquamacs it was still 6.33x

I am using Emacs 23.3.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
 of 2011-03-19 on braeburn.aquamacs.org - Aquamacs Distribution 2.2 on a mac OS 
10.6.7.

What should I do in order to fix it?

Thanks in advance,
Dror






Re: [Orgmode] Re: Using latexmk for LaTeX compilation

2011-02-08 Thread Dror Atariah
> This setting works for me to produce pdfs via latexmk.
> 
> (setq org-latex-to-pdf-process (list "latexmk -f -pdf %f"))
> 
This almost solved my problem - after changing %f to %s it worked as expected.
Thnx!


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Using latexmk for LaTeX compilation

2011-02-08 Thread Dror Atariah
I want to use latexmk as the LaTeX exporting engine, I following this link's 
(http://orgmode.org/worg/org-faq.html#using-xelatex-for-pdf-export) 
instruction, but it didn't work.

Note, that exporting the .org to .tex file and then manually running latexmk 
-pdf works flawlessly.

I'm very new to emacs and I can't find what is wrong here.

I also posted a question here 
http://tex.stackexchange.com/questions/10562/emacs-org-mode-and-latexmk. You 
can find some more details there.

Thanks a lot!
Dror
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode