Re: [O] python sessions
Am 27.03.2013 07:19, schrieb Andreas Röhler: Am 26.03.2013 22:41, schrieb Gary Oberbrunner: I did some further testing. With my patch, my real org-mode python file is now actually working. There were a few gotchas I didn't understand about session mode and python and matplotlib: 1. In session mode, you are essentially running an interactive python. (This is made explicit by my patch, which passes -i). 2. In interactive mode, blank lines are special: they indicate the end of an indented block. So you have to write your org-mode python a little differently when using session mode. 3. matplotlib uses an interactive backend when started from an interactive python (sensibl y). So you have to set the backend explicitly when using session mode, or it hangs forever with no indication what's wrong. 4. ob-python does not handle python errors at all in session mode: it ignores them silently. This makes it really hard to debug the python code. I'd like to document #s 1-3; where should that go? I'd like to work on a patch for #4; it seems like the only thing is to search in the session buffer for likely error strings. Is there any better method anyone can think of? AFAIU the error string is missing, because it's sent the wrong path-to-interpreter, i.e. using shell-command. Shell returns 0 or 1, not the Python errors. Also the interactive spec is related. Usually Python shell as started from py-shell or run-python include this already. When send from a python-mode, also the empty lines you mentioned and related stuff is treated. Andreas That turned out not being the case. I'm quoting: This is incorrect. In session mode, there is one long-running python interpreter session. Emacs passes it code snippets, and it spits out stdout and stderr (all mixed up: output from your program, the lines themselves which get echoed, prompts, and error messages if any). There is never any return value since the python interpreter doesn't exit. The only way to handle errors in interactive mode AFAICS is to use approximate regexes to look for errors, un-handled exceptions and so on. Cheers
Re: [O] Export of superscripts in LaTeX (e.g. ^1)
John Hendy writes: - ^1 this is a note about something #+end_src I'm copying/pasting from a previous Org document, so I know this used to work. Now, instead of a superscripted 1, it exports as 1 with a hat (accented one with tiny caret above the 1). Indeed, and not just in latex (tested html). To take a slightly less strange example: Revelle and Suess examined ^{14}C ratios in the ocean and atmosphere to find how quickly carbon was exchanged between them. I seem to remember this used to work, too. Yours, Christian
Re: [O] org-check.org confusion
Hi David, Loyall, David wrote: But how do I, also an Emacs newbie, know that? Well, lock files aren't peculiar to Emacs. Have a look: http://en.wikipedia.org/wiki/File_locking#Lock_files :) How do you remove the lock? Well, first close all your Emacs buffers (on any machine, anywhere) that are pointed at the org-check.org file. Then see if the lock file is still there. If it's there, and you're not editing the file in an Emacs buffer, than the lock is stale. Manually delete it. (Alternatively, Emacs has some user interface for doing this. It is described in that info page ^^^.) When you open f.org, if there is an #f.org# file, Emacs will let you know: You should recover this file is displayed in the echo area. Then, simply type M-x recover-this-file, and answer: - yes, to overwrite f.org with that auto-saved version - no, to simply delete #f.org# FYI, I've customized the color `recover-this-file' with an orange background in order to clearly see that Emacs has something to tell me, even if I overlooked the msg in the echo area: ... (recover-this-file ((,class (:background white :background #FF3F3F Best regards, Seb -- Sebastien Vauban
Re: [O] [BUG] [ODT] Subtree export gives wrong footnote style
Nicolas Goaziou writes: I understood your problem, but I needed to know how deep I had to change paragraph styles. Pardon the noise. Would you mind testing the following patch? I added two new styles. Feel free to correct them if needed. * The patch fixes the announced bug. Thank you! All footnotes appear in Footnote style again, regardless of whether the footnote definitions are located within the exported subtree. This is an important fix, I think. The output was difficult to correct within LibreOffice. * The new styles don't seem to get applied Quote and center blocks in footnotes do not get OrgFootnoteQuotations style in my test. They remain Footnote. (You didn't add any OrgFootnoteVerse style, but I tried it out anyway. A verse block inside a footnote appears as OrgVerse.) I include below a test Org fragment and attach the resulting ODT. * Testing ODT with footnotes This is a text, with classical footnotes.[fn:1] Some aspire to poetry,[fn:2] others just seek typographic effect.[fn:3] [fn:2] This is another footnote in the same subtree. It's followed by a bit of doggerel. #+begin_verse I think that I shall never see a poem lovely as a tree. #+end_verse * Footnotes [fn:1] This is a footnote. It should be in Footnote style in ODT export. It's followed by a quote block. #+begin_quote I see that it is long, said Alice, but how can a tail be sad? #+end_quote [fn:3] This is a third footnote followed by a center block. #+begin_center Centered text here. #+end_center Yours, Christian org.odt Description: application/vnd.oasis.opendocument.text
Re: [O] phone links...
* Robert Goldman rpgold...@sift.info wrote: Since I keep my todo tasks in my org files, and some of them involve phone calls, I made a rudimentary handler for phone: links that I would like to contribute. It features a link declaration (in org-phone.el) and an ancillary script (currently only working on Mac OS X, but should be translatable to other platforms) that can be used to place skype calls to the phone numbers. One thing it does not do is support interactive entry of phone numbers. Cool stuff! Thank you! I want to add a pointer (not particularly for you) here to Memacs (see signature) which is able to automatically add Android phone calls (and more) to your Agenda. Of course, anyone can add a Memacs module for other phone call logs and even Skype call logs (if there are any which can be parsed easily). -- mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode: get Memacs from https://github.com/novoid/Memacs https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github
[O] [PATCH] replace function name in org-bbdb
Hi, org-bbdb-anniversary was not working on my system before using bbdb3 from package.el (probably from MELPA...). This fixes this by renaming a function which has been changed upstream. I hope the patch is OK. –Rasmus -- Dung makes an excellent fertilizer From 3ce26475161fb532cd4a4eedfba298acc9055a48 Mon Sep 17 00:00:00 2001 From: Rasmus (T60p) ras...@pank.eu Date: Sat, 30 Mar 2013 04:12:22 +0100 Subject: [PATCH] Org-bbdb: fix for renamed function in bbdb3 * lisp/org-bbdb.el: `bbdb-record-note' is now `bbdb-record-xfield' in bbdb3 (changelog 2012-12-25 by Roland Winkler). See e.g. http://permalink.gmane.org/gmane.emacs.bbdb.user/3424 TINYCHANGE --- lisp/org-bbdb.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index a45a26f..1f71345 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -116,8 +116,8 @@ (declare-function bbdb-search-name ext:bbdb-com (regexp optional layout)) (declare-function bbdb-search-organization ext:bbdb-com (regexp optional layout)) -;; `bbdb-record-note' is part of BBDB v3.x -(declare-function bbdb-record-note ext:bbdb (record label)) +;; `bbdb-record-xfield' is part of BBDB v3.x +(declare-function bbdb-record-xfield ext:bbdb (record label)) (declare-function calendar-leap-year-p calendar (year)) (declare-function diary-ordinal-suffix diary-lib (n)) @@ -312,7 +312,7 @@ The anniversaries are assumed to be stored `org-bbdb-anniversary-field'. (when (setq annivs (if old-bbdb (bbdb-record-getprop rec org-bbdb-anniversary-field) - (bbdb-record-note + (bbdb-record-xfield rec org-bbdb-anniversary-field))) (setq annivs (if old-bbdb (bbdb-split annivs \n) -- 1.8.2
Re: [O] Proposal for new/updated exporter tutorials on Worg
Hi John, thanks for the great work so far! This is of huge help. John Hendy jw.he...@gmail.com writes: My thinking on this is that Org-8.0 is a significant step, however it would be nice to write documentation as it pertains to Org 8.0 and not constantly in reference to how it's different from Org-7.x. Agreed. If there is no indication on the Worg page, users should be right in assuming this is for the latest stable version. Instead of an OUTDATED cookie, I suggest introducing #+PROPERTY: OrgCompat_ALL 8.0 7.9 7.8 7.7 (... using values from `customize-package-emacs-version-alist') in a setup file and #+PROPERTY: OrgCompatible 8.0 in files where instructions are relevant starting from 8.0. Then a macro could insert that compatible version. What do you think? -- Bastien
Re: [O] org-capture equivalent of org-remember's % ?
Hi Adam, Adam Spiers orgm...@adamspiers.org writes: I'm finally switching from org-remember to org-capture. M-x org-capture-import-remember-templates works fine except that it doesn't know how to translate %, which causes a jump to the target location immediately after storing the note. Is there an org-capture equivalent of org-remember's % ? You can now use :jump-to-captured in your template. Thanks for reporting this regression, -- Bastien
Re: [O] [PATCH] replace function name in org-bbdb
Hi Rasmus, Rasmus ras...@gmx.us writes: org-bbdb-anniversary was not working on my system before using bbdb3 from package.el (probably from MELPA...). This fixes this by renaming a function which has been changed upstream. Looks good. Is there any versioning we can check in order to know what function's name will the users use? Otherwise, this may break several users setup. Let us know, thanks, -- Bastien
Re: [O] Bug: Command org-toggle-pretty-entities does not display x_{i}^{j} correctly [7.9.4 (7.9.4-elpa @ /home/jae/.emacs.d/elpa/org-20130325/)]
Jae Hee Lee dscha...@googlemail.com writes: Command org-toggle-pretty-entities does not display x_{i}^{j} correctly. When subscript and supersript _{i} and ^{j} are combined, _{i} is displayed correctly as subscript, but ^{j} is not displayed as superscript. Fixed, thanks for reporting this. -- Bastien
Re: [O] org-babel header documentation
Eric Abrahamsen e...@ericabrahamsen.net writes: Eric Schulte schulte.e...@gmail.com writes: Exists on Worg? Sorry for my obtuseness, but I'm not finding it. http://orgmode.org/worg/org-contrib/babel/header-args.html Great! I just saw mention of the wrap header argument in another thread but that doesn't appear on this page, could we trouble you to add it? It would be *great* to have one canonical spot listing all the possibilities... I think this page is more for ancillary notes and tricks, the canonical spot is the manual, and it does mention the wrap header argument (apparently the preferred name is drawer). See the following. http://orgmode.org/manual/results.html Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte
Re: [O] [PATCH] replace function name in org-bbdb
Bastien, org-bbdb-anniversary was not working on my system before using bbdb3 from package.el (probably from MELPA...). This fixes this by renaming a function which has been changed upstream. Looks good. Is there any versioning we can check in order to know what function's name will the users use? bbdb3 hasn't been released yet. It's a moving target and I would assume that people who use it are on the edge of the development. . . The function(s) in question were renamed four months ago. In any case this function will check that one has a sufficiently new version of of bbdb (based on the change log I linked to in the commit message). Should I make a local version of the bbdb field lookup function and let the value be determined by the test below? I unfortunately don't know what the version was called around 2012/12/25 so I test using the date, which may or may not be too fragile. #+BEGIN_SRC emacs-lisp (when (fboundp 'bbdb-version) (string-match \\([0-9]\\{4\\}/[0-9]\\{2\\}/[0-9]\\{2\\}\\) (bbdb-version)) (version= (replace-regexp-in-string / . (match-string 1 (bbdb-version))) 2012.12.25)) #+END_SRC Thanks, Rasmus -- May the Force be with you
Re: [O] org-capture equivalent of org-remember's % ?
Bastien, You are amazing. That is all. :) Greetings from the awesome #emacsconf, Adam On 30 March 2013 14:44, Bastien b...@altern.org wrote: Hi Adam, Adam Spiers orgm...@adamspiers.org writes: I'm finally switching from org-remember to org-capture. M-x org-capture-import-remember-templates works fine except that it doesn't know how to translate %, which causes a jump to the target location immediately after storing the note. Is there an org-capture equivalent of org-remember's % ? You can now use :jump-to-captured in your template. Thanks for reporting this regression, -- Bastien
[O] Export problem with source code blocks
Aloha all, The following code block executes fine in the Org buffer, and it exported cleanly on January 18th, but fails on export to LaTeX with a recent version of Org from the git repo. Here is the error message: executing Emacs-Lisp code block (plos-one-start)... Debugger entered--Lisp error: (void-function first) (first row) #+name: plos-one-start #+header: :var tab=author-table #+header: :var title=A Regional Chronology #+header: :results raw :wrap latex #+header: :exports results #+begin_src emacs-lisp (defun author-name (recs) Format the author name list. (let ((i 0)) (mapcar (lambda (row) (concat (format %s$^{%d%s (first row) (incf i) (if (equal yes (eighth row)) ,\\ast )) (if (equal row (car (last recs))) }$ }$,))) recs))) (defun author-affiliation (recs) Format the author affiliation list. (let ((i 0)) (mapcar (lambda (row) (format \\bf{%d} %s, %s, %s, %s, %s (incf i) (second row) (third row) (fourth row) (fifth row) (sixth row))) recs))) (defun corresponding-email (recs) Return the corresponding email. (mapcar (lambda (row) (format %s (if (equal yes (eighth row)) (seventh row) ))) recs)) (let* ((tab (cdr (cdr tab))) (a (author-name tab)) (b (author-affiliation tab)) (c (corresponding-email tab))) (concat (format \\begin{flushleft}\n{\\Large\n\\textbf{%s}\n}\n\n title) (mapconcat 'identity a \n) \n\n (mapconcat 'identity b \n\n) \n\n$\\ast$ E-mail: (mapconcat 'identity c \n) \n\\end{flushleft})) #+end_src #+name: author-table | Author name | Department | Institution | City | State | Country | Email | Corresponding | |---++---+--+---+-+---+---| | Thomas S. Dye | Department of Anthropology | University of Hawai`i | Honolulu | HI| USA | t...@tsdye.com | yes | All the best, Tom -- T.S. Dye Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Export problem with source code blocks
Hi Tom, The `first' function is provided by the cl package. I'd either replace `first' with `car' in your code block, or add (require 'cl) to your personal Emacs configuration. Cheers, t...@tsdye.com (Thomas S. Dye) writes: Aloha all, The following code block executes fine in the Org buffer, and it exported cleanly on January 18th, but fails on export to LaTeX with a recent version of Org from the git repo. Here is the error message: executing Emacs-Lisp code block (plos-one-start)... Debugger entered--Lisp error: (void-function first) (first row) #+name: plos-one-start #+header: :var tab=author-table #+header: :var title=A Regional Chronology #+header: :results raw :wrap latex #+header: :exports results #+begin_src emacs-lisp (defun author-name (recs) Format the author name list. (let ((i 0)) (mapcar (lambda (row) (concat (format %s$^{%d%s (first row) (incf i) (if (equal yes (eighth row)) ,\\ast )) (if (equal row (car (last recs))) }$ }$,))) recs))) (defun author-affiliation (recs) Format the author affiliation list. (let ((i 0)) (mapcar (lambda (row) (format \\bf{%d} %s, %s, %s, %s, %s (incf i) (second row) (third row) (fourth row) (fifth row) (sixth row))) recs))) (defun corresponding-email (recs) Return the corresponding email. (mapcar (lambda (row) (format %s (if (equal yes (eighth row)) (seventh row) ))) recs)) (let* ((tab (cdr (cdr tab))) (a (author-name tab)) (b (author-affiliation tab)) (c (corresponding-email tab))) (concat (format \\begin{flushleft}\n{\\Large\n\\textbf{%s}\n}\n\n title) (mapconcat 'identity a \n) \n\n (mapconcat 'identity b \n\n) \n\n$\\ast$ E-mail: (mapconcat 'identity c \n) \n\\end{flushleft})) #+end_src #+name: author-table | Author name | Department | Institution | City | State | Country | Email | Corresponding | |---++---+--+---+-+---+---| | Thomas S. Dye | Department of Anthropology | University of Hawai`i | | Honolulu | HI | USA | t...@tsdye.com | yes | All the best, Tom -- Eric Schulte http://cs.unm.edu/~eschulte
Re: [O] org-babel header documentation
Eric Schulte schulte.eric at gmail.com writes: Eric Abrahamsen eric at ericabrahamsen.net writes: [snip] Great! I just saw mention of the wrap header argument in another thread but that doesn't appear on this page, could we trouble you to add it? It would be *great* to have one canonical spot listing all the possibilities... I think this page is more for ancillary notes and tricks, the canonical spot is the manual, and it does mention the wrap header argument (apparently the preferred name is drawer). See the following. http://orgmode.org/manual/results.html Preferred so as not to confuse 'wrap' with ':wrap', I guess. This is the link for the :wrap header argument. http://orgmode.org/manual/wrap.html HTH,
Re: [O] Export problem with source code blocks
Hi Eric, Yes, that fixes it. The cl package wasn't loaded for asynchronous export. The code executes in the buffer without an explicit (require 'cl). It's a mystery to me where it gets loaded in my setup, though. I don't do it explicitly--perhaps it tags along with some other package that I do load. Thanks, Tom Eric Schulte schulte.e...@gmail.com writes: Hi Tom, The `first' function is provided by the cl package. I'd either replace `first' with `car' in your code block, or add (require 'cl) to your personal Emacs configuration. Cheers, t...@tsdye.com (Thomas S. Dye) writes: Aloha all, The following code block executes fine in the Org buffer, and it exported cleanly on January 18th, but fails on export to LaTeX with a recent version of Org from the git repo. Here is the error message: executing Emacs-Lisp code block (plos-one-start)... Debugger entered--Lisp error: (void-function first) (first row) #+name: plos-one-start #+header: :var tab=author-table #+header: :var title=A Regional Chronology #+header: :results raw :wrap latex #+header: :exports results #+begin_src emacs-lisp (defun author-name (recs) Format the author name list. (let ((i 0)) (mapcar (lambda (row) (concat (format %s$^{%d%s (first row) (incf i) (if (equal yes (eighth row)) ,\\ast )) (if (equal row (car (last recs))) }$ }$,))) recs))) (defun author-affiliation (recs) Format the author affiliation list. (let ((i 0)) (mapcar (lambda (row) (format \\bf{%d} %s, %s, %s, %s, %s (incf i) (second row) (third row) (fourth row) (fifth row) (sixth row))) recs))) (defun corresponding-email (recs) Return the corresponding email. (mapcar (lambda (row) (format %s (if (equal yes (eighth row)) (seventh row) ))) recs)) (let* ((tab (cdr (cdr tab))) (a (author-name tab)) (b (author-affiliation tab)) (c (corresponding-email tab))) (concat (format \\begin{flushleft}\n{\\Large\n\\textbf{%s}\n}\n\n title) (mapconcat 'identity a \n) \n\n (mapconcat 'identity b \n\n) \n\n$\\ast$ E-mail: (mapconcat 'identity c \n) \n\\end{flushleft})) #+end_src #+name: author-table | Author name | Department | Institution | City | State | Country | | Email | Corresponding | |---++---+--+---+-+---+---| | Thomas S. Dye | Department of Anthropology | University of Hawai`i | | Honolulu | HI | USA | t...@tsdye.com | yes | All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Process hlines in imported tables
On Fri, Mar 29, 2013 at 06:01:21PM -0600, Eric Schulte wrote: Yes and no. :colnames works, but often the header comes from the processing, so they may not be static (I use a lot of call:s). Also, I've been having trouble using the output from raw results as input -- it seems that unless the results are cached (:cache yes), the table is not parsed on input, but passed as a multiline string. I was hoping to avoid this problem using value returns (now that Achim has made the perl parsing work better). Here's an example (btw, this breaks in 7.4 as well): Alright, I've just pushed up changes so that org and wrap results will expand tables (not just raw). With this change in place you can now use :results wrap to get the results you want, and since they are delimited, you can then re-use these results in later code blocks. Better for the elisp. But perl table processing is now totally wacky: *Note* =wrap= and =raw= give same results #+begin_src perl :results raw q[|c1|c2| |- |a|1| |b|2|]; #+end_src #+results: | | c1 | c2 | | | - || | | a | 1 | | | b | 2 | #+begin_src perl :results raw q[c1|c2 - a|1 b|2]; #+end_src #+results: | c1 | c2 | | - || | a | 1 | | b | 2 | #+begin_src perl :results raw output print q[|c1|c2| |- |a|1| |b|2| ]; #+end_src #+results: | c1 | c2 | |+| | a | 1 | | b | 2 |
Re: [O] [PATCH] Process hlines in imported tables
Rick Frankel r...@rickster.com writes: On Fri, Mar 29, 2013 at 06:01:21PM -0600, Eric Schulte wrote: Yes and no. :colnames works, but often the header comes from the processing, so they may not be static (I use a lot of call:s). Also, I've been having trouble using the output from raw results as input -- it seems that unless the results are cached (:cache yes), the table is not parsed on input, but passed as a multiline string. I was hoping to avoid this problem using value returns (now that Achim has made the perl parsing work better). Here's an example (btw, this breaks in 7.4 as well): Alright, I've just pushed up changes so that org and wrap results will expand tables (not just raw). With this change in place you can now use :results wrap to get the results you want, and since they are delimited, you can then re-use these results in later code blocks. Better for the elisp. But perl table processing is now totally wacky: *Note* =wrap= and =raw= give same results #+begin_src perl :results raw q[|c1|c2| |- |a|1| |b|2|]; #+end_src #+results: | | c1 | c2 | | | - || | | a | 1 | | | b | 2 | This is a problem in the results returned by ob-perl, not in the results insertion mechanism. Given what is actually being returned by that code block the results make sense. #+name: perl-example #+begin_src perl :results raw q[|c1|c2| |- |a|1| |b|2|]; #+end_src #+begin_src emacs-lisp :var data=perl-example :results verbatim (format %S data) #+end_src #+RESULTS: : ((\\ \c1\ \c2\) (\\ \-\ \\) (\\ \a\ 1) (\\ \b\ 2)) If we add verbatim (which inhibits interpretation as a value, which can often result in a list or table result), then we get what I assume you expect. #+name: perl-example #+begin_src perl :results verbatim raw q[|c1|c2| |- |a|1| |b|2|]; #+end_src #+RESULTS: perl-example | c1 | c2 | |+| | a | 1 | | b | 2 | #+begin_src perl :results raw q[c1|c2 - a|1 b|2]; #+end_src #+results: | c1 | c2 | | - || | a | 1 | | b | 2 | This output above makes sense. Maybe try the following (with verbatim) instead. #+begin_src perl :results verbatim drawer q[|c1|c2 |- |a|1 |b|2]; #+end_src #+results: :RESULTS: | c1 | c2 | |+| | a | 1 | | b | 2 | :END: #+begin_src perl :results raw output print q[|c1|c2| |- |a|1| |b|2| ]; #+end_src #+results: | c1 | c2 | |+| | a | 1 | | b | 2 | This one looks good to me as is. I added a note about verbatim to [1], if you can think anything else from this discussion that could be of general interest please place it there as well. Thanks, Footnotes: [1] http://orgmode.org/worg/org-contrib/babel/header-args.html -- Eric Schulte http://cs.unm.edu/~eschulte
Re: [O] org-babel header documentation
Charles Berry ccbe...@ucsd.edu writes: Eric Schulte schulte.eric at gmail.com writes: Eric Abrahamsen eric at ericabrahamsen.net writes: [snip] Great! I just saw mention of the wrap header argument in another thread but that doesn't appear on this page, could we trouble you to add it? It would be *great* to have one canonical spot listing all the possibilities... I think this page is more for ancillary notes and tricks, the canonical spot is the manual, and it does mention the wrap header argument (apparently the preferred name is drawer). See the following. http://orgmode.org/manual/results.html Preferred so as not to confuse 'wrap' with ':wrap', I guess. This is the link for the :wrap header argument. http://orgmode.org/manual/wrap.html Aha, I see. wrap/drawer thing was confusing. I guess I just need to experiment more. Thanks! E