Re: [O] Problem with noweb-ref property [9.0.5 (9.0.5-elpaplus @ /home/rainer/.emacs.d/elpa/org-plus-contrib-20170210/)]
Nicolas Goaziouwrites: > Rainer Hansen writes: > >> However, I have still problems. I have adapted the example, >> http://orgmode.org/manual/noweb_002dref.html#noweb_002dref, > > I fixed it. > Great. >> >> org-use-property-inheritance is '("noweb-ref") > > This is useless. "noweb-ref" is not a property, and header-args are > always inherited IIRC. > Thanks for the clarification. >> Here is the changed code from the Org mode manual: >> >> #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh >> <> >> #+END_SRC >> >> * the mount point of the fullest disk >> :PROPERTIES: >> :header-args: :noweb-ref: fullest-disk > > It should be > > :header-args: :noweb-ref fullest-disk > That was it. Now it is working fine. Thanks for your help.
Re: [O] Problem with noweb-ref property [9.0.5 (9.0.5-elpaplus @ /home/rainer/.emacs.d/elpa/org-plus-contrib-20170210/)]
Rainer Hansenwrites: > However, I have still problems. I have adapted the example, > http://orgmode.org/manual/noweb_002dref.html#noweb_002dref, I fixed it. > in the > Orgmode handbook to the changed Babel header properties. However, the > generated file contained only "#!/bin/sh". I have activated property > inheritance for "noweb-ref" and moving the cursor on the #+BEGIN_SRC sh > lines shows that they have ":noweb-ref: fullest-disk" as header > argument. > > org-use-property-inheritance is '("noweb-ref") This is useless. "noweb-ref" is not a property, and header-args are always inherited IIRC. > Here is the changed code from the Org mode manual: > > #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh > <> > #+END_SRC > > * the mount point of the fullest disk > :PROPERTIES: > :header-args: :noweb-ref: fullest-disk It should be :header-args: :noweb-ref fullest-disk Regards,
Re: [O] Problem with noweb-ref property [9.0.5 (9.0.5-elpaplus @ /home/rainer/.emacs.d/elpa/org-plus-contrib-20170210/)]
Hi Nicolas, Nicolas Goaziouwrites: > Hello, > > Rainer Hansen writes: > >> I have tried the following example of using noweb-ref: >> >> #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh >> <> >> #+END_SRC >> >> * the mount point of the fullest disk >> >> ** query all mounted disks >> >> #+HEADER: :noweb-ref fullest-disk >> #+BEGIN_SRC sh >> df \ >> #+END_SRC >> >> >> ** strip the header row >> :PROPERTIES: >> :noweb-ref: fullest-disk >> :END: >> >> #+BEGIN_SRC sh :noweb yes >> |sed '1d' \ >> #+END_SRC >> >> >> >> It was mentioned more than 5 years ago as creating problems: >> https://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00825.html >> >> Now I got the same problem as mentioned in the post of that time - the >> created file contains only >> >> #!/bin/sh df \ >> >> Missing is the second block. >> >> Any ideas why? > > See "Incompatible changes > Old Babel header properties are no longer > supported" in ORG-NEWS. > > Regards, thanks for the quick answer. However, I have still problems. I have adapted the example, http://orgmode.org/manual/noweb_002dref.html#noweb_002dref, in the Orgmode handbook to the changed Babel header properties. However, the generated file contained only "#!/bin/sh". I have activated property inheritance for "noweb-ref" and moving the cursor on the #+BEGIN_SRC sh lines shows that they have ":noweb-ref: fullest-disk" as header argument. org-use-property-inheritance is '("noweb-ref") Here is the changed code from the Org mode manual: --8<---cut here---start->8--- #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh <> #+END_SRC * the mount point of the fullest disk :PROPERTIES: :header-args: :noweb-ref: fullest-disk :END: ** query all mounted disks #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row #+BEGIN_SRC sh |sed '1d' \ #+END_SRC ** sort by the percent full #+BEGIN_SRC sh |awk '{print $5 " " $6}'|sort -n |tail -1 \ #+END_SRC ** extract the mount point #+BEGIN_SRC sh |awk '{print $2}' #+END_SRC --8<---cut here---end--->8--- Any ideas why it is still not working. Regards, Rainer
Re: [O] Problem with noweb-ref property [9.0.5 (9.0.5-elpaplus @ /home/rainer/.emacs.d/elpa/org-plus-contrib-20170210/)]
Hello, Rainer Hansenwrites: > I have tried the following example of using noweb-ref: > > #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh > <> > #+END_SRC > > * the mount point of the fullest disk > > ** query all mounted disks > > #+HEADER: :noweb-ref fullest-disk > #+BEGIN_SRC sh > df \ > #+END_SRC > > > ** strip the header row > :PROPERTIES: > :noweb-ref: fullest-disk > :END: > > #+BEGIN_SRC sh :noweb yes > |sed '1d' \ > #+END_SRC > > > > It was mentioned more than 5 years ago as creating problems: > https://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00825.html > > Now I got the same problem as mentioned in the post of that time - the > created file contains only > > #!/bin/sh df \ > > Missing is the second block. > > Any ideas why? See "Incompatible changes > Old Babel header properties are no longer supported" in ORG-NEWS. Regards, -- Nicolas Goaziou
[O] Problem with noweb-ref property [9.0.5 (9.0.5-elpaplus @ /home/rainer/.emacs.d/elpa/org-plus-contrib-20170210/)]
Hi, I have tried the following example of using noweb-ref: --8<---cut here---start->8--- #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh <> #+END_SRC * the mount point of the fullest disk ** query all mounted disks #+HEADER: :noweb-ref fullest-disk #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row :PROPERTIES: :noweb-ref: fullest-disk :END: #+BEGIN_SRC sh :noweb yes |sed '1d' \ #+END_SRC --8<---cut here---end--->8--- It was mentioned more than 5 years ago as creating problems: https://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00825.html Now I got the same problem as mentioned in the post of that time - the created file contains only --8<---cut here---start->8--- #!/bin/sh df \ --8<---cut here---end--->8--- Missing is the second block. Any ideas why? Regards, Rainer Emacs : GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2016-10-26 Package: Org mode version 9.0.5 (9.0.5-elpaplus @ /home/rainer/.emacs.d/elpa/org-plus-contrib-20170210/) current state: == (setq org-protocol-default-template-key "l" org-export-backends '(ascii beamer html icalendar latex odt freemind) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-calc-default-modes '(calc-internal-prec 12 calc-float-format (fix 2) calc-angle-mode deg calc-prefer-frac nil calc-symbolic-mode nil calc-date-format ( "-" MM "-" DD " " Www (" " hh ":" mm)) calc-display-working-message t) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-log-done 'time org-confirm-shell-link-function 'yes-or-no-p org-use-sub-superscripts '{} org-default-notes-file "~/orgfiles/notes.org" org-agenda-include-diary t org-after-todo-state-change-hook '(org-clock-out-if-current) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes turn-on-font-lock org-eldoc-load) org-refile-targets '((org-agenda-files :maxlevel . 5) (nil :maxlevel . 5)) org-format-latex-header "\\documentclass[a4paper]{scrartcl}\n\\usepackage[usenames]{color}\n\\usepackage{amsmath}\n\\usepackage[mathscr]{eucal}\n\\pagestyle{empty} % do not remove\n[PACKAGES]\n[DEFAULT-PACKAGES]\n% The settings below are copied from fullpage.sty\n% \\setlength{\\textwidth}{\\paperwidth}\n% \\addtolength{\\textwidth}{-3cm}\n% \\setlength{\\oddsidemargin}{1.5cm}\n%\\addtolength{\\oddsidemargin}{-2.54cm}\n% \\setlength{\\evensidemargin}{\\oddsidemargin}\n% \\setlength{\\textheight}{\\paperheight}\n% \\addtolength{\\textheight}{-\\headheight}\n% \\addtolength{\\textheight}{-\\headsep}\n% \\addtolength{\\textheight}{-\\footskip}\n% \\addtolength{\\textheight}{-3cm}\n% \\setlength{\\topmargin}{1.5cm}\n% \\addtolength{\\topmargin}{-2.54cm}" org-archive-hook '(org-attach-archive-delete-maybe) org-use-speed-commands t org-clock-persist t org-refile-use-outline-path 'file org-directory "~/orgfiles/" org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-use-property-inheritance '("noweb-ref") org-refile-allow-creating-parent-nodes 'confirm org-todo-keywords '((sequence "TODO(t)" "DONE") (sequence "PLANNING(p)" "DEFERRED" "|" "DONE" "CANCELLED")) org-modules '(org-bbdb org-bibtex org-gnus org-info org-protocol org-git-link org-irc org-wl org-w3m) org-babel-tangle-lang-exts '(("python" . "py") ("awk" . "awk") ("emacs-lisp" . "el") ("elisp" . "el")) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-link-parameters '(("id" :follow org-id-open) ("w3m" :store org-w3m-store-link) ("wl" :follow org-wl-open :store org-wl-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link) ("git" :follow org-git-open :store org-git-store-link) ("gitbare" :follow org-gitbare-open) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("bibtex" :follow org-bibtex-open :store
Re: [O] Problem with noweb-ref property
Eric Schulte eric.schu...@gmx.com writes: However correct performance is more important than fast performance. I've just pushed up a patch which fixes the bug you've described, and hopefully doesn't slow down the tangling process too significantly. Hi Eric, unfortunately, for me it does result in a considerably slow down. (Well, I did not bisect this time but still suspect the commit you mention in this thread.) As a test case you can still use http://pastebin.com/c42jS1Be from my last post on this matter and expand the first source block. Sorry to ask again: Would it be possible to speed things up again or to make the :noweb-ref feature optional? Hi Andreas, I've just pushed up a new variable to the git repository. To enable the faster regexp-based method of noweb expansion (which is not able to resolve noweb-ref header arguments inherited from sub-tree or file-wide properties) put the following in your config. (setq *org-babel-use-quick-and-dirty-noweb-expansion* t) Best, Hi Eric, thanks for this quick-and-dirty fix ;-) Works great! Cheers, Andreas
Re: [O] Problem with noweb-ref property
Tomas Grigera tgrig...@gmail.com writes: Hi Eric, Thanks a lot for your quick reply and fix. Getting the git repo version scares me a bit, but I guess I'll just have to take the plunge! Here we go :) Thanks again, Tomas On Thu, Dec 29, 2011 at 16:51, Eric Schulte eric.schu...@gmx.com wrote: Tomas Grigera tgrig...@gmail.com writes: Hi list, This is my first post, so just let me say first that I have been using org-mode for 10 months or so and I love it. It's an exceptional package, and before I ask my question I would just like to thank Carsten, Bastien, and the community for the great work and for sharing. Now my question: I am trying to extract code from a .org file by tangling with noweb-style references. As I understand from the manual, if I write foo in a code block, the line will be expanded with the code block named foo. This name I can set with #+NAME: or with the :noweb-ref header argument. Both ways work for me, except that I cannont set the :noweb-ref argument through a property. The following example is almost verbatim from the manual: #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh fullest-disk #+END_SRC * the mount point of the fullest disk ** query all mounted disks #+HEADER: :noweb-ref fullest-disk #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row :PROPERTIES: :noweb-ref: fullest-disk :END: #+BEGIN_SRC sh :noweb yes |sed '1d' \ #+END_SRC If I understand correctly, tangling should produce a file which is a concatenation of the two code blocks. However, when I do org-babel-tangle, only the first block is inserted. Am I doing something wrong? I'm with emacs 23.2.1 and org-mode 7.8.02 Thanks in advance, Tomas Hi Tomas, You are correct the behavior described above is a bug introduced by a fairly recent commit of mine which switched to using regular expressions when resolving noweb references in an attempt to decrease the time required to tangle code blocks (which can be significant in large code blocks). However correct performance is more important than fast performance. I've just pushed up a patch which fixes the bug you've described, and hopefully doesn't slow down the tangling process too significantly. Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte/ Hi Eric, unfortunately, for me it does result in a considerably slow down. (Well, I did not bisect this time but still suspect the commit you mention in this thread.) As a test case you can still use http://pastebin.com/c42jS1Be from my last post on this matter and expand the first source block. Sorry to ask again: Would it be possible to speed things up again or to make the :noweb-ref feature optional? Regards, Andreas
Re: [O] Problem with noweb-ref property
Andreas Leha andreas.l...@med.uni-goettingen.de writes: Tomas Grigera tgrig...@gmail.com writes: Hi Eric, Thanks a lot for your quick reply and fix. Getting the git repo version scares me a bit, but I guess I'll just have to take the plunge! Here we go :) Thanks again, Tomas On Thu, Dec 29, 2011 at 16:51, Eric Schulte eric.schu...@gmx.com wrote: Tomas Grigera tgrig...@gmail.com writes: Hi list, This is my first post, so just let me say first that I have been using org-mode for 10 months or so and I love it. It's an exceptional package, and before I ask my question I would just like to thank Carsten, Bastien, and the community for the great work and for sharing. Now my question: I am trying to extract code from a .org file by tangling with noweb-style references. As I understand from the manual, if I write foo in a code block, the line will be expanded with the code block named foo. This name I can set with #+NAME: or with the :noweb-ref header argument. Both ways work for me, except that I cannont set the :noweb-ref argument through a property. The following example is almost verbatim from the manual: #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh fullest-disk #+END_SRC * the mount point of the fullest disk ** query all mounted disks #+HEADER: :noweb-ref fullest-disk #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row :PROPERTIES: :noweb-ref: fullest-disk :END: #+BEGIN_SRC sh :noweb yes |sed '1d' \ #+END_SRC If I understand correctly, tangling should produce a file which is a concatenation of the two code blocks. However, when I do org-babel-tangle, only the first block is inserted. Am I doing something wrong? I'm with emacs 23.2.1 and org-mode 7.8.02 Thanks in advance, Tomas Hi Tomas, You are correct the behavior described above is a bug introduced by a fairly recent commit of mine which switched to using regular expressions when resolving noweb references in an attempt to decrease the time required to tangle code blocks (which can be significant in large code blocks). However correct performance is more important than fast performance. I've just pushed up a patch which fixes the bug you've described, and hopefully doesn't slow down the tangling process too significantly. Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte/ Hi Eric, unfortunately, for me it does result in a considerably slow down. (Well, I did not bisect this time but still suspect the commit you mention in this thread.) As a test case you can still use http://pastebin.com/c42jS1Be from my last post on this matter and expand the first source block. Sorry to ask again: Would it be possible to speed things up again or to make the :noweb-ref feature optional? Hi Andreas, I've just pushed up a new variable to the git repository. To enable the faster regexp-based method of noweb expansion (which is not able to resolve noweb-ref header arguments inherited from sub-tree or file-wide properties) put the following in your config. (setq *org-babel-use-quick-and-dirty-noweb-expansion* t) Best, Regards, Andreas -- Eric Schulte http://cs.unm.edu/~eschulte/
[O] Problem with noweb-ref property
Hi list, This is my first post, so just let me say first that I have been using org-mode for 10 months or so and I love it. It's an exceptional package, and before I ask my question I would just like to thank Carsten, Bastien, and the community for the great work and for sharing. Now my question: I am trying to extract code from a .org file by tangling with noweb-style references. As I understand from the manual, if I write foo in a code block, the line will be expanded with the code block named foo. This name I can set with #+NAME: or with the :noweb-ref header argument. Both ways work for me, except that I cannont set the :noweb-ref argument through a property. The following example is almost verbatim from the manual: #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh fullest-disk #+END_SRC * the mount point of the fullest disk ** query all mounted disks #+HEADER: :noweb-ref fullest-disk #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row :PROPERTIES: :noweb-ref: fullest-disk :END: #+BEGIN_SRC sh :noweb yes |sed '1d' \ #+END_SRC If I understand correctly, tangling should produce a file which is a concatenation of the two code blocks. However, when I do org-babel-tangle, only the first block is inserted. Am I doing something wrong? I'm with emacs 23.2.1 and org-mode 7.8.02 Thanks in advance, Tomas
Re: [O] Problem with noweb-ref property
Tomas Grigera tgrig...@gmail.com writes: Hi list, This is my first post, so just let me say first that I have been using org-mode for 10 months or so and I love it. It's an exceptional package, and before I ask my question I would just like to thank Carsten, Bastien, and the community for the great work and for sharing. Now my question: I am trying to extract code from a .org file by tangling with noweb-style references. As I understand from the manual, if I write foo in a code block, the line will be expanded with the code block named foo. This name I can set with #+NAME: or with the :noweb-ref header argument. Both ways work for me, except that I cannont set the :noweb-ref argument through a property. The following example is almost verbatim from the manual: #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh fullest-disk #+END_SRC * the mount point of the fullest disk ** query all mounted disks #+HEADER: :noweb-ref fullest-disk #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row :PROPERTIES: :noweb-ref: fullest-disk :END: #+BEGIN_SRC sh :noweb yes |sed '1d' \ #+END_SRC If I understand correctly, tangling should produce a file which is a concatenation of the two code blocks. However, when I do org-babel-tangle, only the first block is inserted. Am I doing something wrong? I'm with emacs 23.2.1 and org-mode 7.8.02 Thanks in advance, Tomas Hi Tomas, You are correct the behavior described above is a bug introduced by a fairly recent commit of mine which switched to using regular expressions when resolving noweb references in an attempt to decrease the time required to tangle code blocks (which can be significant in large code blocks). However correct performance is more important than fast performance. I've just pushed up a patch which fixes the bug you've described, and hopefully doesn't slow down the tangling process too significantly. Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Problem with noweb-ref property
Hi Eric, Thanks a lot for your quick reply and fix. Getting the git repo version scares me a bit, but I guess I'll just have to take the plunge! Here we go :) Thanks again, Tomas On Thu, Dec 29, 2011 at 16:51, Eric Schulte eric.schu...@gmx.com wrote: Tomas Grigera tgrig...@gmail.com writes: Hi list, This is my first post, so just let me say first that I have been using org-mode for 10 months or so and I love it. It's an exceptional package, and before I ask my question I would just like to thank Carsten, Bastien, and the community for the great work and for sharing. Now my question: I am trying to extract code from a .org file by tangling with noweb-style references. As I understand from the manual, if I write foo in a code block, the line will be expanded with the code block named foo. This name I can set with #+NAME: or with the :noweb-ref header argument. Both ways work for me, except that I cannont set the :noweb-ref argument through a property. The following example is almost verbatim from the manual: #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh fullest-disk #+END_SRC * the mount point of the fullest disk ** query all mounted disks #+HEADER: :noweb-ref fullest-disk #+BEGIN_SRC sh df \ #+END_SRC ** strip the header row :PROPERTIES: :noweb-ref: fullest-disk :END: #+BEGIN_SRC sh :noweb yes |sed '1d' \ #+END_SRC If I understand correctly, tangling should produce a file which is a concatenation of the two code blocks. However, when I do org-babel-tangle, only the first block is inserted. Am I doing something wrong? I'm with emacs 23.2.1 and org-mode 7.8.02 Thanks in advance, Tomas Hi Tomas, You are correct the behavior described above is a bug introduced by a fairly recent commit of mine which switched to using regular expressions when resolving noweb references in an attempt to decrease the time required to tangle code blocks (which can be significant in large code blocks). However correct performance is more important than fast performance. I've just pushed up a patch which fixes the bug you've described, and hopefully doesn't slow down the tangling process too significantly. Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte/