Re: [O] Org-element once again
Marcin Borkowski writes: > Hi list, > > does there exist any place I could find the specs of the org-element > data structure? From what I can see, it is a list whose car is the type > of the element, then a (somewhat mysterious or me) plist follows, and > then the children. Where could I find more info? If the answer is > "read the source, Luke" ;-) , which functions should I start with? > > Best, Have you looked at this page? http://orgmode.org/worg/dev/org-element-api.html That and the pages linked from it seem to cover most of what's going on. The mysterious plist holds all the properties for a given element. Most are generated by the parsing process (eg :contents-begin and :contents-end, see the link above for all the different properties the various elements/objects might get), while headlines will also have their actual property-drawer properties put into the list. The only thing that remains a little opaque to me is the "section" element, which apparently gets wrapped around a heading's subtree. I don't know what it does, but it's never gotten in my way so I haven't worried about it. Hope that helps, Eric
Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 /usr/local/share/emacs/site-lisp/org/)]
Ista Zahn gmail.com> writes: > > > > On Oct 7, 2014 3:41 PM, "Henrik Singmann" psychologie.uni-freiburg.de> wrote: > > > > Dear all, > > > > Sorry to resurrect this thread but I still have the issue discussed > > here. I get "Error: could not find function ".ess.eval"" when inside an > > R code block with :session *R* but not without :session *R*. > > [snip] > > > > Can anybody reproduce or solve? > Yes, I can reproduce with emacs 24.3.1, org 8..2.3, and ess 14.09 on org 8.2.3 ?? The last 8.2.3 release I see on git is 2013-11-15 05:58:32 (GMT) The ess 14 patch showed up on 2014-09-18 01:10:40 (GMT). > Archlinux, but only if I don't start the R session first. If I do 'M-x > R' to manually start an R process it works fine, but if there is no R > process already running I get 'Error: could not find function > ".ess.eval"' Yes. (R) starts the session asynchronously, so in programmatic use subsequent commands can jump the queue and confuse the process. This did not seem to matter before ess 14. The 2014-09-18 01:10:40 (GMT) patch forces a wait for (R) to finish before anymore commands are sent to the session. So either update org-mode or downdate ess or replace org-babel-R-initiate-session with the current version and recompile. HTH, Chuck
Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 /usr/local/share/emacs/site-lisp/org/)]
Henrik Singmann psychologie.uni-freiburg.de> writes: > > Dear all, > > Sorry to resurrect this thread but I still have the issue discussed here. I get "Error: could not find > function ".ess.eval"" when inside an R code block with :session *R* but > not without :session *R*. > Please confirm that when you do M-x find-function RET org-babel-R-initiate-session RET and scroll down 15 lines: M-1 M-5 you see something like this: (ess-wait-for-process (get-process (or ess-local-process-name ess-current-process-name))) If not, there is something broken in your setup. If you do see that code, please do C-x d and verify that ob-R.el is older than ob-R.elc. If it is not older delete ob-R.elc and restart. Let us know how it goes either way. Chuck
Re: [O] export to odt: error in style.xml
Hi Achim, Thanks for your helpful message. Achim Gratz writes: > Rasmus writes: >> In the future you should sent minimal examples. In this case it did >> not matter and the mentioned commit was indeed to blame. It should be >> fixed in master @ 004332b. > > Could you please rebase or cherry-pick your changes onto the > then-current master before committing them? Yes, I am very happy to! However, can you please elaborate on what exactly I did wrong? I have checked for the following to understand your criticism: 1. When I do $ git diff 004332b^ 00433b I get a one line diff (except the context). There are no change of white space or other garbage. Why is this not cherry-picked? 2. I know I git pull --rebase'ed before I submitted. I believe the patch was only submitted to master, since it shows up on git log when I'm on the master branch but not on the maint branch. This is true for my local checkout and for cgit online. Why is this not against the current master? 3. There is no nasty "Merge branch..." so, again, why is it not cherry picked? I'm not claiming to be an expert of anything, least of all of anything–software, so please be explicit so I can learn to commit better. > Also, you might want to decide on a single mail address for these > committs. In principal it is true. However, is it a real issue¹ in practice? Rest assured it is always a real email address checked frequently. It happens because I use several computers and I sometimes forget to correct .git/config. If it *is* a real issue, I could change my global git config, though it is configured the way it is for a reason. Thanks, Rasmus Footnotes: ¹ It pains me every time I use my private email for public mailing list, but I doubt you had my privacy in mind? -- This is the kind of tedious nonsense up with which I will not put
[O] Org-element once again
Hi list, does there exist any place I could find the specs of the org-element data structure? From what I can see, it is a list whose car is the type of the element, then a (somewhat mysterious or me) plist follows, and then the children. Where could I find more info? If the answer is "read the source, Luke" ;-) , which functions should I start with? Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University
Re: [O] key-binding for all plotting styles
Le 07/10/2014 16:15, Nicolas Goaziou a écrit : > Hello, > > Thierry Banel writes: > >> C-c "(currently unused) >> C-c |(currently does weird things within a table) > I'm fine with any of these, even though they may be shadowed by minor > modes. Good! I will submit a patch shortly. Have fun Thierry
Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 /usr/local/share/emacs/site-lisp/org/)]
On Oct 7, 2014 3:41 PM, "Henrik Singmann" < henrik.singm...@psychologie.uni-freiburg.de> wrote: > > Dear all, > > Sorry to resurrect this thread but I still have the issue discussed here. I get "Error: could not find function ".ess.eval"" when inside an R code block with :session *R* but not without :session *R*. > > More specifically, in the following .org file the first code block works but not the second one: > > --8<---cut here---start->8--- > #+begin_src R > date() > #+end_src > > #+RESULTS: > : Tue Oct 07 19:31:21 2014 > > #+begin_src R :session *R* > date() > #+end_src > > #+RESULTS: > > --8<---cut here---end--->8--- > > Note that I use the latest Emacs on Windows (24.3.1, i386-mingw-nt6.1.7601) with the latest Org-mode (version 8.3beta, release_8.3beta-427-g942eb6) and the current development version of ESS (the same happens for ESS 14.09). Interestingly and as reported, it does not happen when downgrading to ESS 13.09 (but as this was handled as an org-mode problem so far I decided to keep it on this list). > > Furthermore, my .emacs file currently only consists of the following: > > --8<---cut here---start->8--- > > (require 'org) > (require 'ess-site) > > (custom-set-variables > ;; custom-set-variables was added by Custom. > ;; If you edit it by hand, you could mess it up, so be careful. > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won't work right. > '(inhibit-startup-screen t) > ) > (custom-set-faces > ;; custom-set-faces was added by Custom. > ;; If you edit it by hand, you could mess it up, so be careful. > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won't work right. > ) >(org-babel-do-load-languages > 'org-babel-load-languages > '((emacs-lisp . nil) > (R . t))) > > (setq org-babel-R-command "C:/Progra~1/R/R-3.1.1/bin/x64/rterm.exe --slave --no-save") > > --8<---cut here---end--->8--- > > The windows is Windows 7, 64 bit. > > Can anybody reproduce or solve? Yes, I can reproduce with emacs 24.3.1, org 8..2.3, and ess 14.09 on Archlinux, but only if I don't start the R session first. If I do 'M-x R' to manually start an R process it works fine, but if there is no R process already running I get 'Error: could not find function ".ess.eval"' Best, Ista > > Henrik > > > Am 19.09.2014 um 00:45 schrieb Charles C. Berry: > >> On Thu, 18 Sep 2014, Charles C. Berry wrote: >> >>> On Thu, 18 Sep 2014, Cook, Malcolm wrote: >>> Hi, Hmm, I spoke too soon the problem is only partially fixed by this patch... >>> Trying to work with in org-mode with R code blocks attached to persistent sessions (i.e. adding ':session myRsession' to the code block header ) makes things start to break again, at least in my hands. >>> >>> >>> Really? I have been working for hours using the :session header with no problems. >>> >>> What exactly breaks? Do you have an example? >>> >>> FWIW, this works when I move my cursor into the source block and C-c C-c. >>> >>> --8<---cut here---start->8--- >>> #+BEGIN_SRC R :session myRsession >>> abc <- 1 >>> abc+1 >>> #+END_SRC >>> --8<---cut here---end--->8--- >>> >>> Producing >>> >>> --8<---cut here---start->8--- >>> #+RESULTS: >>> : 2 >>> --8<---cut here---end--->8--- >>> >>> which is what I expect. >>> >>> I use Org-mode version 8.3beta (release_8.3beta-366-gb2fca7. >>> >>> (updated a few hours back) >> >> >> >> Forget to mention: >> >> ess-version: 14.09 [git: 9c248f1a026b6990d0cd0cd326d82854d5cafb26] >> >> >> Chuck >> >> > > -- > Dr. Henrik Singmann > Albert-Ludwigs-Universität Freiburg, Germany > http://www.psychologie.uni-freiburg.de/Members/singmann > >
Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change
On Mon, 6 Oct 2014, Rainer M Krug wrote: Hi The variable transfer of tables from org to R caused sometimes 'could not find function "read.table"' errors (e.g. when the file was tangled into a ./data directory which was loaded by the function devtools::load_all("./")). This can easily be fixed by adding the package name to the call in R, i.e. replacing =read.table()= with =utils::read.table()= which is done in this patch. It does fix that one case. But I wonder if that is the best way. The heart of the matter is that load_all eventually calls sys.source, which can be persnickety about finding objects on the search path. See ?sys.source. If the src block you tangle to ./data/ has any code that uses any other objects from utils, stats, datasets or whatever, you will be in the same pickle. Arguably, this is a bug in devtools::load_data. And maybe it would be better to beg the maintainer for a fix or an extension that accomodates your case. In R the calls read.table and utils::read.table are interchangeable (the second one is actually preferred) so no negative effects can be expected. What if the user has intentionally masked read.table or the eventual package provides its own read.table? HTH, Chuck
Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 /usr/local/share/emacs/site-lisp/org/)]
Dear all, Sorry to resurrect this thread but I still have the issue discussed here. I get "Error: could not find function ".ess.eval"" when inside an R code block with :session *R* but not without :session *R*. More specifically, in the following .org file the first code block works but not the second one: --8<---cut here---start->8--- #+begin_src R date() #+end_src #+RESULTS: : Tue Oct 07 19:31:21 2014 #+begin_src R :session *R* date() #+end_src #+RESULTS: --8<---cut here---end--->8--- Note that I use the latest Emacs on Windows (24.3.1, i386-mingw-nt6.1.7601) with the latest Org-mode (version 8.3beta, release_8.3beta-427-g942eb6) and the current development version of ESS (the same happens for ESS 14.09). Interestingly and as reported, it does not happen when downgrading to ESS 13.09 (but as this was handled as an org-mode problem so far I decided to keep it on this list). Furthermore, my .emacs file currently only consists of the following: --8<---cut here---start->8--- (require 'org) (require 'ess-site) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(inhibit-startup-screen t) ) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . nil) (R . t))) (setq org-babel-R-command "C:/Progra~1/R/R-3.1.1/bin/x64/rterm.exe --slave --no-save") --8<---cut here---end--->8--- The windows is Windows 7, 64 bit. Can anybody reproduce or solve? Henrik Am 19.09.2014 um 00:45 schrieb Charles C. Berry: On Thu, 18 Sep 2014, Charles C. Berry wrote: On Thu, 18 Sep 2014, Cook, Malcolm wrote: Hi, Hmm, I spoke too soon the problem is only partially fixed by this patch... Trying to work with in org-mode with R code blocks attached to persistent sessions (i.e. adding ':session myRsession' to the code block header ) makes things start to break again, at least in my hands. Really? I have been working for hours using the :session header with no problems. What exactly breaks? Do you have an example? FWIW, this works when I move my cursor into the source block and C-c C-c. --8<---cut here---start->8--- #+BEGIN_SRC R :session myRsession abc <- 1 abc+1 #+END_SRC --8<---cut here---end--->8--- Producing --8<---cut here---start->8--- #+RESULTS: : 2 --8<---cut here---end--->8--- which is what I expect. I use Org-mode version 8.3beta (release_8.3beta-366-gb2fca7. (updated a few hours back) Forget to mention: ess-version: 14.09 [git: 9c248f1a026b6990d0cd0cd326d82854d5cafb26] Chuck -- Dr. Henrik Singmann Albert-Ludwigs-Universität Freiburg, Germany http://www.psychologie.uni-freiburg.de/Members/singmann
Re: [O] export to odt: error in style.xml
Rasmus writes: > In the future you should sent minimal examples. In this case it did > not matter and the mentioned commit was indeed to blame. It should be > fixed in master @ 004332b. Could you please rebase or cherry-pick your changes onto the then-current master before committing them? Also, you might want to decide on a single mail address for these committs. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds
Re: [O] Babel: reusing language-specific functions
Thorsten Jolitz writes: > Jarmo Hurri writes: > >> Greetings. >> >> I have a very basic Babel question, but I can not extract the solution >> from the manual. >> >> I have a language-specific function - in this case Asymptote, but it >> could be e.g. C as well - that I want to use in a number of different >> source blocks of the same language in an Org file. How do I accomplish >> this? >> >> Currently my solution is to write the function into an external source >> file, and include the file in the source blocks. But that looks ugly, >> and is sort of against the Org-mode way of doing things: all code in the >> same place for completeness and convenience. >> >> How can I achieve what I want? > > try something like this: > > #+NAME: foo > #+BEGIN_SRC emacs-lisp > (defun foo (x) (+ x 2)) > #+END_SRC > > #+results: foo > : foo > #+BEGIN_SRC emacs-lisp :var fun=foo > (funcall (intern fun) 3) > #+END_SRC > > #+results: > : 5 Or, perhaps use the noweb syntax. #+NAME: foo #+BEGIN_SRC emacs-lisp (defun foo (x) (+ x 2)) #+END_SRC #+results: foo : foo #+begin_src emacs-lisp :noweb yes <> (foo 3) #+end_src #+results: : 5 hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Export to Latex, multi-line headlines
hy...@lactose.homelinux.net (hymie!) writes: > In our last episode, the evil Dr. Lacto had captured our hero, > Thorsten Jolitz , who said: >>hy...@lactose.homelinux.net (hymie!) writes: >> > >>> *** This is a very long line which is way too long to fit on a single line >>> so I have it broken up into smaller lines so that I can read it >>> but still have the indentation lined up, so it's obvious (to me) that >>> this is all designed to be a single sentence. >> >>This looks pretty 'unidiomatic', so to say, better use > > In other words, "Don't do that." :) Keep my headings short. I agree with Thorsen. The Org syntax specify that headlines are one line. See org-heading-regexp. That being said, I think you can mimic your desired behavior with the following: (progn (org-mode) (org-indent-mode t) (visual-line-mode t)) —Rasmus -- . . . It begins of course with The Internet. A Net of Peers
Re: [O] Export to Latex, multi-line headlines
In our last episode, the evil Dr. Lacto had captured our hero, Thorsten Jolitz , who said: >hy...@lactose.homelinux.net (hymie!) writes: > >> *** This is a very long line which is way too long to fit on a single line >> so I have it broken up into smaller lines so that I can read it >> but still have the indentation lined up, so it's obvious (to me) that >> this is all designed to be a single sentence. > >This looks pretty 'unidiomatic', so to say, better use In other words, "Don't do that." :) Keep my headings short. Fair enough. --hymie!http://lactose.homelinux.net/~hymiehy...@lactose.homelinux.net
Re: [O] [PATCH] org-capture-place-item better alignment for new lists.
* Nicolas Goaziou [2014-10-07 15:49:09 +0200]: > > Thanks for the patch. > > However, this behaviour is wrong when `org-adapt-indentation' is nil. > > It is better to use `org-indent-line' than hard-coding > > (1+ (org-current-level)). > Thanks for taking a look at the patch, and thanks for the feedback. I did suspect I'd have missed something. I've revised the patch (below) so that I now use org-indent-line to establish the best indentation if we're starting a new list, this has resulted in slightly more churn, but hopefully not too much. Thanks, Andrew --- Creating an entry in org-capture-templates of type item adds entries into a list, however, currently, if the list is empty then the first list item will always be indented to depth 0 (so hard on the left), which looks like this: * Top Level ** Second Level - item #1 - item #2 - item #3 This is fine if org-adapt-indentation is nil, however, with the default value of t lists should be indented more like this: * Top Level ** Second Level - item #1 - item #2 - item #3 The patch below changes org-capture-place-item so that, when starting a new list, the items are indented as above. Care is taken to preserve two features of the existing behaviour, first, when adding to an existing list, new items are indented to match the items already in the list. And secondly, when there is some introductory text before the list new items are inserted after the text, like this: * Top Level ** Second Level This is some introductory text: - item #1 - item #2 - item #3 lisp/org-capture.el (org-capture-place-item): When starting a new list use org-indent-line to establish the correct indentation rather than just using 0. --- lisp/org-capture.el | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 9e33d25..094ff55 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1075,21 +1075,19 @@ may have been stored before." (t (setq beg (1+ (point-at-eol)) end (save-excursion (outline-next-heading) (point) + (setq ind nil) (if (org-capture-get :prepend) (progn (goto-char beg) - (if (org-list-search-forward (org-item-beginning-re) end t) - (progn - (goto-char (match-beginning 0)) - (setq ind (org-get-indentation))) - (goto-char end) - (setq ind 0))) + (when (org-list-search-forward (org-item-beginning-re) end t) + (goto-char (match-beginning 0)) + (setq ind (org-get-indentation (goto-char end) - (if (org-list-search-backward (org-item-beginning-re) beg t) - (progn - (setq ind (org-get-indentation)) - (org-end-of-item)) - (setq ind 0 + (when (org-list-search-backward (org-item-beginning-re) beg t) + (setq ind (org-get-indentation)) + (org-end-of-item))) + (unless ind + (goto-char end))) ;; Remove common indentation (setq txt (org-remove-indentation txt)) ;; Make sure this is indeed an item @@ -1097,17 +1095,24 @@ may have been stored before." (setq txt (concat "- " (mapconcat 'identity (split-string txt "\n") "\n " +;; Prepare surrounding empty lines +(org-capture-empty-lines-before) +(setq beg (point)) +(unless (eolp) + (insert "\n") + (previous-line)) +(unless ind + (org-indent-line) + (setq ind (org-get-indentation)) + (delete-region beg (point))) ;; Set the correct indentation, depending on context (setq ind (make-string ind ?\ )) (setq txt (concat ind (mapconcat 'identity (split-string txt "\n") (concat "\n" ind)) "\n")) -;; Insert, with surrounding empty lines -(org-capture-empty-lines-before) -(setq beg (point)) +;; Insert (insert txt) -(or (bolp) (insert "\n")) (org-capture-empty-lines-after 1) (org-capture-position-for-last-stored beg) (forward-char 1) -- 1.9.3
Re: [O] Export to Latex, multi-line headlines
hy...@lactose.homelinux.net (hymie!) writes: > *** This is a very long line which is way too long to fit on a single line > so I have it broken up into smaller lines so that I can read it > but still have the indentation lined up, so it's obvious (to me) that > this is all designed to be a single sentence. This looks pretty 'unidiomatic', so to say, better use , | *** Lorem Ipsum | | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec | hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, | tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque | penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla | posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras | placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl. ` instead. -- cheers, Thorsten
[O] Export to Latex, multi-line headlines
So the more I use orgmode, the more I'm enjoying it. I'm now learning how to export my notes into LaTeX and/or PDF. (I'm a TeX user, so I don't know all of the intricacies of LaTeX, but I can manage if I have to.) Anyway, to the question. When I have a long line in my notes, I keep it formatted like this for easy reading: *** This is a very long line which is way too long to fit on a single line so I have it broken up into smaller lines so that I can read it but still have the indentation lined up, so it's obvious (to me) that this is all designed to be a single sentence. There is a "hard return" at the end of each line, because using emacs's standard word-wrapping would put the text into a left-aligned paragraph and I lose my outline structure. The coloring of the second through fourth lines doesn't match the coloring of the first line, so it appears that Org considers this to be a single-line headline with some supporting text underneath it. When I export to LaTeX, that concept continues. The phrase "This is a very long line which is way too long to fit on a single line" is my headline, in big bold letters, while the rest of the text is below it in smaller letters (formatted as a single paragraph). Is there a way that I can specify, either to Orgmode in general or to the LaTeX exporter specifically, that I want this to be considered a single headline? Alternative question -- is there a way that Orgmode (or emacs) can combine line-wrapping with indent levels, so that if I were to write this all as a single line, the word-wrapping would put the text in the correct column? --hymie!http://lactose.homelinux.net/~hymiehy...@lactose.homelinux.net ---
Re: [O] [PATCH] Kill in eww and keep the links for org
Hi! Nicolas Goaziou writes: > Since the file is in contrib and you're its author, you can obviously > push the code. Thanks for making that clear. > Some minor comments follow. > >> +;;; org-eww.el --- Store url and kill from eww-mode for Org > > Eww mode > >> +(equal (point) (org-eww-goto-next-url-property-change > > (eq (point) (org-eww-goto-next-url-property-change)) > >> + (not (eq nil (org-eww-url-below-point > > (org-eww-url-below-point) > > or, if you insist on returning t, > > (and (org-eww-url-below-point) t) I insist ;) Thanks for your hints. Applied and pushed. Best regards, Marco -- http://www.wahlzone.de PGP: 0x0A3AE6F2
Re: [O] key-binding for all plotting styles
Hello, Thierry Banel writes: > C-c "(currently unused) > C-c |(currently does weird things within a table) I'm fine with any of these, even though they may be shadowed by minor modes. Regards, -- Nicolas Goaziou
Re: [O] [ox, patch] Quickly INCLUDE from own file
Hello, Rasmus writes: > The attached patch allows for "quick" (== without filename) inclusion > from the same file. Why? 'Cause I'm lazy and it would be useful to > push boring, location-specific stuff to the end of the file. > > Here's an example: > > * poor man's ~:ignoreheading:~ > #+INCLUDE: "::*foo" :only-contents t > > #+INCLUDE: "::tbl" > > * foo :noexport: > 1 > > * bar :noexport: > #+NAME: tbl > | 1 | > > You need the preceding "::" to be able tell the difference between the > file "tbl" and the table "tbl". Granted, this doesn't look like an > org link. If that's an issue, for each link sans location it could be > tested if it exists in the current buffer. > > Do you think something like this would be desirable? Including in the same file is dangerous: you can easily duplicate custom-id, name keywords, which are supposed to be unique. Even though we don't prevent it[fn:1], I don't think we should make it easier to achieve. Introducing a new special syntax in this case doesn't sound like a good move either. Regards, [fn:1] Actually, we should have a guard against circular inclusion, but at the moment, it is ineffective in this case. -- Nicolas Goaziou
Re: [O] [PATCH] org-capture-place-item better alignment for new lists.
Hello, Andrew Burgess writes: > Creating an entry in org-capture-templates of type item adds entries > into a list, however, if the list is empty then the first list item > will be indented to depth 0 (so hard on the left) like this: > > * Top Level > ** Second Level > - item #1 > - item #2 > - item #3 > > I prefer to indent content, including lists, to a level matching the > parent, so something like this: > > * Top Level > ** Second Level >- item #1 >- item #2 >- item #3 > > The patch below changes org-capture-place-item so that, when starting > a new list, the items are indented as in the second example above. Thanks for the patch. However, this behaviour is wrong when `org-adapt-indentation' is nil. It is better to use `org-indent-line' than hard-coding (1+ (org-current-level)). Regards, -- Nicolas Goaziou
Re: [O] export to odt: error in style.xml
Hi Detlef, Detlef Steuer writes: > I cannot send the file to the list, but maybe you > can take a look off list? In the future you should sent minimal examples. In this case it did not matter and the mentioned commit was indeed to blame. It should be fixed in master @ 004332b. Thanks for reporting this. —Rasmus PS: The output of the file you sent me will likely not look like you expect (e.g. missing the table), but that is because of syntax mistakes. -- Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio
Re: [O] Babel: reusing language-specific functions
Jarmo Hurri writes: > Greetings. > > I have a very basic Babel question, but I can not extract the solution > from the manual. > > I have a language-specific function - in this case Asymptote, but it > could be e.g. C as well - that I want to use in a number of different > source blocks of the same language in an Org file. How do I accomplish > this? > > Currently my solution is to write the function into an external source > file, and include the file in the source blocks. But that looks ugly, > and is sort of against the Org-mode way of doing things: all code in the > same place for completeness and convenience. > > How can I achieve what I want? try something like this: #+NAME: foo #+BEGIN_SRC emacs-lisp (defun foo (x) (+ x 2)) #+END_SRC #+results: foo : foo #+BEGIN_SRC emacs-lisp :var fun=foo (funcall (intern fun) 3) #+END_SRC #+results: : 5 -- cheers, Thorsten
Re: [O] export to odt: error in style.xml
Hi Detlef, Detlef Steuer writes: > Trying to open an exported ODT document I see the erroe message: > format error in styles.xml in position (790,2) I changed the style used by odt in commit 464cd96. The part you refer to is defined in `org-odt-template', but I don't see how it relates to that commit instantly though the regexp part shortly after the comment you point out, might not work. . . Please (always) provide a short example demonstrating your problem. Thanks, Rasmus -- You people at the NSA are becoming my new best friends!
[O] Babel: reusing language-specific functions
Greetings. I have a very basic Babel question, but I can not extract the solution from the manual. I have a language-specific function - in this case Asymptote, but it could be e.g. C as well - that I want to use in a number of different source blocks of the same language in an Org file. How do I accomplish this? Currently my solution is to write the function into an external source file, and include the file in the source blocks. But that looks ugly, and is sort of against the Org-mode way of doing things: all code in the same place for completeness and convenience. How can I achieve what I want? All the best, Jarmo
[O] export to odt: error in style.xml
Hi! Trying to open an exported ODT document I see the erroe message: format error in styles.xml in position (790,2) This is found the following part of styles.xml: snip a lot of stuff from styles.xml ^ This line above is line 790 snip more stuff . Any ideas? GNU Emacs 24.3.1, org from git Org-mode version 8.3beta (release_8.3beta-422-gb54ad3 Export to latex/pdf works as expected. Thx in advance Detlef
[O] [PATCH] org-capture-place-item better alignment for new lists.
Creating an entry in org-capture-templates of type item adds entries into a list, however, if the list is empty then the first list item will be indented to depth 0 (so hard on the left) like this: * Top Level ** Second Level - item #1 - item #2 - item #3 I prefer to indent content, including lists, to a level matching the parent, so something like this: * Top Level ** Second Level - item #1 - item #2 - item #3 The patch below changes org-capture-place-item so that, when starting a new list, the items are indented as in the second example above. The existing behaviour is maintained when adding additional items to a list, that is the indentation of new items will match the indentation on items already in the list. All feedback welcome, Thanks, Andrew lisp/org-capture.el (org-capture-place-item): When starting a new list use (1+ org-current-level) rather than just 0 for the indentation. This ensures new lists are indented under their parent element. --- lisp/org-capture.el | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 9e33d25..150ba1e 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1064,7 +1064,7 @@ may have been stored before." "Place the template as a new plain list item." (let* ((txt (org-capture-get :template)) (target-entry-p (org-capture-get :target-entry-p)) -(ind 0) +(ind (1+ (org-current-level))) beg end) (if (org-capture-get :exact-position) (goto-char (org-capture-get :exact-position)) @@ -1078,18 +1078,13 @@ may have been stored before." (if (org-capture-get :prepend) (progn (goto-char beg) - (if (org-list-search-forward (org-item-beginning-re) end t) - (progn - (goto-char (match-beginning 0)) - (setq ind (org-get-indentation))) - (goto-char end) - (setq ind 0))) + (when (org-list-search-forward (org-item-beginning-re) end t) + (goto-char (match-beginning 0)) + (setq ind (org-get-indentation (goto-char end) - (if (org-list-search-backward (org-item-beginning-re) beg t) - (progn - (setq ind (org-get-indentation)) - (org-end-of-item)) - (setq ind 0 + (when (org-list-search-backward (org-item-beginning-re) beg t) + (setq ind (org-get-indentation)) + (org-end-of-item ;; Remove common indentation (setq txt (org-remove-indentation txt)) ;; Make sure this is indeed an item -- 1.9.3
Re: [O] [PATCH] Kill in eww and keep the links for org
Hello, Marco Wahl writes: > to kill in a w3m-buffer and yank into an org-mode-buffer by keeping the > links is a long known feature in org-module org-w3m. The patch below > provides this functionality for eww. Note that the code is very similar > to the code for the w3m case. > > What do you think? Shall I try to push the code? Since the file is in contrib and you're its author, you can obviously push the code. Some minor comments follow. > +;;; org-eww.el --- Store url and kill from eww-mode for Org Eww mode > +(defun org-eww-no-next-link-p () > + "Whether there is no next link after the cursor. > +Return t if there is no next link; otherwise, return nil." > + (save-excursion > +(equal (point) (org-eww-goto-next-url-property-change (eq (point) (org-eww-goto-next-url-property-change)) > +(defun org-eww-url-below-point-p () > + "Return t if below point there is a url; otherwise, return nil." > + (not (eq nil (org-eww-url-below-point (org-eww-url-below-point) or, if you insist on returning t, (and (org-eww-url-below-point) t) Regards, -- Nicolas Goaziou
Re: [O] agenda time grid -- default time slot lines
Hello, Mike McLean writes: > Attached is a patch that updates the Docstring of org-agenda-time-grid to > match the actual options. Applied. Thank you. I added TINYCHANGE at the end of your commit message. Regards, -- Nicolas Goaziou
[O] [PATCH] Kill in eww and keep the links for org
Hi, to kill in a w3m-buffer and yank into an org-mode-buffer by keeping the links is a long known feature in org-module org-w3m. The patch below provides this functionality for eww. Note that the code is very similar to the code for the w3m case. What do you think? Shall I try to push the code? Ciao, Marco >From 5f03c47861a828b7a75d890e05121c028a003296 Mon Sep 17 00:00:00 2001 From: Marco Wahl Date: Thu, 2 Oct 2014 23:09:11 +0200 Subject: [PATCH] org-eww.el: Special kill in eww for Org for keeping the links * contrib/lisp/org-eww.el(org-eww-copy-for-org-mode): Realization of the kill. (org-eww-goto-next-url-property-change, org-eww-no-next-link-p, org-eww-url-below-point, org-eww-url-below-point-p): Auxiliaries for accessing a eww buffer The code has emerged from the very similar org-w3m.el. --- contrib/lisp/org-eww.el | 107 +--- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/contrib/lisp/org-eww.el b/contrib/lisp/org-eww.el index c25057d..3aae37a 100644 --- a/contrib/lisp/org-eww.el +++ b/contrib/lisp/org-eww.el @@ -1,4 +1,4 @@ -;;; org-eww.el --- Storing link in eww-mode for Org-mode +;;; org-eww.el --- Store url and kill from eww-mode for Org ;; Copyright (C) 2014 Free Software Foundation, Inc. @@ -27,17 +27,25 @@ ;; When this module is active `org-store-link' (often on key C-c l) in ;; a eww buffer stores a link to the current url of the eww buffer. -;; `org-eww-store-link' below is almost the same as -;; `org-w3m-store-link' of the org-w3m module. +;; In an eww buffer function `org-eww-copy-for-org-mode' kills either +;; a region or the whole buffer if no region is set and transforms the +;; text on the fly so that it can be pasted into an org-mode buffer +;; with hot links. -;; Hint: There are further features in module org-w3m which might be -;; interesting for org-eww also. +;; C-c C-x C-w and C-c C-x M-w trigger `org-eww-copy-for-org-mode'. + +;; Hint: A lot of code of this module comes from module org-w3m which +;; has been written by Andy Steward. Thanks! + +;; Potential: Since the code for w3m and eww is so similar one could +;; try to refactor. ;;; Code: - (require 'org) + +;; Store Org-link in eww-mode buffer (add-hook 'org-store-link-functions 'org-eww-store-link) (defun org-eww-store-link () "Store a link to the url of a eww buffer." @@ -49,6 +57,93 @@ :description (or eww-current-title eww-current-url +;; Some auxiliary functions concerning links in eww buffers +(defun org-eww-goto-next-url-property-change () + "Move cursor to the start of next link if exists. Else no +move. Return point." + (goto-char + (or (next-single-property-change (point) 'shr-url) + (point + +(defun org-eww-no-next-link-p () + "Whether there is no next link after the cursor. +Return t if there is no next link; otherwise, return nil." + (save-excursion +(equal (point) (org-eww-goto-next-url-property-change + +(defun org-eww-url-below-point-p () + "Return t if below point there is a url; otherwise, return nil." + (not (eq nil (org-eww-url-below-point + +(defun org-eww-url-below-point () + "Return the url below point if there is an url; otherwise, return nil." + (get-text-property (point) 'shr-url)) + + +(defun org-eww-copy-for-org-mode () + "Copy current buffer content or active region with `org-mode' style links. +This will encode `link-title' and `link-location' with +`org-make-link-string', and insert the transformed test into the kill ring, +so that it can be yanked into an Org-mode buffer with links working correctly." + (interactive) + (let* ((regionp (org-region-active-p)) + (transform-start (point-min)) + (transform-end (point-max)) + return-content + link-location link-title + temp-position out-bound) +(when regionp + (setq transform-start (region-beginning)) + (setq transform-end (region-end)) + ;; Deactivate mark if current mark is activate. + (if (fboundp 'deactivate-mark) (deactivate-mark))) +(message "Transforming links...") +(save-excursion + (goto-char transform-start) + (while (and (not out-bound) ; still inside region to copy + (not (org-eww-no-next-link-p))) ; there is a next link +;; store current point before jump next anchor +(setq temp-position (point)) +;; move to next anchor when current point is not at anchor +(or (org-eww-url-below-point-p) + (org-eww-goto-next-url-property-change)) + (assert (org-eww-url-below-point-p) t +"program logic error: point must have an url below but it hasn't") + (if (<= (point) transform-end) ; if point is inside transform bound + (progn + ;; get content between two links. + (if (> (point) temp-position) + (setq return-content (concat return-content + (buffer-substring + temp-position (point) +
[O] [ox, patch] Quickly INCLUDE from own file
Hi, The attached patch allows for "quick" (== without filename) inclusion from the same file. Why? 'Cause I'm lazy and it would be useful to push boring, location-specific stuff to the end of the file. Here's an example: * poor man's ~:ignoreheading:~ #+INCLUDE: "::*foo" :only-contents t #+INCLUDE: "::tbl" * foo :noexport: 1 * bar :noexport: #+NAME: tbl | 1 | You need the preceding "::" to be able tell the difference between the file "tbl" and the table "tbl". Granted, this doesn't look like an org link. If that's an issue, for each link sans location it could be tested if it exists in the current buffer. Do you think something like this would be desirable? —Rasmus -- Hvor meget poesi tror De kommer ud af et glas isvand? >From f8fcf5b6816fa7e3e4cc9cc64b12c5cced4a546c Mon Sep 17 00:00:00 2001 From: rasmus Date: Tue, 7 Oct 2014 11:20:10 +0200 Subject: [PATCH] ox: Quickly INCLUDE contents from same file. * ox.el (org-export-expand-include-keyword): Try buffer file name if filename is nil. --- lisp/ox.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index ec52203..ded3b2f 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3349,8 +3349,9 @@ paths." (setq matched (replace-match "" nil nil matched 1))) (expand-file-name - (org-remove-double-quotes - matched) + (or (org-string-nw-p + (org-remove-double-quotes matched)) + (buffer-file-name)) dir))) (setq value (replace-match "" nil nil value) (only-contents -- 2.1.2
Re: [O] Set org-todo-keywords as file-local variables
Andreas Leha writes: Hi Andreas, > Thorsten Jolitz writes: >> Hi List, >> >> I set 'org-todo-keywords' as file-local variables in a file, and 'C-h v >> org-todo-keywords' in that file's buffer suggests I was successfull: [...] >> but when doing C-c C-t in that buffer, 'org-todo' still offers me the >> usual selection menu based on the variable's global value. >> >> Am I missing something here? > > I have some files with locally set todo keywords. I use a different > interface through: > > --8<---cut here---start->8--- > #+TODO: TODO(t) WAITING(w!) | DONE(d!) CANCELED(c@/!) > --8<---cut here---end--->8--- > > Does that help? Yes, thanks, that works and is much better than directly setting file-local vars! -- cheers, Thorsten
Re: [O] Set org-todo-keywords as file-local variables
Hi Thorsten, Thorsten Jolitz writes: > Hi List, > > I set 'org-todo-keywords' as file-local variables in a file, and 'C-h v > org-todo-keywords' in that file's buffer suggests I was successfull: > > , > | org-todo-keywords is a variable defined in `org.el'. > | Its value is shown below. > | > | This variable's value is file-local. > | > | Documentation: [...] > | Value: > | ((sequence "|" "E(e)" "X(x)" "C(c)" "R(r)" "M(m)")) > | > | Original value was > | ((sequence "TODO" "DONE")) > | > | Local in buffer foo-test.org; global value is > | ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!/!)") > | (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE")) > | > | [back] > ` > > but when doing C-c C-t in that buffer, 'org-todo' still offers me the > usual selection menu based on the variable's global value. > > Am I missing something here? I have some files with locally set todo keywords. I use a different interface through: --8<---cut here---start->8--- #+TODO: TODO(t) WAITING(w!) | DONE(d!) CANCELED(c@/!) --8<---cut here---end--->8--- Does that help? Andreas
Re: [O] babel "language" for conf-mode?
t...@tsdye.com (Thomas S. Dye) writes: > Aloha Eric, > > My guess is that you'll need to define conf-unix as a language. It > might be easy since evaluation isn't needed. > > See, > http://orgmode.org/w/worg.git/blob/HEAD:/org-contrib/babel/ob-template.el Thanks! I looked through that, and it didn't quite seem to do what I wanted, but it was enough to lead me to `org-src-lang-modes', which I think is the right tree to bark up. I just added '("conf-unix" . conf-unix) to that option, and gave C-' a whirl on a source block, and it nearly worked! I think with a little futzing around it will turn out to be fairly simply. Thanks, Eric > All the best, > Tom > > Eric Abrahamsen writes: > >> I'm doing a blog post on various computer configuration stuff, including >> lengthy excerpts from configuration files. It would be kind of nice to >> export the HTML so that the :htmlize-source option also recognized these >> chunks, and highlighted them correctly. So instead of wrapping the >> excerpts in >> >> #+BEGIN_EXAMPLE >> >> I could wrap them in >> >> #+BEGIN_SOURCE conf-unix >> >> And get highlighting a la conf-unix-mode. >> >> It's not quite a babel "language", since evaluation wouldn't do >> anything, but is there a way to just get the highlighting? >> >> Thanks! >> Eric >> >> >>