Re: [O] [bug][babel] #+call: execution broken
Eric Schulte schulte.e...@gmail.com writes: Martyn Jago martyn.j...@btinternet.com writes: Hi C-c C-c on a #+call: block() statement no longer causes the block to execute. This regression occurred on Nov 8th: commit a4273cbe0e0480bd02c59464cafb985951b1c5a2 Author: Eric Schulte schulte.e...@gmail.com Date: Tue Nov 8 19:42:59 2011 -0700 call lines are more careful about being in example or verbatim blocks I've supplied a patch which provides a couple of failing tests which highlight the problem. Hi Martyn, The reason that your tests are failing is because they use the old #+srcname: rather than the new #+name: syntax for naming a code block. After making this change both tests pass. Doh! Clearly I need to keep up with the times. Best, Martyn
Re: [O] odt export to google-docs problem
On Fri, Nov 18, 2011 at 11:21 AM, Jambunathan K kjambunat...@gmail.comwrote: Suvayu/Rustom suvayu ali fatkasuvayu+li...@gmail.com writes: Hi Jambunathan, On Thu, Nov 17, 2011 at 11:06, Jambunathan K kjambunat...@gmail.com wrote: Can anyone else reproduce this? I can replicate this. The odt file exported by org-odt is not accepted by google docs even though libreoffice opens it without problems. However it I open it with libreoffice and say edit and save, google docs then accepts the new file. With my some experimentation, I am able to reproduce it now. I have this in my .emacs. , | (setq org-export-odt-prettify-xml t) ` Seems to fix the problem - Thanks. [As a programmer you do not like the 'fix' -- thats another matter :-) ]
[O] Export #+call: within example block
Hi Is there a way to export the following, is this a bug, or is there a work-around (to HTML)? --8---cut here---start-8--- #+begin_example #+call: rubbish() #+end_example --8---cut here---end---8--- For instance this exports fine... --8---cut here---start-8--- #+begin_example #+begin_src emacs-lisp (some rubbish) #+end_src #+end_example --8---cut here---end---8--- Best, Martyn --- Org-mode version 7.7 (release_7.7.571.g0dc50.dirty) GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35) of 2011-08-21 on virtualmac.porkrind.org
[O] [patch] Add faces for highlighting calendar events in the agenda
Hello, Find attached a patch to highlight 2 types of calendar events: - appointments (or whatever close to that), that is events based on an active timestamp; - S-expressions to compute active timestamps for events. The change is quite straightforward. Best regards, Seb -- Sebastien Vauban From 271dc5a7bb1c377cc38df63c50f2af41019abb34 Mon Sep 17 00:00:00 2001 From: Sebastien Vauban s...@mygooglest.com Date: Fri, 18 Nov 2011 13:41:47 +0100 Subject: [PATCH] Add faces for calendar events (active timestamps, or S-expressions). * org-agenda.el (org-agenda-get-timestamps) (org-agenda-get-sexps): Use face for highlighting calendar events. * org-faces.el: Add faces `org-agenda-calendar-event' and `org-agenda-calendar-sexp'. --- lisp/org-agenda.el |9 + lisp/org-faces.el | 12 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 0a98fbe..70c6c17 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3636,7 +3636,7 @@ given in `org-agenda-start-on-weekday'. (setq rtn (apply 'org-agenda-get-day-entries file date org-agenda-entry-types) - (setq rtnall (append rtnall rtn + (setq rtnall (append rtnall rtn ;; all entries (if org-agenda-include-diary (let ((org-agenda-search-headline-for-time t)) (require 'diary-lib) @@ -3658,7 +3658,7 @@ given in `org-agenda-start-on-weekday'. (put-text-property s (1- (point)) 'org-day-cnt day-cnt) (when todayp (put-text-property s (1- (point)) 'org-today t)) - (if rtnall (insert + (if rtnall (insert ;; all entries (org-finalize-agenda-entries (org-agenda-add-time-grid-maybe rtnall ndays todayp)) @@ -4721,7 +4721,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (defun org-agenda-get-timestamps () Return the date stamp information for agenda display. - (let* ((props (list 'face nil + (let* ((props (list 'face 'org-agenda-calendar-event 'org-not-done-regexp org-not-done-regexp 'org-todo-regexp org-todo-regexp 'org-complex-heading-regexp org-complex-heading-regexp @@ -4822,7 +4822,8 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (defun org-agenda-get-sexps () Return the sexp information for agenda display. (require 'diary-lib) - (let* ((props (list 'mouse-face 'highlight + (let* ((props (list 'face 'org-agenda-calendar-sexp + 'mouse-face 'highlight 'help-echo (format mouse-2 or RET jump to org file %s (abbreviate-file-name buffer-file-name diff --git a/lisp/org-faces.el b/lisp/org-faces.el index 7b7dfa7..c15cb7d 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -695,6 +695,18 @@ month and 365.24 days for a year). Face used for agenda entries that come from the Emacs diary. :group 'org-faces) +(defface org-agenda-calendar-event + 'background light)) (:foreground #FF :background #1662AF)) +(((background dark)) (:foreground blue))) + Face used to show events and appointments in the agenda. + :group 'org-faces) + +(defface org-agenda-calendar-sexp + 'background light)) (:background light blue)) +(((background dark)) (:foreground light blue))) + Face used to show events computed from a S-expression. + :group 'org-faces) + (defconst org-level-faces '(org-level-1 org-level-2 org-level-3 org-level-4 org-level-5 org-level-6 org-level-7 org-level-8 -- 1.7.5.1
Re: [O] bug#10071: 24.0.91; Emacs runtime crashes while exporting an org file
Hello, Jambunathan K kjambunat...@gmail.com writes: Ccing Nicolas to attract his attention. Refer http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10071 I cannot reproduce it on development version of Org mode (nor in stable version), GNU Emacs 24.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.2.1). Jambunathan, can you debug `org-export-normalize-links' before Emacs crashes? Regards, -- Nicolas Goaziou
[O] Not overwriting unchanged source code files when tangling
Hi, I have a problem/request for org-mode and was looking for help. I am using org-mode to write source code files and tangle them out. I want to compile them using make. My problem now is that org-mode overwrites the old files every time I tangle them out, therefore also updating the time stamp - even if nothing has changed. Subsequently, when I run make, everything gets recompiled, not just the changed source code files as all time stamps have changed. Is there an option for org-mode to only overwrite source code files that get tangled out if they have truly changed? Thank you very much for your help! Holger
Re: [O] Not overwriting unchanged source code files when tangling
On Fri, Nov 18, 2011 at 7:17 AM, Holger Hoefling hhoef...@gmail.com wrote: I have a problem/request for org-mode and was looking for help. I am using org-mode to write source code files and tangle them out. I want to compile them using make. My problem now is that org-mode overwrites the old files every time I tangle them out, therefore also updating the time stamp - even if nothing has changed. Subsequently, when I run make, everything gets recompiled, not just the changed source code files as all time stamps have changed. Is there an option for org-mode to only overwrite source code files that get tangled out if they have truly changed? I believe that to do this, you would need to have a dependency tree of the nodes contributing to the output (perhaps already exists), and recursively mark any node that refers to a node that changed as dirty. You would also have to store last update times on each node so that they could be compared to each output file, contributing to the determination of needing a regeneration or not. From a make standpoint, if you were to have each node in a file (I am not recommending this), make already has the smarts to handle this. It just becomes unwieldy to manage from an editing perspective. Perhaps a way to deal with this would be to tangle to a different directory, and then sync any changes into your compilation source directory. If you would update the compilation directory only when something differs from the tangle directory, then make could handle it from that point on. Brian
Re: [O] Not overwriting unchanged source code files when tangling
Hi Holger, Holger Hoefling wrote: I have a problem/request for org-mode and was looking for help. I am using org-mode to write source code files and tangle them out. I want to compile them using make. My problem now is that org-mode overwrites the old files every time I tangle them out, therefore also updating the time stamp - even if nothing has changed. Subsequently, when I run make, everything gets recompiled, not just the changed source code files as all time stamps have changed. Is there an option for org-mode to only overwrite source code files that get tangled out if they have truly changed? Thank you very much for your help! I have absolutely no idea on how hard it could be, but this makes me think at some cache mechanism, like what currently exists for skipping evaluation of unchanged code blocks. The key could be to use the cache feature for tangling as well? Best regards, Seb -- Sebastien Vauban
[O] How to estimate effort by week?
Dear all, is there any way of estimating effort by week? I have some tasks on which I don't want to waste too much time per week. For other tasks, on which I don't want to waste too much time per _day_, I can use the following properties: :PROPERTIES: :CLOCK_MODELINE_TOTAL: today :Effort: 0:15 :END: There is no immediate equivalent for a week (or for any other timespan). But is there possibly some workaround? Cheers, and thanks, Christoph -- Christoph Lange, http://www.facebook.com/ch.lange, Skype duke4701
Re: [O] Quicker refile? Capture progress cookies. Using capture to count/tally
Bernt, I think your system (and your writing about it) is fantastic and it has inspired me to develop mine. On 17 November 2011 23:10, Bernt Hansen be...@norang.ca wrote: Gez sule...@gmail.com writes: I almost exclusively use capture to quickly file away things I don't want to forget. This goes to my refile.org as a level 1 heading and isn't attached to anything yet. I was resisting doing that because I have different todo's for different files, but - it just occured to me - what's to stop me listing all of the possible todo's at the top of a refile org file? I might just do that. All of my tasks that need to be refiled show up on my block agenda view in the second section - immediately under today's agenda view.snip I'm using this block agenda view regularly during the day and the tasks to be refiled are constantly 'in my face' until I do something with them. Yes, it would work if I added them to my block agenda. I refile these items mostly from the agenda - I tend to get 2 or 3 of them that are going to the same target so I'll mark them with 'm' and refile with 'B r'. My refile setup uses IDO completion for refile targets and I find this works very well. If I'm refiling to file x.org under '* Tasks' I'll do something like C-c C-w x.org C-SPC tasks RET The order of entering x.org/tasks doesn't matter - IDO is limiting the targets to the entered data so I can match part of what is left in the list. It's because of reading your set-up that I use IDO now. I't's amazing. Perhaps I need more practise in using it - cleverly selecting what I enter - since I end up having to type the whole file name including .org quite often. As good practise, I should probably consistently start with the headline, since my filenames are not unique enough (they match the equivalent archive file and also other headlines). I've also set up refiling to remove DONE tasks from the list of available completion targets. This helps prevent mistakes where you refile to an already done tree (or if you have repeating separate tasks with the same name only the open ones show up as refile targets.) I've had your page open for a while in firefox, gradually re-reading, working through and modifying my setup. I was going to tackle some clock-related stuff next, but now I think removing DONE tasks from the list of targets might be the next thing I add. Refiling the thing to the right place isn't important right now so I put that off. Constantly having to move things to the right place as you capture them will be too slow IMHO. I do know what you mean. I think I've erroneously feared that if I insert a reminder out of context, I need to be more verbose than I would otherwise, or I will forget later what it means, but I can imagine that if I frequently check the items to refile, I probably won't forget. Hope that helps, Very much indeed. Thank you. Geraldine
[O] Bug: Following links moves me in the agenda [7.7 (release_7.7.397.g5adafd)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. When I `C-c C-o' on an agenda item, point always ends up at the bottom of the agenda and I lose my place. This seems like a bug to me. Emacs : GNU Emacs 23.3.1 (x86_64-apple-darwin11.2.0, Carbon Version 1.6.0 AppKit 1138.23) of 2011-11-13 on pluto.luannocracy.com Package: Org-mode version 7.7 (release_7.7.397.g5adafd) current state: == (setq org-x-backends '(ox-org ox-redmine) org-agenda-deadline-leaders '(D: D%d: ) org-clock-in-switch-to-state STARTED org-agenda-skip-scheduled-if-deadline-is-shown t org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars) org-special-ctrl-a/e '(nil . t) org-x-redmine-title-prefix-match-function 'org-x-redmine-title-prefix-match org-default-priority 67 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-agenda-custom-commands '((E Errands (next 3 days) tags ErrandTODO\DONE\TODO\CANCELED\STYLE\habit\SCHEDULED\+3d\ ((org-agenda-overriding-header Errands (next 3 days (A Priority #A tasks agenda ((org-agenda-ndays 1) (org-agenda-overriding-header Today's priority #A tasks: ) (org-agenda-skip-function (quote (org-agenda-skip-entry-if (quote notregexp) \\=.*\\[#A\\]))) ) ) (b Priority #A and #B tasks agenda ((org-agenda-ndays 1) (org-agenda-overriding-header Today's priority #A and #B tasks: ) (org-agenda-skip-function (quote (org-agenda-skip-entry-if (quote regexp) \\=.*\\[#C\\]))) ) ) (w Waiting/delegated tasks tags TODO=\WAITING\|TODO=\DELEGATED\ ((org-agenda-overriding-header Waiting/delegated tasks:) (org-agenda-sorting-strategy (quote (todo-state-up priority-down category-up ) (p Unprioritized tasks tags AREA\Work\TODO\\TODO{DONE\\|CANCELED\\|NOTE\\|PROJECT\\|DEFERRED\\|SOMEDAY} ((org-agenda-files (quote (~/Documents/Tasks/todo.txt) ) ) (org-agenda-overriding-header Unprioritized tasks: ) (org-agenda-skip-function (quote
Re: [O] How to estimate effort by week?
Christoph LANGE ch.la...@jacobs-university.de writes: is there any way of estimating effort by week? Have a look at the doc string of org-effort-durations. Documentation: Conversion factor to minutes for an effort modifier. Each entry has the form (MODIFIER . MINUTES). In an effort string, a number followed by MODIFIER is multiplied by the specified number of MINUTES to obtain an effort in minutes. For example, if the value of this variable is ((hours . 60)), then an effort string 2hours is equivalent to 120 minutes. -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland
Re: [O] Not overwriting unchanged source code files when tangling
On Fri, 18 Nov 2011 08:23:18 -0600, Brian Wightman midlife...@wightmanfam.org wrote: Perhaps a way to deal with this would be to tangle to a different directory, and then sync any changes into your compilation source directory. If you would update the compilation directory only when something differs from the tangle directory, then make could handle it from that point on. The tangle mechanism could probably handle this autoatically. i.e. not saving a file if the contents are identical. Tom
Re: [O] How to estimate effort by week?
Hi Christian, 2011-11-18 17:32 Christian Egli: Christoph LANGEch.la...@jacobs-university.de writes: is there any way of estimating effort by week? Have a look at the doc string of org-effort-durations. Documentation: Conversion factor to minutes for an effort modifier. Thanks for your pointer, but (if I got you right) that wasn't what I meant to ask. So let me try to ask more precisely: I was not interested in expressing that a task would take me an estimated time of N weeks, but in expressing that I would spend at most some amount of time per week on that task. Cheers, Christoph -- Christoph Lange, http://www.facebook.com/ch.lange, Skype duke4701
Re: [O] bug#10071: 24.0.91; Emacs runtime crashes while exporting an org file
Eli, Thanks for the clue and Stefan, thanks for the fix meanwhile. The minimal snippet that captures the root cause follows down below. Nicolas Goaziou n.goaz...@gmail.com writes: Hello, Jambunathan K kjambunat...@gmail.com writes: Ccing Nicolas to attract his attention. Refer http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10071 I cannot reproduce it on development version of Org mode (nor in stable version), GNU Emacs 24.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.2.1). Jambunathan, can you debug `org-export-normalize-links' before Emacs crashes? #+begin_src emacs-lisp ;; install blah in the run-time (defun blah () (goto-char (point-min)) (while (re-search-forward \\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\] nil t) (goto-char (1- (match-end 0))) (org-if-unprotected (let* ((xx (match-string 1)) (s (concat [[ xx ][ xx ]]))) (replace-match s t t) #+end_src ;; eval the 3 forms in sequence. Note that the third form will crash ;; emacs #+begin_src emacs-lisp ;; form 1 ;; here link buffer ;; link *is* decorated (with-temp-buffer ;; (insert [[http://www.google.com]];) (insert [[http://www.google.com]]a;) ; Note the extra a at the ; end (add-text-properties (point-min) (point-max) '(org-caption nil org-caption-shortn nil org-label nil org-attributes nil)) (blah)) #+end_src #+begin_src emacs-lisp ;; form 2 ;; here link = buffer ;; link is *not* decorated (with-temp-buffer (insert [[http://www.google.com]];) ;; (insert [[http://www.google.com]]a;) ;; (add-text-properties (point-min) (point-max) ;; '(org-caption nil org-caption-shortn nil ;; org-label nil org-attributes nil)) (blah)) #+end_src #+begin_src emacs-lisp ;; form 3 ;; here link = buffer ;; link *is* decorated (with-temp-buffer (insert [[http://www.google.com]];) ;; (insert [[http://www.google.com]]a;) (add-text-properties (point-min) (point-max) '(org-caption nil org-caption-shortn nil org-label nil org-attributes nil)) (blah)) #+end_src Regards,
Re: [O] Not overwriting unchanged source code files when tangling
On Fri, Nov 18, 2011 at 10:46 AM, Tom Prince tom.pri...@ualberta.net wrote: On Fri, 18 Nov 2011 08:23:18 -0600, Brian Wightman midlife...@wightmanfam.org wrote: Perhaps a way to deal with this would be to tangle to a different directory, and then sync any changes into your compilation source directory. If you would update the compilation directory only when something differs from the tangle directory, then make could handle it from that point on. The tangle mechanism could probably handle this autoatically. i.e. not saving a file if the contents are identical. If there is not a lot of extra memory / time overhead associated with this, I could see this being a valid approach. I would request that, if implemented, this be placed behind an on/off switch. The makefile could also handle this with something along these lines (correct the leading space - tab conversion as well as proper macro definitions): tangleflag: totangle.org $(TANGLECOMMAND) totangle.org $(TOUCH) tangleflag syncflag: tangleflag $(SYNCCOMMAND) sourcedir tangledir $(TOUCH) syncflag --Brian
Re: [O] Not overwriting unchanged source code files when tangling
On 18.11.2011, at 14:17, Holger Hoefling wrote: Hi, I have a problem/request for org-mode and was looking for help. I am using org-mode to write source code files and tangle them out. I want to compile them using make. My problem now is that org-mode overwrites the old files every time I tangle them out, therefore also updating the time stamp - even if nothing has changed. Subsequently, when I run make, everything gets recompiled, not just the changed source code files as all time stamps have changed. Is there an option for org-mode to only overwrite source code files that get tangled out if they have truly changed? How about changing the make file so that the dependence is on the Org file, not on the source file? You could then arrange for make to call emacs in batch-mode to tangle the source file and then compile it? Something along the lines of (untested, and probably wrong in this way...) file.o: somefile.org emacs -batch --eval '(org-babel-tangle-file somefile.org)' cc file.o - Carsten
Re: [O] Not overwriting unchanged source code files when tangling
On Fri, Nov 18, 2011 at 11:02 AM, Carsten Dominik carsten.domi...@gmail.com wrote: How about changing the make file so that the dependence is on the Org file, not on the source file? You could then arrange for make to call emacs in batch-mode to tangle the source file and then compile it? The original question was trying to avoid recompiling everything generated from a tangle if the content didn't actually change. Because retangling the source rewrites /all/ of the files, and resets the dates, even if nothing has changed, make will then rebuild everything that was tangled, not just the partial set of tangled files that actually changed. Brian
[O] [OT] TeX/LaTex and OrgMode
* [OT] TeX/LaTex and OrgMode is the off topic--since OrgMode spits out TeX and so many OrgMode users use TeX; I hope you'll get a kick out of this: http://detexify.kirelabs.org/classify.html?
[O] Bug: org-clock-out-if-current = marker does not point anywhere [7.7 (release_7.7.397.g5adafd)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. The bug is caused by the following lines: ( (point) org-clock-marker) ( (save-excursion (outline-next-heading) (point)) where org-clock-marker is `#marker in no buffer' --8---cut here---start-8--- org-clock-out-if-current() run-hooks(org-after-todo-state-change-hook) byte-code(\306\307!\210\310!\203. \311\225Sb\210\310\312 \313Q!\204. \310\314!\210\302 .\315 .\302 .\316\216\317\320\321\307\211$*.@.@.A.A.B.B\322\323!.C\311\224.D\324.C!.E\325.E.F\\211.GA@.H\326.G8.I\327.G8.J.C\206i.\330.K\307.L.C.M\235\211.NA.O.P\203\242.Q\331\232\203\214.R\332=\204\235.Q\204\242.R\203\242.R\332=\204\242.\333 \202\367.Q\334\232\203\300.R\203\263.P\204\300.\335\336\337\340.M\\320\307$\202\367.Q\341=\203\335.C\203\327.O\205\367.O@\202\367.M@\202\367.Q\342=\203..N.M\232?\205\367.C\203.\343.MG.OG\344#.M8\202\367.M.S\345.S!@)\202\367.R\307=\203#.Q\346\232\203#.\320\211.Q\206\367.Q\203\247.Q\330\232\2033.\320\202\367.Q\347=\203.\320\202\367.Q\350=\203P.I\206\367.T@\202\367.Q\351=\203g.E.U\235A@\206\367.U@\202\367.Q\352=\203\205.\353.U!.U.E.U\235A@\206\201.U@)\202\367.Q.M\235@\206\367.Q;\203\234.\354\355.Q\\202\367.\356.Q!S.M8\202\367.N\204\267.E\206\367.M@\202\367.C.J\232\203\303.\320\202\367.O\204\314.\320\202\367.H\357\203\364.V.W=\203\341.O@\202\367.OG\311V\205\367.I\206\367.T@\202\367.O@.X\360\361.X.K#\206..X\211.X\203.\362.X\362Q\202.\362.Y\363\364\365.C\366.X\367\257.Z\320\211.[.\\.:\203j.C.T\235?.]\212\302 .\370\216\212\214~\210\371\372.Z\-\204j.\373\374!\203[.\354\375.C.X#\210\202j.\376\375.C.X#\210\377\201g.\320\\210\201h.\n!\210\201i.Y\307\211#\210\201j.D!\204\216.\376\201k.\201l.Y!\\210.E\204\262.\324.X!.E\325.E.F\\211.GA@.H\326.G8.I\327.G8.J.Q\201m.\203\344.\376\201n.\343.^G\201o.\325.X.^\.^G#.^G\201p.\201q.\325.X.^\\362#$\210.X.T\235?.].X.T\235\205\372.C.T\235?.\\.\203.\201r. !\210.B\204..@\203\271._\307=\204\271.Q\201s.\204\271.\325.X.B\A@\2063.\344\325.C.B\8\211.[\201t.=\203K._\201t.=\203K.\201u.[.X\203j.X.`\235\203j.C.`\235\204j.\201v.\320\211\201w.#\210.\\\203\236.@\203\236.\201v.\201w.\201x. \\210.[\204\236.@\201t.=\203\236.\201y.\350.X.C\201z.\201t.%\210.X\203\271.[\203\271.\201y.\201X.X.C\201z.[%\210\201{.X!\210.a\203\321.b\204\321.\201|.\320\307\\210.c\203\333.\201}. \210\201~.\201.!\210.Q\203\366.X.T\235\204\366.\324.X!.E\201\200.\315 \201\201. \201\202.E$\210.\\\203*.\201\203.\201d.!\203#.\302 .\201\204.\216\201\205. .d*\201\206.X!\210\201\207. \203f.n\204f.\212\201\210.\323!\210\310.e!)\203f.`\344\211\225\206M.\323\225\\W\203f.\344\225\206Y.\323\225b\210\310\362!\203f.\201\211. \210.f\205v.\212\201\212.\201f.Z\)..\207 [org-outline-regexp org-todo-regexp match-data startpos save-match-data-internal logging org-back-to-heading t looking-at 0 + \\( +\\|$\\) * point-at-bol ((byte-code \301\302\\207 [save-match-data-internal set-match-data evaporate] 3)) org-entry-get nil LOGGING match-string 1 org-get-todo-sequence-head assoc 3 4 (4) prefix org-fast-todo-selection (4) org-icompleting-read State: mapcar #[(x) C\207 [x] 1] right left - 2 last (4) none done nextset previousset reverse error State `%s' not valid in this file prefix-numeric-value (type priority) run-hook-with-args-until-success org-todo-get-default-hook ...] 10) org-todo(done) (if (or (match-string 2) (and ... ...)) (org-todo (quote done)) (org-todo (quote todo))) (progn (if (or ... ...) (org-todo ...) (org-todo ...))) (if (looking-at (concat ^\\*+[ ]+ org-todo-regexp [ ].*\\[ \\(?: \\(?2:100%\\)\\|[0-9]+% \\| \\(?3:[0-9]+\\) / \\(?4:[0-9]+\\) \\) \\])) (progn (if ... ... ...))) (when (looking-at (concat ^\\*+[ ]+ org-todo-regexp [ ].*\\[ \\(?: \\(?2:100%\\)\\|[0-9]+% \\| \\(?3:[0-9]+\\) / \\(?4:[0-9]+\\) \\) \\])) (if (or ... ...) (org-todo ...) (org-todo ...))) (save-excursion (org-back-to-heading t) (when (looking-at ...) (if ... ... ...))) dwa/checkbox-list-complete() run-hooks(org-checkbox-statistics-hook) org-update-checkbox-count-maybe() org-ctrl-c-ctrl-c(nil) call-interactively(org-ctrl-c-ctrl-c nil nil) --8---cut here---end---8--- Emacs : GNU Emacs 23.3.1 (x86_64-apple-darwin11.2.0, Carbon Version 1.6.0 AppKit 1138.23) of 2011-11-13 on pluto.luannocracy.com Package: Org-mode version 7.7 (release_7.7.397.g5adafd) current state: == (setq org-x-backends '(ox-org ox-redmine) org-log-done 'time org-agenda-deadline-leaders '(D: D%d: ) org-clock-in-switch-to-state STARTED org-agenda-skip-scheduled-if-deadline-is-shown t
Re: [O] Not overwriting unchanged source code files when tangling
Hi Carsten, thanks for the suggestion, but as I agree with Brian. If there is more than one source file in the org-file, then the whole project would still be recompiled, not just the updated file. To be more exact, I actually don't want to compile things, but run R scripts using make. So the waiting time if a computationally intensive step is repeated although it is not necessary can be substantial. I wonder how difficult the following change would be (no emacs lisp experience, also do not know the org source code): - would it be possible to write out the source files when tangling into a temporary directory, then compare to the actual target files and overwrite only if something has changed? Then the time stamps would stay fixed. Hopefully, this would not involve too much work: - creating temporary files and remembering the mapping to true files - tangling out as usual into temporary files (so probably little change there) - compare temporary file to true file (does emacs already have a diff utility that could be used?) - overwrite true file if any changes - delete temporary files Especially, with this method no dependencies would be necessary and it would not be necessary to keep track in the org files which source blocks have been changed since the last tangling Thank you for your suggestion Holger On Fri, Nov 18, 2011 at 6:02 PM, Carsten Dominik carsten.domi...@gmail.comwrote: On 18.11.2011, at 14:17, Holger Hoefling wrote: Hi, I have a problem/request for org-mode and was looking for help. I am using org-mode to write source code files and tangle them out. I want to compile them using make. My problem now is that org-mode overwrites the old files every time I tangle them out, therefore also updating the time stamp - even if nothing has changed. Subsequently, when I run make, everything gets recompiled, not just the changed source code files as all time stamps have changed. Is there an option for org-mode to only overwrite source code files that get tangled out if they have truly changed? How about changing the make file so that the dependence is on the Org file, not on the source file? You could then arrange for make to call emacs in batch-mode to tangle the source file and then compile it? Something along the lines of (untested, and probably wrong in this way...) file.o: somefile.org emacs -batch --eval '(org-babel-tangle-file somefile.org)' cc file.o - Carsten
Re: [O] Export #+call: within example block
Hi Martyn, Thanks for pointing out this bug. I've just pushed up a fix and a test case. Cheers -- Eric Martyn Jago martyn.j...@btinternet.com writes: Hi Is there a way to export the following, is this a bug, or is there a work-around (to HTML)? #+begin_example #+call: rubbish() #+end_example For instance this exports fine... #+begin_example #+begin_src emacs-lisp (some rubbish) #+end_src #+end_example Best, Martyn --- Org-mode version 7.7 (release_7.7.571.g0dc50.dirty) GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35) of 2011-08-21 on virtualmac.porkrind.org -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Details of compling and running C++ code from Org-mode?
Hi Michael, Michael Hannon jm_han...@yahoo.com writes: Greetings. I'm curious about the process of executing a program that is compiled from a source block in Org-mode. Some background: I was playing with some C++ code (a slight generalization of some code I found in a book). I wanted to use the assign method to initialize a vector, as: vectorint testVec(5, 0); testVec.assign({2, 4, 6, 8, 10}); It turns out that to do this one has to tell g++ (in my case) to use the latest version of the C++ standard. I discovered that I could do this via: (setq org-babel-C++-compiler g++ -std=c++0x) You could also use the :flags header argument (:flags -std=c++0x) to pass this flag to g++. This got me to wondering if there were any similar hooks that relate to running the program once it's compiled. I looked through the list of org-babel* variables, but didn't find anything obvious. So what does happen when I hit C-c C-c in, say, a cpp source-code block? The contents of the file are evidently written to a temporary file, after which the command specified by org-babel-C++-compiler is run on that file. The results of the compilation are stuck some place -- another temporary file, I suppose. Then the second, executable file is run and the results collected. Thanks for asking this question, and sorry it took so long to respond. I've placed an annotated copy of the relevant code up at [1] which should explain the evaluation process for c/c++ code. In many cases browsing the relevant org-babel-execute:* function for your language is the best way to discover what flags are available. What command runs the file? The file itself is called directly. Is there any control from Org-mode over this second stage of the process? Yes, the :cmdline header argument may be used to pass values to the executing file. Best -- Eric Thanks, -- Mike Footnotes: [1] http://cs.unm.edu/~eschulte/data/babel-c-execution.html http://cs.unm.edu/~eschulte/data/babel-c-execution.org -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Not overwriting unchanged source code files when tangling
Brian Wightman br...@wightmanfam.org writes: On Fri, Nov 18, 2011 at 11:02 AM, Carsten Dominik carsten.domi...@gmail.com wrote: How about changing the make file so that the dependence is on the Org file, not on the source file? You could then arrange for make to call emacs in batch-mode to tangle the source file and then compile it? The original question was trying to avoid recompiling everything generated from a tangle if the content didn't actually change. Because retangling the source rewrites /all/ of the files, and resets the dates, even if nothing has changed, make will then rebuild everything that was tangled, not just the partial set of tangled files that actually changed. I think the best approach in this case would be to tangle each file out to a temporary buffer, and then just before exiting the tangle function the content of these temporary buffers could be checked against the files on disk, and only those buffers which differ from disk would be written. See ob-tangle.el around line 240 for the relevant code. Unfortunately this would not be trivial, as currently content is written to the target files incrementally block by block. If the code in the .org file is grouped by subtree it may be possible to place calls to org-narrow-to-subtree in the Makefile before tangling, so that only part of the file is tangled. Finally, it may be easiest simply to play make's game as it were and break up the Org-mode file into multiple files. These multiple files could still be combined during export using #+INCLUDE lines from a single master Org-mode file. Best -- Eric Brian -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Not overwriting unchanged source code files when tangling
Holger Hoefling hhoef...@gmail.com writes: I have a problem/request for org-mode and was looking for help. I am using org-mode to write source code files and tangle them out. I want to compile them using make. My problem now is that org-mode overwrites the old files every time I tangle them out, therefore also updating the time stamp - even if nothing has changed. Subsequently, when I run make, everything gets recompiled, not just the changed source code files as all time stamps have changed. Make really doesn't have the smarts to deal with builds that it doesn't fully control. In your case, the actual source aren't the tangled files, but really (parts of) an orgmode file. With a bit of clever organization it should be possible to employ git to keep track of the sources for make. In a nutshell, you'd check in the sources into a repository and only compile those that are different from the last commit. After the successful compile you autocommit the tangled files. Since you will probably don't need version control of the tangled files (although that might be useful for debugging of the tangling process itself), you could either amend each commit or just periodically chop the repository and do a garbage collect. Putting the smarts into orgmode to keep track of each tangle block looks complicated in the general case; while possible is a bit of a stretch IMHO. It would also produce false positives for a lot of cases that I'd consider useful (splitting or fusioning tangle blocks without changing the result). But the solution outlined above could be used if the content of each file to be tangled was always available in full in a buffer before writing to the tangled file. The buffer could just be dropped if the SHA1 of the file on disk and the buffer content is identical. Regards, Achim. -- +[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+ Wavetables for the Terratec KOMPLEXER: http://Synth.Stromeko.net/Downloads.html#KomplexerWaves
Re: [O] Problem compiling C++ in Org-mode
Just for the record, adding the following to my .emacs file seems to solve the problem I was having, where the C++ compiler was compiling a source block (written to a temporary file in /tmp/...) and was unable to find an include file in the current working directory: (setq org-babel-C++-compiler (concat g++ -std=c++0x -I (expand-file-name .) ) ) -- Mike From: Michael Hannon jm_han...@yahoo.com To: Olaf Meeuwissen olaf.meeuwis...@avasys.jp Cc: Org-Mode List emacs-orgmode@gnu.org Sent: Friday, November 18, 2011 12:39 AM Subject: Re: [O] Problem compiling C++ in Org-mode Olaf Meeuwissen wrote: Michael Hannon jm_han...@yahoo.com writes: Greetings. I'm having a problem compiling a C++ source-code block in Org-mode. The same C++ code compiles and runs in the shell. The issue seems to relate to local include files. [...snip...] What am I missing? /tmp/babel-245846_d/C-src-24584NIQ.cpp:7:26: fatal error: OtherStuff.cpp: No such file or directory compilation terminated. /bin/bash: /tmp/babel-245846_d/C-bin-24584aSW: Permission denied Compilation is taking place in a temporary directory, miles away from where your org file lives. ## Org-mode compile uses same option as shell compile: org-babel-C++-compiler is a variable defined in `ob-C.el'. Its value is g++ -std=c++0x The current directory is not specified in the include path. You would need to add a -I option to set the (absolute path to the) directory the org file is in. If you have all your org files in ~/org, you could try g++ -std=c++0x -I~/org. Thanks, Olaf. That does fix the problem, and in some sense that's the obvious solution. On the other hand, it does seem strange to me that the end user should have to specify the include directory. I.e., Emacs clearly knows the current directory (M-x pwd, for instance), and the C++ compiler knows to look in the current directory for include files enclosed in quote marks. I assumed that the compilation process in Org-mode would include steps similar to: + remember current directory + write contents of source block to obscure location in /tmp + compile source block in obscure location, but remembering the starting directory for such things as include files Obviously I was wrong, but it still seems a reasonable approach. -- Mike
Re: [O] Not overwriting unchanged source code files when tangling
Eric Schulte schulte.e...@gmail.com writes: I think the best approach in this case would be to tangle each file out to a temporary buffer, and then just before exiting the tangle function the content of these temporary buffers could be checked against the files on disk, and only those buffers which differ from disk would be written. See ob-tangle.el around line 240 for the relevant code. Unfortunately this would not be trivial, as currently content is written to the target files incrementally block by block. It would be wise to follow an age-old tradition and not clobber an existing file with before it is known that the process will finish without error. A temporary file is easily trashed when something goes wrong and the previous result still available. If all went well, the old file can be deleted (or renamed to a backup file) and the temporary file can be moved to where the old one was if the two SHA1 differ. If the code in the .org file is grouped by subtree it may be possible to place calls to org-narrow-to-subtree in the Makefile before tangling, so that only part of the file is tangled. I don't think that would work very well, see my other post. It is the content of the resulting file that needs to be compared, not the steps in which that result is produced. Finally, it may be easiest simply to play make's game as it were and break up the Org-mode file into multiple files. These multiple files could still be combined during export using #+INCLUDE lines from a single master Org-mode file. Well, I've been wondering about this for some time: can one make sort of an indirect buffer from the contents of multiple other buffers in Emacs? That would make such #+INCLUDEs much more seamless. Regards, Achim. -- +[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+ SD adaptation for Waldorf rackAttack V1.04R1: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
[O] LaTeX export: footnotes vs. angle brackets in Babel snippets
Hello, The LaTeX exporter of Org 7.7 from a recent Emacs snapshot improperly interprets sequences with angle brackets in Babel snippets as if they were footnote references, as in: #+BEGIN_src C int array[2]; #+END_src This leads to a wrong-type-arg error in ‘org-export-latex-preprocess’. It’s a regression compared to Org 7.5. Thanks, Ludo’.
Re: [O] Problem compiling C++ in Org-mode
A slightly cleaner solution would be the following. (add-to-list 'org-babel-default-header-args:C (cons :flags (concat -std=c++0x -I (expand-file-name . But either the above or below configuration will likely only work if the directory holding your .emacs is the same directory in which the included files are held. Best -- Eric Michael Hannon jm_han...@yahoo.com writes: Just for the record, adding the following to my .emacs file seems to solve the problem I was having, where the C++ compiler was compiling a source block (written to a temporary file in /tmp/...) and was unable to find an include file in the current working directory: (setq org-babel-C++-compiler (concat g++ -std=c++0x -I (expand-file-name .) ) ) -- Mike From: Michael Hannon jm_han...@yahoo.com To: Olaf Meeuwissen olaf.meeuwis...@avasys.jp Cc: Org-Mode List emacs-orgmode@gnu.org Sent: Friday, November 18, 2011 12:39 AM Subject: Re: [O] Problem compiling C++ in Org-mode Olaf Meeuwissen wrote: Michael Hannon jm_han...@yahoo.com writes: Greetings. I'm having a problem compiling a C++ source-code block in Org-mode. The same C++ code compiles and runs in the shell. The issue seems to relate to local include files. [...snip...] What am I missing? /tmp/babel-245846_d/C-src-24584NIQ.cpp:7:26: fatal error: OtherStuff.cpp: No such file or directory compilation terminated. /bin/bash: /tmp/babel-245846_d/C-bin-24584aSW: Permission denied Compilation is taking place in a temporary directory, miles away from where your org file lives. ## Org-mode compile uses same option as shell compile: org-babel-C++-compiler is a variable defined in `ob-C.el'. Its value is g++ -std=c++0x The current directory is not specified in the include path. You would need to add a -I option to set the (absolute path to the) directory the org file is in. If you have all your org files in ~/org, you could try g++ -std=c++0x -I~/org. Thanks, Olaf. That does fix the problem, and in some sense that's the obvious solution. On the other hand, it does seem strange to me that the end user should have to specify the include directory. I.e., Emacs clearly knows the current directory (M-x pwd, for instance), and the C++ compiler knows to look in the current directory for include files enclosed in quote marks. I assumed that the compilation process in Org-mode would include steps similar to: + remember current directory + write contents of source block to obscure location in /tmp + compile source block in obscure location, but remembering the starting directory for such things as include files Obviously I was wrong, but it still seems a reasonable approach. -- Mike -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Not overwriting unchanged source code files when tangling
Holger Hoefling hhoef...@gmail.com wrote: Hi Carsten, thanks for the suggestion, but as I agree with Brian. If there is more than one source file in the org-file, then the whole project would still be recompiled, not just the updated file. To be more exact, I actually don't want to compile things, but run R scripts using make. So the waiting time if a computationally intensive step is repeated although it is not necessary can be substantial. I wonder how difficult the following change would be (no emacs lisp experience, also do not know the org source code): - would it be possible to write out the source files when tangling - into a temporary directory, then compare to the actual target files - and overwrite only if something has changed? Then the time stamps - would stay fixed. Hopefully, this would not involve too much work: You've lost right there unless there is a method to select *which* source blocks to tangle. IOW, the problem is not the *comparison* of the temp and actual target files, it is the *production* of the temp files themselves: that's the computationally expensive step and this method does nothing to alleviate that. Unless I'm missing something. Nick - creating temporary files and remembering the mapping to true files - tangling out as usual into temporary files (so probably little - change there) - compare temporary file to true file (does emacs already have a diff - utility that could be used?) - overwrite true file if any changes - delete temporary files
Re: [O] Not overwriting unchanged source code files when tangling
Achim Gratz strom...@nexgo.de writes: Eric Schulte schulte.e...@gmail.com writes: I think the best approach in this case would be to tangle each file out to a temporary buffer, and then just before exiting the tangle function the content of these temporary buffers could be checked against the files on disk, and only those buffers which differ from disk would be written. See ob-tangle.el around line 240 for the relevant code. Unfortunately this would not be trivial, as currently content is written to the target files incrementally block by block. It would be wise to follow an age-old tradition and not clobber an existing file with before it is known that the process will finish without error. A temporary file is easily trashed when something goes wrong and the previous result still available. If all went well, the old file can be deleted (or renamed to a backup file) and the temporary file can be moved to where the old one was if the two SHA1 differ. Agreed, it would be preferable to build up the tangled contents in memory and not write to the file system until the tangling process is complete. Finally, it may be easiest simply to play make's game as it were and break up the Org-mode file into multiple files. These multiple files could still be combined during export using #+INCLUDE lines from a single master Org-mode file. Well, I've been wondering about this for some time: can one make sort of an indirect buffer from the contents of multiple other buffers in Emacs? That would make such #+INCLUDEs much more seamless. Hmm, this could be useful both inside and outside of Org-mode. Emacs does have indirect buffers [1], however they are exact copies of another buffer, I don't know if it would be possible to combine multiple indirect buffers into a single buffer. Thanks -- Eric Regards, Achim. Footnotes: [1] (info (elisp) Indirect Buffers) -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Problem compiling C++ in Org-mode
Hi Michael, Michael Hannon wrote: Just for the record, adding the following to my .emacs file seems to solve the problem I was having, where the C++ compiler was compiling a source block (written to a temporary file in /tmp/...) and was unable to find an include file in the current working directory: (setq org-babel-C++-compiler (concat g++ -std=c++0x -I (expand-file-name .) ) ) Your previous version contained -I~/ I don't know why you changed it, but this could eventually enlighten you: ┏[ from Cygwin's ML] ┃ If a word begins with an unquoted tilde character (`~'), all of the ┃ characters up to the first unquoted slash (or all characters, if there ┃ is no unquoted slash) are considered a TILDE-PREFIX. ┃ ┃ Note word begins. I've been bitten by this in a makefile: ┃ ┃ OPENSSL_DIR := ~/lib/openssl ┃ CPPFLAGS := -I$(OPENSSL_DIR) ┃ ┃ The gcc command line then contained -I~/lib/openssl, and the ~ was not ┃ expanded by the shell. ${HOME}/lib/openssl would have worked. ┗ Best regards, Seb -- Sebastien Vauban
Re: [O] Use prefix arg 0 to inhibit note taking for TODO change
Hi Carsten, You committed: Use prefix arg 0 to inhibit note taking for TODO change * lisp/org.el (org-todo): Interpret 0 prefix arg as note inhibitor. Sometimes I want to quickly make a few TODOs done in the agenda and I want to bypass the note taking I have normally set up. With this change, I can press `0 t d' in the agenda to do this. But isn't dangerous to use the `0' for that, as it is used, with other effects, as a speed command. I know that `0' does not work as of today in the agenda view, but I think speeds commands (I mean: one-letter shortcuts) should work in both places (that is, in the agenda, and in column 0 of Org headlines), and quite a lot already are shared (`I' for clocking, `t' for changing states, etc.). Wouldn't we want to try to make those two sets equal? Best regards, Seb PS- It's true that we can see inconsistencies, as of today, between some one-letter keys in the agenda and the speed commands. An example that comes to mind is: - `;' is used to set tags in *speed commands* - `:' is used to set tags in *agenda* (and `;' is used for starting the time) FYI, I'm willing to come up with a proposition of one-letter commands common to both the agenda and the speed commands, that is compare both sets, and propose changes where there are inconsistencies. Best regards, Seb -- Sebastien Vauban
Re: [O] Use prefix arg 0 to inhibit note taking for TODO change
On 18.11.2011, at 10:29, Sebastien Vauban wrote: Hi Carsten, You committed: Use prefix arg 0 to inhibit note taking for TODO change * lisp/org.el (org-todo): Interpret 0 prefix arg as note inhibitor. Sometimes I want to quickly make a few TODOs done in the agenda and I want to bypass the note taking I have normally set up. With this change, I can press `0 t d' in the agenda to do this. But isn't dangerous to use the `0' for that, as it is used, with other effects, as a speed command. As a speed command, you would use C-u 0 t d. In the agenda, numbers are special, they set the prefix argument. One could do the same in speed commands, of cause. I know that `0' does not work as of today in the agenda view, but I think speeds commands (I mean: one-letter shortcuts) should work in both places (that is, in the agenda, and in column 0 of Org headlines), and quite a lot already are shared (`I' for clocking, `t' for changing states, etc.). Wouldn't we want to try to make those two sets equal? Best regards, Seb PS- It's true that we can see inconsistencies, as of today, between some one-letter keys in the agenda and the speed commands. An example that comes to mind is: - `;' is used to set tags in *speed commands* - `:' is used to set tags in *agenda* (and `;' is used for starting the time) I think you are right here - it is not good that these are different. Numerical prefix commands are different a bit, but maybe you are even right there. - Carsten -- Sebastien Vauban
Re: [O] Export #+call: within example block
Eric Schulte schulte.e...@gmail.com writes: Thanks Eric - sorted my script. Best, Martyn Hi Martyn, Thanks for pointing out this bug. I've just pushed up a fix and a test case. Cheers -- Eric Martyn Jago martyn.j...@btinternet.com writes: Hi Is there a way to export the following, is this a bug, or is there a work-around (to HTML)? #+begin_example #+call: rubbish() #+end_example For instance this exports fine... #+begin_example #+begin_src emacs-lisp (some rubbish) #+end_src #+end_example Best, Martyn --- Org-mode version 7.7 (release_7.7.571.g0dc50.dirty) GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35) of 2011-08-21 on virtualmac.porkrind.org
Re: [O] Not overwriting unchanged source code files when tangling
Hi Eric, sounds like the problem may after all not be that simple.Could the code blocks be written incrementally to the buffer (or a temporary file on disk) and only after everything has been tangled out all temporary buffers or files checked against the ones on disk? Unfortunately, I do not think that breaking up the org-file into smaller org-files is a solution to my problem. I am running longer analyses (20 script files or more) each doing various things and files in parts depending on each other. If I break up the org-file into so many small parts, a large part of the advantage of using org (i.e. complete analysis in a single file with extensive documentation) will be lost. True, I can still include the subfiles during export - but i hardly ever export code blocks at all (I instead hide the code from export and produce a beamer presentation or latex article using the output from my earlier code). So overall, I would really like to keep everything together in one file. Someone else earlier suggested just tangling out to a temporary directory myself and synching in the makefile. This suggestion is close to what I would like to do and I may use it. However, it is still not quite satisfactory as this brings other problems. Source files sometimes call each other - when they are in a different directory after tangling than they are during the make file execution (due to synching), then either execution from within org may break, or the execution from the make file. If I knew more about e-lisp, I would just hack up a solution myself. I think org-mode is a really awesome tool. Thanks for your help and suggestions Holger On Fri, Nov 18, 2011 at 8:42 PM, Eric Schulte schulte.e...@gmail.comwrote: Brian Wightman br...@wightmanfam.org writes: On Fri, Nov 18, 2011 at 11:02 AM, Carsten Dominik carsten.domi...@gmail.com wrote: How about changing the make file so that the dependence is on the Org file, not on the source file? You could then arrange for make to call emacs in batch-mode to tangle the source file and then compile it? The original question was trying to avoid recompiling everything generated from a tangle if the content didn't actually change. Because retangling the source rewrites /all/ of the files, and resets the dates, even if nothing has changed, make will then rebuild everything that was tangled, not just the partial set of tangled files that actually changed. I think the best approach in this case would be to tangle each file out to a temporary buffer, and then just before exiting the tangle function the content of these temporary buffers could be checked against the files on disk, and only those buffers which differ from disk would be written. See ob-tangle.el around line 240 for the relevant code. Unfortunately this would not be trivial, as currently content is written to the target files incrementally block by block. If the code in the .org file is grouped by subtree it may be possible to place calls to org-narrow-to-subtree in the Makefile before tangling, so that only part of the file is tangled. Finally, it may be easiest simply to play make's game as it were and break up the Org-mode file into multiple files. These multiple files could still be combined during export using #+INCLUDE lines from a single master Org-mode file. Best -- Eric Brian -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Not overwriting unchanged source code files when tangling
Hi Nick, I think you misunderstood me there - I am actually not worried about how computationally intensive the tangling process is. This always works very quickly, so even if they have to be copied around and take a bit longer, I would not mind. Thanks Holger On Fri, Nov 18, 2011 at 8:32 PM, Nick Dokos nicholas.do...@hp.com wrote: Holger Hoefling hhoef...@gmail.com wrote: Hi Carsten, thanks for the suggestion, but as I agree with Brian. If there is more than one source file in the org-file, then the whole project would still be recompiled, not just the updated file. To be more exact, I actually don't want to compile things, but run R scripts using make. So the waiting time if a computationally intensive step is repeated although it is not necessary can be substantial. I wonder how difficult the following change would be (no emacs lisp experience, also do not know the org source code): - would it be possible to write out the source files when tangling - into a temporary directory, then compare to the actual target files - and overwrite only if something has changed? Then the time stamps - would stay fixed. Hopefully, this would not involve too much work: You've lost right there unless there is a method to select *which* source blocks to tangle. IOW, the problem is not the *comparison* of the temp and actual target files, it is the *production* of the temp files themselves: that's the computationally expensive step and this method does nothing to alleviate that. Unless I'm missing something. Nick - creating temporary files and remembering the mapping to true files - tangling out as usual into temporary files (so probably little - change there) - compare temporary file to true file (does emacs already have a diff - utility that could be used?) - overwrite true file if any changes - delete temporary files
Re: [O] Not overwriting unchanged source code files when tangling
Holger Hoefling hhoef...@gmail.com wrote: I think you misunderstood me there - I am actually not worried about how computationally intensive the tangling process is. This always works very quickly, so even if they have to be copied around and take a bit longer, I would not mind. Ah, ok - so you are talking about tanglecompile org --- bunch of files - output The tangling step produces a bunch of files that are (re)compiled (or in any case require some sort of lengthy processing) to produce some output file. IMO, the best way to deal with it is still make: let's say foo.org a.x b.x c.x -- foo.out where the first arrow is the tangle and the second arrow is some processor, call it X. The standard way to set up a makefile is schematically: --8---cut here---start-8--- foo.out: a.x b.x c.x X a.x b.c c.x -o foo.out a.x b.x c.x: foo.org tangle foo.org --8---cut here---end---8--- Rewrite the make file as follows: --8---cut here---start-8--- foo.out: a.y b.y c.y X a.y b.y c.y -o foo.out a.y: a.x cmp --silent a.x a.y || cp a.x a.y b.y: b.x cmp --silent b.x b.y || cp b.x b.y c.y: c.x cmp --silent c.x c.y || cp c.x c.y a.x b.x c.x: foo.org tangle foo.org --8---cut here---end---8--- So if the *contents* of (say) a.x have not changed by the tangling, it compares equal to a.y and the copy is skipped. That leaves a.y untouched. OTOH, if the contents of a.x change (or a.y does not exist in the first place), the comparison fails and we copy a.x to a.y. That updates a.y and forces further updates on anything that depends on it. Using some make fu (works for GNU make, but not necessarily for other makes), you can write it more compactly: --8---cut here---start-8--- foo.out: a.y b.y c.y X a.y b.y c.y -o foo.out %.y: %.x -cmp --silent $ $@ || cp $ $@ a.x b.x c.x: foo.org tangle foo.org --8---cut here---end---8--- HTH, Nick
Re: [O] Problem compiling C++ in Org-mode
From: Sebastien Vauban wxhgmqzgw...@spammotel.com Just for the record, adding the following to my .emacs file seems to solve the problem I was having, where the C++ compiler was compiling a source block (written to a temporary file in /tmp/...) and was unable to find an include file in the current working directory: (setq org-babel-C++-compiler (concat g++ -std=c++0x -I (expand-file-name .) ) ) Your previous version contained -I~/ I don't know why you changed it, but this could eventually enlighten you: ┏[ from Cygwin's ML] ┃ If a word begins with an unquoted tilde character (`~'), all of the ┃ characters up to the first unquoted slash (or all characters, if there ┃ is no unquoted slash) are considered a TILDE-PREFIX. ┃ ┃ Note word begins. I've been bitten by this in a makefile: ┃ ┃ OPENSSL_DIR := ~/lib/openssl ┃ CPPFLAGS := -I$(OPENSSL_DIR) ┃ ┃ The gcc command line then contained -I~/lib/openssl, and the ~ was not ┃ expanded by the shell. ${HOME}/lib/openssl would have worked. ┗ Hi, Seb. Thanks for the heads-up. The version that I have now seems to work, but, just FYI, the explanation for the change of syntax is explained in the little dialogue that I had with myself: Hmm, to get this thing to compile, I have to tack on some -I... stuff to my g++ command. This is tedious. How can I do this automatically? I'll bet I know: there must be some way to concatenate strings in Emacs lisp. (Google search for some terms vaguely related to Emacs lisp concatenate.) (Look at one of the Google hits and stumble across an example that turns out to use expand-file.) What do you suppose expand-file does? (Try it.) Cool! (Break from problem-solving loop) -- Mike
Re: [O] Not overwriting unchanged source code files when tangling
Hey Nick, thank you very much. That sounds like a very good solution to my problem that does not require changes to org-mode. Best Holger On Sat, Nov 19, 2011 at 5:00 AM, Nick Dokos nicholas.do...@hp.com wrote: Holger Hoefling hhoef...@gmail.com wrote: I think you misunderstood me there - I am actually not worried about how computationally intensive the tangling process is. This always works very quickly, so even if they have to be copied around and take a bit longer, I would not mind. Ah, ok - so you are talking about tanglecompile org --- bunch of files - output The tangling step produces a bunch of files that are (re)compiled (or in any case require some sort of lengthy processing) to produce some output file. IMO, the best way to deal with it is still make: let's say foo.org a.x b.x c.x -- foo.out where the first arrow is the tangle and the second arrow is some processor, call it X. The standard way to set up a makefile is schematically: --8---cut here---start-8--- foo.out: a.x b.x c.x X a.x b.c c.x -o foo.out a.x b.x c.x: foo.org tangle foo.org --8---cut here---end---8--- Rewrite the make file as follows: --8---cut here---start-8--- foo.out: a.y b.y c.y X a.y b.y c.y -o foo.out a.y: a.x cmp --silent a.x a.y || cp a.x a.y b.y: b.x cmp --silent b.x b.y || cp b.x b.y c.y: c.x cmp --silent c.x c.y || cp c.x c.y a.x b.x c.x: foo.org tangle foo.org --8---cut here---end---8--- So if the *contents* of (say) a.x have not changed by the tangling, it compares equal to a.y and the copy is skipped. That leaves a.y untouched. OTOH, if the contents of a.x change (or a.y does not exist in the first place), the comparison fails and we copy a.x to a.y. That updates a.y and forces further updates on anything that depends on it. Using some make fu (works for GNU make, but not necessarily for other makes), you can write it more compactly: --8---cut here---start-8--- foo.out: a.y b.y c.y X a.y b.y c.y -o foo.out %.y: %.x -cmp --silent $ $@ || cp $ $@ a.x b.x c.x: foo.org tangle foo.org --8---cut here---end---8--- HTH, Nick