emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Dror Atariah
Subject: Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib
Date: Tue, 26 May 2015 15:11:44 +0200

On Mon, May 25, 2015 at 8:30 PM, John Kitchin <address@hidden> 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

On Mon, May 25, 2015 at 2:22 PM, Dror Atariah <address@hidden> wrote:
On Mon, May 25, 2015 at 7:29 PM, Ken Mankoff <address@hidden> wrote:

On 2015-05-25 at 13:25, Dror Atariah <address@hidden> 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)

(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
(setq org-tag-alist '(
                      ("PRIVATE" . ?p)
                      (:startgroup . nil)
                      ("WORK" .?w)
                      (:grouptags . nil)
                      ("address@hidden" . ?m)
                      ("address@hidden" . ?i)
                      ("address@hidden" . ?d)
                      ("address@hidden" . nil)
                      (:endgroup . nil)
                      (:startgroup . nil)
                      ("IT" . ?I)
                      (:grouptags . nil)
                      ("address@hidden" . nil)
                      ("address@hidden" . nil)
                      ("address@hidden" . nil)
                      (:endgroup . nil)
                      (:startgroup . nil)
                      ("PROG" . ?p)
                      (:grouptags . nil)
                      ("address@hidden" . nil)
                      ("address@hidden" . nil)
                      (:endgroup . nil)
                      (:endgroup . nil)
                      ("4freeTime" . ?4)
                      ))

;; Targets include this file and any file contributing to the agenda - up to 9 levels deep
(setq org-refile-targets (quote ((nil :maxlevel . 9)
                                 (org-agenda-files :maxlevel . 9))))

;; Add time stamp of refiling
(setq org-log-refile 'time)

;; Use full outline paths for refile targets - we file directly with IDO
(setq org-refile-use-outline-path t)

;; Targets complete directly with IDO
(setq org-outline-path-complete-in-steps nil)

;; Allow refile to create parent tasks with confirmation
(setq org-refile-allow-creating-parent-nodes (quote confirm))

;; Use IDO for both buffer and file completion and ido-everywhere to t
(setq org-completion-use-ido t)
(setq ido-everywhere t)
(setq ido-max-directory-size 100000)
(ido-mode (quote both))

;; set latexmk the default LaTeX compiler for org-mode and in general
(setq org-latex-to-pdf-process (list "latexmk -f -pdf %f"))

;; Enable clocking across sessions
(setq org-clock-persist 'history)
(org-clock-persistence-insinuate)

;; Set the number of clock items before wrapping them in a LOGBOOK drawer
(setq org-clock-into-drawer '2)

;; Set the number of clock items before wrapping them in a LOGBOOK drawer
(setq org-clock-into-drawer '2)

;; MobileOrg
(load "mobileorg-setup")

;; Org drill
(require 'org-drill)
(setq org-drill-save-buffers-after-drill-sessions-p nil)
(setq org-drill-scope 'file-no-restriction)

;; org2blog
(require 'metaweblog)
(require 'org2blog-autoloads)

;; Babel
(setq org-src-preserve-indentation t) ;; http://stackoverflow.com/a/20903001/671013

(setq org-src-fontify-natively t)

(setq org-confirm-babel-evaluate nil)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((elasticsearch . t)
   (emacs-lisp . t)
   (python . t)
   (R . t)))
------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------

Best,
Dror




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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]