Re: [O] unexpected failure on all formulas
Jude DaShiell jdash...@shellworld.net wrote: |+--+---+---| | mode | | | | | Min| | | | | Max| 127. | 81. | 74. | #+TBLFM: @$2..@$4=vmode(@i..@ii) :: @$2..@$4=vmin(@i..@ii) :: @$2..@$4=vmax(@i..@ii) # Local Variables: # kept-new-versions: 100 # version-control: t # End: cut here. What did I do wrong with this #+TBLFM: line? Two things: o as Christian Moe pointed out, calc does not provide a vmode() function. o the separator lines in the formulas have to be specified using capital I letters. Nick
Re: [O] Time estimates time format?
Johan Ekh ekh.jo...@gmail.com writes: But I'd like to make estimates in days, weeks or even months. You can certainly do that. Have a look at org-effort-durations. You could for example define the effort as '2d', '4w' or '7m'. And have spent time displayed in percentage of the estimate. Is this possible? You might be able to do something along this line. Have a look at the doc string of org-properties-postprocess-alist where it gives you an example on how to calculate the remaining time (clocked vs estimated). HTH -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland
Re: [O] [babel] Trying to add ERT test cases
Hi Eric, Eric Schulte wrote: * Test #+begin_src emacs-lisp (ert-deftest ob-tangle/speed-command-r () Test that speed command `r' does demote the headline. (org-test-at-id 4ee368b8-cf7c-4269-98c0-b28dcf94ff2b (goto-char (point-at-bol)) (org-self-insert-command ?r) (goto-char (point-at-bol)) (should (looking-at \\*\\* Speed command)) (delete-char 1))) #+end_src When running the test _once_, I get my level-1 headline preceded by 114 occurrences of ^M (yes, 114 for 1 test run!): ^M^M^M...^M^M^M* Speed command (this must be at level-1 headline) and no demotion of my headline. Do you understand such? So it looks like these self-insert-command functions are special cases. They don't look to their arguments to see what key-press invoked them, but rather they call the `this-command-keys' function for this purpose. We can force the behavior we want by overriding the definition of this function locally, taking this approach the following test case worked for me #+begin_src emacs-lisp (ert-deftest ob-tangle/speed-command-r () Test that speed command `r' does demote the headline. (org-test-with-temp-text * Speed command (flet ((this-command-keys () r)) (org-self-insert-command ?r)) (goto-char (point-min)) (should (looking-at \\*\\* Speed command #+end_src It passes! So does: #+begin_src emacs-lisp (ert-deftest ob-tangle/speed-command-r () Test that speed command `r' does demote the headline. (org-test-with-temp-text * Speed command (flet ((this-command-keys () r)) (org-self-insert-command ?a)) (goto-char (point-min)) (should (looking-at \\*\\* Speed command #+end_src where the argument of `org-self-insert-command' is `a' (could be anything, it seems). Very weird. I just understood as well why I got 114 ^M: 114 is the ASCII code for `r', and `\r' is as well ^M -- though `r' is not... [...] I read thru the page you link to. Just a minor thing: link to See ert-publish-test.el for the implementation is broken. Do you have a solution for checking against internal broken links? Nothing comes immediately to mind. I still have my idea of letting DOT draw an graph of the interconnection between pages, so that we see missing pages, and unreachable ones (files on the file system, but never linked). I should (find the time to) extend it enough to serve that purpose. This could be useful, like a site map for worg. As an intermediate step I could see it being useful to simply print out all internal links whose target does not exist on the file system. I'll try to come up with something (in Babel) soon. Best regards, Seb -- Sebastien Vauban
Re: [O] Time estimates time format?
Thank you, I've changed to #+PROPERTY: Effort_ALL 2d 1w 2w 3w 4w 2m #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM but there is no mapping between days, weeks, months and hours. For example, '2d' + '1w' is summed as '3:00'. How can I change this? The best for me would be to have the summed effort in weeks. Best regards, Johan On Tue, Sep 20, 2011 at 8:57 AM, Christian Egli christian.e...@sbs.chwrote: Johan Ekh ekh.jo...@gmail.com writes: But I'd like to make estimates in days, weeks or even months. You can certainly do that. Have a look at org-effort-durations. You could for example define the effort as '2d', '4w' or '7m'. And have spent time displayed in percentage of the estimate. Is this possible? You might be able to do something along this line. Have a look at the doc string of org-properties-postprocess-alist where it gives you an example on how to calculate the remaining time (clocked vs estimated). HTH -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland
[O] [PATCH] Modifications to enable test script to run with emacs-23 and emacs-22
Hi With this patch, the command-line test script now passes all tests on Emacs 24, 23 and 22. On 23 and 22, testing directory should include ert.el and ert-x.el Best, Martyn From 6ab323b099f55462f690d44f6ad482c962461a97 Mon Sep 17 00:00:00 2001 From: Martyn Jago martyn.j...@btinternet.com Date: Tue, 20 Sep 2011 08:44:24 +0100 Subject: [PATCH] Modifications to enable test script to run with emacs-23 and emacs-22 * testing/org-test.el: enable test script to run with emacs-23 and emacs-22 * testing/lisp/test-org-exp.el: added org-ascii requirement --- testing/lisp/test-org-exp.el | 15 +++-- testing/org-test.el | 112 + 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/testing/lisp/test-org-exp.el b/testing/lisp/test-org-exp.el index 348538f..0ed8d68 100644 --- a/testing/lisp/test-org-exp.el +++ b/testing/lisp/test-org-exp.el @@ -7,11 +7,12 @@ ;; see: http://www.gnu.org/licenses/gpl-3.0.html (let ((load-path (cons (expand-file-name - .. (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) +.. (file-name-directory + (or load-file-name buffer-file-name))) + load-path))) (require 'org-test) - (require 'org-test-ob-consts)) + (require 'org-test-ob-consts) + (require 'org-ascii)) (ert-deftest test-org-exp/stripping-commas () Test the stripping of commas from within blocks during export. @@ -19,5 +20,7 @@ ;; don't strip internal commas (org-narrow-to-subtree) (should (string-match - , 2 - (org-export-as-ascii nil nil nil 'string) + , 2 + (org-export-as-ascii nil nil nil 'string) + +(provide 'test-org-exp) diff --git a/testing/org-test.el b/testing/org-test.el index 7789cbe..9b4313f 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -30,17 +30,20 @@ Code: -(let ((org-test-dir (expand-file-name +(let* ((org-test-dir (expand-file-name (file-name-directory - (or load-file-name buffer-file-name) - (let ((org-lisp-dir (expand-file-name - (concat org-test-dir ../lisp - (unless (featurep 'org) - (setq load-path (cons org-lisp-dir load-path)) - (org-babel-do-load-languages - 'org-babel-load-languages '((sh . t) - (let* ((load-path (cons - (expand-file-name ert org-test-dir) + (or load-file-name buffer-file-name + (org-lisp-dir (expand-file-name + (concat org-test-dir ../lisp + + (unless (featurep 'org) +(setq load-path (cons org-lisp-dir load-path)) +(require 'org) +(org-babel-do-load-languages + 'org-babel-load-languages '((sh . t + + (let* ((load-path (cons + org-test-dir (cons (expand-file-name jump org-test-dir) load-path @@ -69,8 +72,7 @@ (when (file-exists-p (expand-file-name jump/jump.el org-test-dir)) (require 'jump) - (require 'which-func)) -(require 'org))) + (require 'which-func (defconst org-test-default-test-file-name tests.el For each defun a separate file with tests may be defined. @@ -181,49 +183,49 @@ then remove it and place the point there before running BODY. ;;; Navigation Functions (when (featurep 'jump) -(defjump org-test-jump - ((lisp/\\1.el . testing/lisp/test-\\1.el) - (lisp/\\1.el . testing/lisp/\\1.el/test.*.el) - (contrib/lisp/\\1.el . testing/contrib/lisp/test-\\1.el) - (contrib/lisp/\\1.el . testing/contrib/lisp/\\1.el/test.*.el) - (testing/lisp/test-\\1.el . lisp/\\1.el) - (testing/lisp/\\1.el . lisp/\\1.el/test.*.el) - (testing/contrib/lisp/test-\\1.el . contrib/lisp/\\1.el) - (testing/contrib/lisp/test-\\1.el . contrib/lisp/\\1.el/test.*.el)) - (concat org-base-dir /) - Jump between org-mode files and their tests. - (lambda (path) -(let* ((full-path (expand-file-name path org-base-dir)) - (file-name (file-name-nondirectory path)) - (name (file-name-sans-extension file-name))) - (find-file full-path) - (insert - ;;; file-name \n\n - ;; Copyright (c) (nth 5 (decode-time (current-time))) - user-full-name \n - ;; Authors: user-full-name \n\n - ;; Released under the GNU General Public License version 3\n - ;; see: http://www.gnu.org/licenses/gpl-3.0.html\n\n; - Comments:\n\n - ;; Template test file for Org-mode tests\n\n - \n - ;;; Code:\n - (let ((load-path (cons (expand-file-name\n - \..\ (file-name-directory\n - (or load-file-name buffer-file-name)))\n - load-path)))\n - (require 'org-test)\n - (require 'org-test-ob-consts))\n\n - \n - ;;; Tests\n - (ert-deftest name /example-test ()\n - \Just an example to get you started.\\n - (should t)\n - (should-not nil)\n - (should-error (error
Re: [O] [babel] Trying to add ERT test cases
Hi Eric Eric Schulte schulte.e...@gmail.com writes: Martyn Jago martyn.j...@btinternet.com writes: [...] (ert-deftest ob-tangle/speed-command-r () (let ((org-use-speed-commands t)) (with-temp-buffer (org-mode) (insert * Speed command) (goto-char (point-at-bol)) ;; ensure default speed commands return t (should (org-speed-command-default-hook r)) (should (org-speed-command-default-hook n)) ;; ensure non-default speed commands return nil (should-not (org-speed-command-default-hook z)) ;; ensure default speed commands return nil if not at bol (forward-char) (should-not (org-speed-command-default-hook r)) ;; ensure org-metaright promotes heading (goto-char (point-at-bol)) (org-metaright 1) (goto-char (point-at-bol)) (should (equal ** Speed command (buffer-string))) ;; ensure org-metaleft demotes heading (org-metaleft 1) (should (equal * Speed command (buffer-string)) As a minor note, I just added a simple convenience macro named `org-test-with-temp-text' [1] which should somewhat simplify the process of using temporary Org-mode buffers with initial text. Using this the above becomes #+begin_src emacs-lisp (ert-deftest ob-tangle/speed-command-r () (let ((org-use-speed-commands t)) (org-test-with-temp-text * Speed command ;; ensure default speed commands return t (should (org-speed-command-default-hook r)) (should (org-speed-command-default-hook n)) ;; ensure non-default speed commands return nil (should-not (org-speed-command-default-hook z)) ;; ensure default speed commands return nil if not at bol (forward-char) (should-not (org-speed-command-default-hook r)) ;; ensure org-metaright promotes heading (goto-char (point-at-bol)) (org-metaright 1) (goto-char (point-at-bol)) (should (equal ** Speed command (buffer-string))) ;; ensure org-metaleft demotes heading (org-metaleft 1) (should (equal * Speed command (buffer-string)) #+end_src Cheers -- Eric Footnotes: [1] , | org-test-with-temp-text is a Lisp macro in `org-test.el'. | | (org-test-with-temp-text TEXT rest BODY) | | Run body in a temporary buffer with Org-mode as the active | mode holding TEXT. If the string point appears in TEXT | then remove it and place the point there before running BODY. ` This looks useful, however I hit problems when refactoring my tests to use it. Would it be easy for your macro to accept string variables in addition to strings? Regards Martyn
Re: [O] unexpected failure on all formulas
Nick Dokos nicholas.do...@hp.com wrote: Jude DaShiell jdash...@shellworld.net wrote: |+--+---+---| | mode | | | | | Min| | | | | Max| 127. | 81. | 74. | #+TBLFM: @$2..@$4=vmode(@i..@ii) :: @$2..@$4=vmin(@i..@ii) :: @$2..@$4=vmax(@i..@ii) # Local Variables: # kept-new-versions: 100 # version-control: t # End: cut here. What did I do wrong with this #+TBLFM: line? Two things: o as Christian Moe pointed out, calc does not provide a vmode() function. o the separator lines in the formulas have to be specified using capital I letters. Here is an implementation of vmode - afaict, it works correctly but that may be because I've only tested it on a single set of data. If you find something wrong, please let me know. --8---cut here---start-8--- | Date Stamp | Systolic | Diastolic | Pulse | |+--+---+---| | [2011-07-19 Tue 02:26] | 138 |92 |74 | | [2011-07-20 Wed 04:03] | 130 |85 |74 | | [2011-07-21 Thu 03:50] | 128 |79 |76 | | [2011-07-22 Fri 02:33] | 121 |80 |79 | | [2011-07-23 Sat 02:52] | 118 |75 |68 | | [2011-07-24 Sun 04:13] | 126 |83 |78 | | [2011-07-25 Mon 02:12] | 122 |79 |76 | | [2011-07-26 Tue 01:57] | 124 |79 |72 | | [2011-07-27 Wed 04:03] | 137 |74 |76 | | [2011-07-28 Thu 03:47] | 136 |80 |76 | | [2011-07-29 Fri 04:06] | 120 |72 |76 | | [2011-07-30 Sat 03:18] | 128 |92 |80 | | [2011-07-31 Sun 07:11] | 124 |84 |72 | | [2011-08-01 Mon 04:55] | 124 |77 |69 | | [2011-08-02 Tue 02:47] | 128 |80 |67 | | [2011-08-03 Wed 06:00] | 132 |89 |70 | | [2011-08-04 Thu 04:30] | 137 |82 |77 | | [2011-08-05 Fri 06:10] | 124 |86 |77 | | [2011-08-06 Sat 04:04] | 139 |88 |78 | | [2011-08-07 Sun 04:02] | 124 |80 |68 | | [2011-08-08 Mon 06:36] | 137 |93 |79 | | [2011-08-10 Wed04:03] | 120 |80 |68 | | [2011-08-11 Thu 04:30] | 128 |78 |77 | | [2011-08-12 Fri 06:36] | 143 |82 |76 | | [2011-08-13 Sat 06:18] | 125 |76 |69 | | [2011-08-14 Sun 04:04] | 123 |70 |69 | | [2011-08-15 Mon 04:04] | 135 |83 |76 | | [2011-08-16 Tue 04:03] | 128 |80 |69 | | [2011-08-17 Wed 04:04] | 124 |80 |68 | | [2011-08-18 Thu 05:58] | 136 |87 |72 | | [2011-08-19 Fri 05:50] | 116 |80 |64 | | [2011-08-20 Sat 06:38] | 139 |84 |64 | | [2011-08-21 Sun 08:20] | 124 |84 |73 | | [2011-08-22 Mon 03:50] | 138 |76 |70 | | [2011-08-23 Tue 05:52] | 126 |79 |68 | | [2011-08-24 Wed 04:53] | 125 |81 |64 | | [2011-08-25 Thu 05:37] | 124 |79 |68 | | [2011-08-26 Fri 06:41] | 124 |87 |74 | | [2011-08-27 Sat 05:44] | 133 |74 |61 | | [2011-08-28 Sun 03:22] | 124 |76 |61 | | [2011-08-29 Mon 04:06] | 124 |76 |65 | | [2011-08-30 Tue 05:52] | 139 |87 |71 | | [2011-08-31 Wed 06:47] | 152 |86 |68 | | [2011-09-01 Thu 06:00] | 136 |86 |78 | | [2011-09-02 Fri 01:22] | 142 | 100 |78 | | [2011-09-03 Sat 09:12] | 126 |79 |70 | | [2011-09-04 Sun 11:53] | 130 |90 |72 | | [2011-09-05 Mon 06:29] | 138 |77 |65 | | [2011-09-06 Tue 05:42] | 121 |76 |68 | | [2011-09-07 Wed 06:47] | 131 |77 |68 | | [2011-09-08 Thu 06:02] | 122 |76 |72 | | [2011-09-10 Sat 05:38] | 126 |76 |69 | | [2011-09-11 Sun 10:12] | 137 |87 |64 | | [2011-09-12 Mon 04:00] | 135 |78 |89 | | [2011-09-13 Tue 06:00] | 132 |82 |66 | | [2011-09-14 Wed 06:01] | 137 |77 |77 | | [2011-09-15 Thu 04:08] | 141 |87 |64 | | [2011-09-17 Sat 08:35] | 121 |78 |66 | | [2011-09-18 Sun 07:04] | 124 |69 |65 | | [2011-09-19 Mon 06:00] | 133 |81 |69 | |+--+---+---| | mode | 125 |81 |69 | | min| 116 |69 |61 | | max| 152 | 100 |89 | #+TBLFM: @$2..@$4=vmode(@I..@II) :: @$2..@$4=vmin(@I..@II) :: @$2..@$4=vmax(@I..@II) #+begin_src elisp (defun calcFunc-vmode (rest vecs) (let* ((flat (copy-sequence
[O] Multiple capture within one buffer?
Hello, I'm trying out org mode capture now. It's great. However, what if I want to capture multiple items? Do I have to C-c C-c and restart the capture many times? Hope there's a quicker way. Thank you. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 pgpdvcKz41CEx.pgp Description: PGP signature
Re: [O] unexpected failure on all formulas
Nick Dokos wrote: [...] I cribbed heavily from the implementation of vmedian. Although there is no key binding, you can even use the above in an interactive Calc session, by entering the formula in algebraic form. I yanked the vector twice onto the Calc stack and then entered 'vmode($) with the following result: This does the wrong thing for bimodal lists of numbers, since the correct answer in that case is the list of modes. Here's an elisp implementation that's a bit shorter: (require 'cl) (defun mode (rest list) (let ((ret nil) val count) (loop for n in list if (assq n ret) do (incf (cdr (assq n ret))) else do (push (cons n 1) ret)) (setq ret (sort ret (lambda (a b) ( (cdr a) (cdr b) (setq val (list (caar ret)) count (cdar ret)) (loop for (n . c) in (cdr ret) while (= c count) do (push n val)) val)) And here's how to use it in the proffered table: | Date Stamp | Systalic | Diastalic | Pulse | |+--+---+---| | [2011-07-19 Tue 02:26] | 138 |92 |74 | | [2011-07-20 Wed 04:03] | 130 |85 |74 | |+--+---+---| | min| 130 |85 |74 | | max| 138 |92 |74 | | mode | 138, 130 |92, 85 |74 | #+TBLFM: @II+1$2..@II+1$4=vmin(@I..@II)::@II+2$2..@II+2$4=vmax(@I..@II)::@II+3$2..@II+3$4='(mapconcat 'number-to-string (mode @I..@II) , );N Lawrence -- Lawrence Mitchell we...@gmx.li
Re: [O] unexpected failure on all formulas
Hi, Nick, I think your vmode() needs to subtract one from the result. The mode in the systolic column of Jude's dataset should be 124 (f=12), not 125 (f=2). For Jude's limited purposes I got by with less code (but note the caveats): #+begin_src emacs-lisp (defmath vmode (vec) Returns the mode (most frequent value) of a unimodal vector of integers VEC. WARNING: Will not work with non-integer values or multiple vectors. Will only return the lowest mode for multimodal data. (let ((freq (histogram vec (1+ (vmax vec) (1- (find freq (vmax freq) #+end_src Using :=vmode(@I..@II), I get 124 (systolic), 80 (diastolic), 68 (pulse). Yours, Christian On 9/20/11 10:26 AM, Nick Dokos wrote: Nick Dokosnicholas.do...@hp.com wrote: Jude DaShielljdash...@shellworld.net wrote: |+--+---+---| | mode | | | | | Min| | | | | Max| 127. | 81. | 74. | #+TBLFM: @$2..@$4=vmode(@i..@ii) :: @$2..@$4=vmin(@i..@ii) :: @$2..@$4=vmax(@i..@ii) # Local Variables: # kept-new-versions: 100 # version-control: t # End: cut here. What did I do wrong with this #+TBLFM: line? Two things: o as Christian Moe pointed out, calc does not provide a vmode() function. o the separator lines in the formulas have to be specified using capital I letters. Here is an implementation of vmode - afaict, it works correctly but that may be because I've only tested it on a single set of data. If you find something wrong, please let me know. --8---cut here---start-8--- | Date Stamp | Systolic | Diastolic | Pulse | |+--+---+---| | [2011-07-19 Tue 02:26] | 138 |92 |74 | | [2011-07-20 Wed 04:03] | 130 |85 |74 | | [2011-07-21 Thu 03:50] | 128 |79 |76 | | [2011-07-22 Fri 02:33] | 121 |80 |79 | | [2011-07-23 Sat 02:52] | 118 |75 |68 | | [2011-07-24 Sun 04:13] | 126 |83 |78 | | [2011-07-25 Mon 02:12] | 122 |79 |76 | | [2011-07-26 Tue 01:57] | 124 |79 |72 | | [2011-07-27 Wed 04:03] | 137 |74 |76 | | [2011-07-28 Thu 03:47] | 136 |80 |76 | | [2011-07-29 Fri 04:06] | 120 |72 |76 | | [2011-07-30 Sat 03:18] | 128 |92 |80 | | [2011-07-31 Sun 07:11] | 124 |84 |72 | | [2011-08-01 Mon 04:55] | 124 |77 |69 | | [2011-08-02 Tue 02:47] | 128 |80 |67 | | [2011-08-03 Wed 06:00] | 132 |89 |70 | | [2011-08-04 Thu 04:30] | 137 |82 |77 | | [2011-08-05 Fri 06:10] | 124 |86 |77 | | [2011-08-06 Sat 04:04] | 139 |88 |78 | | [2011-08-07 Sun 04:02] | 124 |80 |68 | | [2011-08-08 Mon 06:36] | 137 |93 |79 | | [2011-08-10 Wed04:03] | 120 |80 |68 | | [2011-08-11 Thu 04:30] | 128 |78 |77 | | [2011-08-12 Fri 06:36] | 143 |82 |76 | | [2011-08-13 Sat 06:18] | 125 |76 |69 | | [2011-08-14 Sun 04:04] | 123 |70 |69 | | [2011-08-15 Mon 04:04] | 135 |83 |76 | | [2011-08-16 Tue 04:03] | 128 |80 |69 | | [2011-08-17 Wed 04:04] | 124 |80 |68 | | [2011-08-18 Thu 05:58] | 136 |87 |72 | | [2011-08-19 Fri 05:50] | 116 |80 |64 | | [2011-08-20 Sat 06:38] | 139 |84 |64 | | [2011-08-21 Sun 08:20] | 124 |84 |73 | | [2011-08-22 Mon 03:50] | 138 |76 |70 | | [2011-08-23 Tue 05:52] | 126 |79 |68 | | [2011-08-24 Wed 04:53] | 125 |81 |64 | | [2011-08-25 Thu 05:37] | 124 |79 |68 | | [2011-08-26 Fri 06:41] | 124 |87 |74 | | [2011-08-27 Sat 05:44] | 133 |74 |61 | | [2011-08-28 Sun 03:22] | 124 |76 |61 | | [2011-08-29 Mon 04:06] | 124 |76 |65 | | [2011-08-30 Tue 05:52] | 139 |87 |71 | | [2011-08-31 Wed 06:47] | 152 |86 |68 | | [2011-09-01 Thu 06:00] | 136 |86 |78 | | [2011-09-02 Fri 01:22] | 142 | 100 |78 | | [2011-09-03 Sat 09:12] | 126 |79 |70 | | [2011-09-04 Sun 11:53] | 130 |90 |72 | | [2011-09-05 Mon 06:29] | 138 |77 |65 | | [2011-09-06 Tue 05:42] | 121 |76 |68 | | [2011-09-07 Wed 06:47] | 131 |77 |68 | | [2011-09-08 Thu 06:02] | 122 |76 |72 | | [2011-09-10 Sat 05:38] | 126 |76 |69 | | [2011-09-11 Sun 10:12] | 137 |87 |64 | | [2011-09-12 Mon 04:00] | 135 |78 |89 | | [2011-09-13 Tue 06:00] | 132 |82 |
Re: [O] Time estimates time format?
Johan Ekh ekh.jo...@gmail.com writes: Thank you, I've changed to #+PROPERTY: Effort_ALL 2d 1w 2w 3w 4w 2m #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM but there is no mapping between days, weeks, months and hours. For example, '2d' + '1w' is summed as '3:00'. How can I change this? Ah, according to http://orgmode.org/org.html#Column-attributes the {:} sums the times and treats the times as HH:MM, plain numbers are hours. I guess this is a bug? You can define efforts in terms of weeks, etc. Some parts of org-mode respect it but column view apparently not. Sorry. Patches or even just proper bug reports are welcome. Thanks -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland - Viel Neues fuer Hoerspiel-Fans: Eine aktuelle Uebersicht des Angebots bei der SBS finden Sie unter http://www.sbs.ch/hoerspiele .
Re: [O] how export highlight code
Jambunathan K kjambunat...@gmail.com writes: And I have not changed any option related to org-babel or the exporting function. So how can I make the syntax highlighting work for exporting to html? Add contrib/lisp to load path and do a (require 'htmlize) thank you,i have done it. org-mode is nice. -- a machine of awareness Debian、Emacs+Gnus
[O] minor html validator error for a orgmode.org page
According to http://validator.w3.org/check?uri=http%3a%2f%2forgmode%2eorg%2fChanges%2ehtml there is one minor HTML validation error for http://orgmode.org/Changes.html The error is: Line 97, Column 87: required attribute alt not specified Best, Jesse -- Jesse Alama http://centria.di.fct.unl.pt/~alama/
[O] org-velocity load problem
Hi all, This post just to warn that org-velocity is not loaded with Emacs 22.3.1. I try to load org-velocity but I have the following message : error: Unknown keyword :safe I use GNU Emacs 22.3.1 (i386-mingw-nt6.1.7601) and Org-mode version 7.7. I had the possibility to try with emacs 23.3 with the same org-mode version and it is loaded correctly. After investigation, it seems related to custom.el file. Indeed the keyword is defined in the later version of emacs.
Re: [O] unexpected failure on all formulas
Christian Moe m...@christianmoe.com wrote: I think your vmode() needs to subtract one from the result. The mode in the systolic column of Jude's dataset should be 124 (f=12), not 125 (f=2). Yes, this is an off-by-one error: in vfreqs, I should cons prev onto freqs, not (nth 0 vec). In addition to this and the multimodal problem that both you and Lawrence Mitchell pointed out, there is another off-by-one error when vfreqs gets to the end of the list. All in all, a disaster: can a posting be deleted? or at least marked with a big, red X so that it won't mislead in the future? I'll try to post a corrected version later on. OTOH, my main interest in this was the hooking up of a user function onto calc and the example, though deeply flawed, does illustrate that. Thanks to both Christian and Lawrence for the whacks in the head (although now I have a headache...) Nick For Jude's limited purposes I got by with less code (but note the caveats): #+begin_src emacs-lisp (defmath vmode (vec) Returns the mode (most frequent value) of a unimodal vector of integers VEC. WARNING: Will not work with non-integer values or multiple vectors. Will only return the lowest mode for multimodal data. (let ((freq (histogram vec (1+ (vmax vec) (1- (find freq (vmax freq) #+end_src Using :=vmode(@I..@II), I get 124 (systolic), 80 (diastolic), 68 (pulse). Yours, Christian On 9/20/11 10:26 AM, Nick Dokos wrote: Nick Dokosnicholas.do...@hp.com wrote: Jude DaShielljdash...@shellworld.net wrote: |+--+---+---| | mode | | | | | Min| | | | | Max| 127. | 81. | 74. | #+TBLFM: @$2..@$4=vmode(@i..@ii) :: @$2..@$4=vmin(@i..@ii) :: @$2..@$4=vmax(@i..@ii) # Local Variables: # kept-new-versions: 100 # version-control: t # End: cut here. What did I do wrong with this #+TBLFM: line? Two things: o as Christian Moe pointed out, calc does not provide a vmode() function. o the separator lines in the formulas have to be specified using capital I letters. Here is an implementation of vmode - afaict, it works correctly but that may be because I've only tested it on a single set of data. If you find something wrong, please let me know. --8---cut here---start-8--- | Date Stamp | Systolic | Diastolic | Pulse | |+--+---+---| | [2011-07-19 Tue 02:26] | 138 |92 |74 | | [2011-07-20 Wed 04:03] | 130 |85 |74 | | [2011-07-21 Thu 03:50] | 128 |79 |76 | | [2011-07-22 Fri 02:33] | 121 |80 |79 | | [2011-07-23 Sat 02:52] | 118 |75 |68 | | [2011-07-24 Sun 04:13] | 126 |83 |78 | | [2011-07-25 Mon 02:12] | 122 |79 |76 | | [2011-07-26 Tue 01:57] | 124 |79 |72 | | [2011-07-27 Wed 04:03] | 137 |74 |76 | | [2011-07-28 Thu 03:47] | 136 |80 |76 | | [2011-07-29 Fri 04:06] | 120 |72 |76 | | [2011-07-30 Sat 03:18] | 128 |92 |80 | | [2011-07-31 Sun 07:11] | 124 |84 |72 | | [2011-08-01 Mon 04:55] | 124 |77 |69 | | [2011-08-02 Tue 02:47] | 128 |80 |67 | | [2011-08-03 Wed 06:00] | 132 |89 |70 | | [2011-08-04 Thu 04:30] | 137 |82 |77 | | [2011-08-05 Fri 06:10] | 124 |86 |77 | | [2011-08-06 Sat 04:04] | 139 |88 |78 | | [2011-08-07 Sun 04:02] | 124 |80 |68 | | [2011-08-08 Mon 06:36] | 137 |93 |79 | | [2011-08-10 Wed04:03] | 120 |80 |68 | | [2011-08-11 Thu 04:30] | 128 |78 |77 | | [2011-08-12 Fri 06:36] | 143 |82 |76 | | [2011-08-13 Sat 06:18] | 125 |76 |69 | | [2011-08-14 Sun 04:04] | 123 |70 |69 | | [2011-08-15 Mon 04:04] | 135 |83 |76 | | [2011-08-16 Tue 04:03] | 128 |80 |69 | | [2011-08-17 Wed 04:04] | 124 |80 |68 | | [2011-08-18 Thu 05:58] | 136 |87 |72 | | [2011-08-19 Fri 05:50] | 116 |80 |64 | | [2011-08-20 Sat 06:38] | 139 |84 |64 | | [2011-08-21 Sun 08:20] | 124 |84 |73 | | [2011-08-22 Mon 03:50] | 138 |76 |70 | | [2011-08-23 Tue 05:52] | 126 |79 |68 | | [2011-08-24 Wed 04:53] | 125 |81 |64 | | [2011-08-25 Thu 05:37] | 124 |79 |68 | | [2011-08-26 Fri 06:41] | 124 |87 |74 | | [2011-08-27 Sat 05:44] | 133 |74 |61 | | [2011-08-28 Sun 03:22] | 124 |
Re: [O] Idea, configurable markup
When I moved from Planner/Muse to Org, the ability to define custom markup with something.../something is the only thing I missed as well as the ability to easily toggle between hide and show the markup (I thing it was C-c C-l, but I'm not sure). This was a small thing to pay considering everything else org-mode offered in exchange, but it would be nice to have thi flexibility in org. -- Darlan At Mon, 19 Sep 2011 21:12:01 +0200, Sebastien Vauban wxhgmqzgw...@spammotel.com wrote: Hi Dov, Dov Grobgeld wrote: I got the following idea regarding the use of markup characters in org-mode. Currently it is possible to use *bold*, /italic/ and ~verbose~ and a few other markups. I would have liked to have this extended as follows: - Allow the toggling of the display of the formatting characters, *, ~, /, etc. It's already in there: 1. Choose to get them hidden by default with: #+begin_src emacs-lisp (setq org-hide-emphasis-markers t) #+end_src 2. Make them (dis-)appear by toggling visible-mode. - Allow a system that allows the user to invent his own formatting. E.g. «variable», 〈function〉, $math$, ⌞string⌟, or whatever the user fancies. All these modes should be defined in an org-mode variable and the display attributes should be configurable, just like any other custom org-mode font. If the user wants to expand beyond ASCII it should be up to him. - Alternately, use a system like varvariable/var where the tag var is user definable, just like the magic characters above. The display of the tags should be toggable. Just like for [file:foo.bar] where the [] character are hidden, should the tags be hidden until someone erases one of the two delimiters. Note that this is nothing more than ideas at the moment, and I'll probably never get around to implement any of it. Still I thought I'd share it if someone would like to have a go. Regarding inventing new formatting and having them correctly exported, this is already there as well: See: - `org-emphasis-alist' for face in Emacs and code to HTML - `org-export-latex-emphasis-alist' for code to LaTeX So, already done (by others!). Just a comment on this: I would be in favor of having one or two extra formats _by default_ -- so that it's not relying on my .emacs config file; in fact, as much as in TeXinfo... Currently, as special formats[1], we only have: - org-code, and - org-verbatim. And the use case is not that clear to me (how do you code a URL, a filename, an argument or a key binding?), as both finally gets resolved to the same appearance (in HTML, and almost the same in LaTeX). In TeXinfo, it seems to me we have at least: - url, - code, - key binding, not speaking of internal references. I'd be glad if we could get the same expressivety, by default, as the one we have in TeXinfo[2]. Best regards, Seb Footnotes: [1] I mean: other than bold, italic, underline and striken-through. [2] Never wrote any line in TeXinfo, but simply had to read a couple. -- Sebastien Vauban
Re: [O] org-bibtex: TYPE property conflicting with bibtex's type parameter
Lluís xscr...@gmx.net writes: The current org-bibtex code uses the value of the TYPE property for two different purposes: * identify the type of bibtex entry * give a value to the type parameter in a bibtex entry Using the TYPE property for both has the unfortunate effect that on an entry type like phdthesis (which has an optional type parameter), the resulting text contains the phdthesis text insteaad of the default PhD thesis text produced by bibtex when the type parameter is not set. For example, this: #+bein_source org * One Title :PROPERTIES: :TITLE: One Title :TYPE: phdthesis :AUTHOR: John Doe :SCHOOL: University of Somewhere :YEAR: 2011 :CUSTOM_ID: myid :END: #+end_source results in the following bibtex entry: #+begin_source bibtex @phdthesis{myid, author = {John Doe}, title ={One Title}, school = {University of Somewhere}, year = 2011, type = {phdthesis} } #+end_source which is processed into the following text: #+begin_source fundamental [1] J. Doe. One Title. phdthesis, University of Somewhere, 2011. #+end_source instead of the desired: #+begin_source fundamental [1] J. Doe. One Title. PhD thesis, University of Somewhere, 2011. #+end_source The only way out I see is to use different properties for the bibtex entry type and bibtex's type parameter. Preferably using a different property for org-bibtex to identify the entry type (e.g., BIBTEX_TYPE). Hi Lluis, Thanks for catching this! I should have checked for this conflict when initially creating this package. I'm making the name of the type property configurable and setting the default value to btype. For those who want to keep using type on existing files the following should restore the current behavior after updating Org-mode. #+begin_src emacs-lisp (setf org-bibtex-type-property-name btype) #+end_src For those who want to switch to the new property name please update org-mode and ensure that `org-bibtex-type-property-name' has a value, then call the following function in every Org-mode file which has bibtex entries. #+begin_src emacs-lisp (defun org-bibtex-replace-type-with-btype () (interactive) (replace-regexp (concat ^ (regexp-quote :TYPE:)) (format :%s: (upcase org-bibtex-type-property-name #+end_src Sorry for the breaking change but this should be an improvement moving forward. Best -- Eric Thanks a lot, Lluis PS: I'm not subscribed to the list, so please put me in CC if you want me to read you. -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] [babel] Trying to add ERT test cases
Footnotes: [1] , | org-test-with-temp-text is a Lisp macro in `org-test.el'. | | (org-test-with-temp-text TEXT rest BODY) | | Run body in a temporary buffer with Org-mode as the active | mode holding TEXT. If the string point appears in TEXT | then remove it and place the point there before running BODY. ` This looks useful, however I hit problems when refactoring my tests to use it. Would it be easy for your macro to accept string variables in addition to strings? Hmm, that is weird. I've just pushed up a fix so this should now be solved. Thanks for the catch -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] [PATCH] Modifications to enable test script to run with emacs-23 and emacs-22
Applied, Thanks! -- Eric Martyn Jago martyn.j...@btinternet.com writes: Hi With this patch, the command-line test script now passes all tests on Emacs 24, 23 and 22. On 23 and 22, testing directory should include ert.el and ert-x.el Best, Martyn From 6ab323b099f55462f690d44f6ad482c962461a97 Mon Sep 17 00:00:00 2001 From: Martyn Jago martyn.j...@btinternet.com Date: Tue, 20 Sep 2011 08:44:24 +0100 Subject: [PATCH] Modifications to enable test script to run with emacs-23 and emacs-22 * testing/org-test.el: enable test script to run with emacs-23 and emacs-22 * testing/lisp/test-org-exp.el: added org-ascii requirement --- testing/lisp/test-org-exp.el | 15 +++-- testing/org-test.el | 112 + 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/testing/lisp/test-org-exp.el b/testing/lisp/test-org-exp.el index 348538f..0ed8d68 100644 --- a/testing/lisp/test-org-exp.el +++ b/testing/lisp/test-org-exp.el @@ -7,11 +7,12 @@ ;; see: http://www.gnu.org/licenses/gpl-3.0.html (let ((load-path (cons (expand-file-name - .. (file-name-directory - (or load-file-name buffer-file-name))) -load-path))) +.. (file-name-directory + (or load-file-name buffer-file-name))) + load-path))) (require 'org-test) - (require 'org-test-ob-consts)) + (require 'org-test-ob-consts) + (require 'org-ascii)) (ert-deftest test-org-exp/stripping-commas () Test the stripping of commas from within blocks during export. @@ -19,5 +20,7 @@ ;; don't strip internal commas (org-narrow-to-subtree) (should (string-match - , 2 - (org-export-as-ascii nil nil nil 'string) + , 2 + (org-export-as-ascii nil nil nil 'string) + +(provide 'test-org-exp) diff --git a/testing/org-test.el b/testing/org-test.el index 7789cbe..9b4313f 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -30,17 +30,20 @@ Code: -(let ((org-test-dir (expand-file-name +(let* ((org-test-dir (expand-file-name (file-name-directory -(or load-file-name buffer-file-name) - (let ((org-lisp-dir (expand-file-name -(concat org-test-dir ../lisp - (unless (featurep 'org) - (setq load-path (cons org-lisp-dir load-path)) - (org-babel-do-load-languages - 'org-babel-load-languages '((sh . t) - (let* ((load-path (cons - (expand-file-name ert org-test-dir) +(or load-file-name buffer-file-name + (org-lisp-dir (expand-file-name + (concat org-test-dir ../lisp + + (unless (featurep 'org) +(setq load-path (cons org-lisp-dir load-path)) +(require 'org) +(org-babel-do-load-languages + 'org-babel-load-languages '((sh . t + + (let* ((load-path (cons + org-test-dir (cons (expand-file-name jump org-test-dir) load-path @@ -69,8 +72,7 @@ (when (file-exists-p (expand-file-name jump/jump.el org-test-dir)) (require 'jump) - (require 'which-func)) -(require 'org))) + (require 'which-func (defconst org-test-default-test-file-name tests.el For each defun a separate file with tests may be defined. @@ -181,49 +183,49 @@ then remove it and place the point there before running BODY. ;;; Navigation Functions (when (featurep 'jump) -(defjump org-test-jump - ((lisp/\\1.el . testing/lisp/test-\\1.el) - (lisp/\\1.el . testing/lisp/\\1.el/test.*.el) - (contrib/lisp/\\1.el . testing/contrib/lisp/test-\\1.el) - (contrib/lisp/\\1.el . testing/contrib/lisp/\\1.el/test.*.el) - (testing/lisp/test-\\1.el . lisp/\\1.el) - (testing/lisp/\\1.el . lisp/\\1.el/test.*.el) - (testing/contrib/lisp/test-\\1.el . contrib/lisp/\\1.el) - (testing/contrib/lisp/test-\\1.el . contrib/lisp/\\1.el/test.*.el)) - (concat org-base-dir /) - Jump between org-mode files and their tests. - (lambda (path) -(let* ((full-path (expand-file-name path org-base-dir)) - (file-name (file-name-nondirectory path)) - (name (file-name-sans-extension file-name))) - (find-file full-path) - (insert - ;;; file-name \n\n - ;; Copyright (c) (nth 5 (decode-time (current-time))) - user-full-name \n - ;; Authors: user-full-name \n\n - ;; Released under the GNU General Public License version 3\n - ;; see: http://www.gnu.org/licenses/gpl-3.0.html\n\n; - Comments:\n\n - ;; Template test file for Org-mode tests\n\n - \n - ;;; Code:\n - (let ((load-path (cons (expand-file-name\n -\..\
Re: [O] Bug: unable to open link unless `...from-string' [7.7 (release_7.7.292.g0d4e8.dirty)]
on Tue Sep 20 2011, David Maus dmaus-AT-ictsoc.de wrote: The original link is alread wrong, i.e. unescaped. The key question are 1. How did you create the original link? I used this code: https://github.com/dabrahams/elisp/blob/master/elisp/autoload.d/wl-setup.el#L801 Is there some encoding step I should have applied? 2. When did you create the original link? It might have been as long as a year ago I tried taking a link with `org-store-link' and insert it with `org-insert-link' and the link was properly escaped. The link escaping was changed in November 2010, maybe the link in question is an old one? Yep. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Re: [O] unexpected failure on all formulas
Nick Dokos nicholas.do...@hp.com wrote: All in all, a disaster: can a posting be deleted? or at least marked with a big, red X so that it won't mislead in the future? I'll try to post a corrected version later on. Here's an attempt to correct the problems that Christian, Lawrence and I found in my previous attempt. I include two tables, Jude's original and a truncated version to force multimodality. I hope that this is correct (but I would not be surprised if there are other errors lurking - but at least it is better than the previous version). As always, I'd appreciate corrections etc. Nick --8---cut here---start-8--- | Date Stamp | Systolic | Diastolic | Pulse | |+--+---+---| | [2011-07-19 Tue 02:26] | 138 |92 |74 | | [2011-07-20 Wed 04:03] | 130 |85 |74 | | [2011-07-21 Thu 03:50] | 128 |79 |76 | | [2011-07-22 Fri 02:33] | 121 |80 |79 | | [2011-07-23 Sat 02:52] | 118 |75 |68 | | [2011-07-24 Sun 04:13] | 126 |83 |78 | | [2011-07-25 Mon 02:12] | 122 |79 |76 | | [2011-07-26 Tue 01:57] | 124 |79 |72 | | [2011-07-27 Wed 04:03] | 137 |74 |76 | | [2011-07-28 Thu 03:47] | 136 |80 |76 | | [2011-07-29 Fri 04:06] | 120 |72 |76 | | [2011-07-30 Sat 03:18] | 128 |92 |80 | | [2011-07-31 Sun 07:11] | 124 |84 |72 | | [2011-08-01 Mon 04:55] | 124 |77 |69 | | [2011-08-02 Tue 02:47] | 128 |80 |67 | | [2011-08-03 Wed 06:00] | 132 |89 |70 | | [2011-08-04 Thu 04:30] | 137 |82 |77 | | [2011-08-05 Fri 06:10] | 124 |86 |77 | | [2011-08-06 Sat 04:04] | 139 |88 |78 | | [2011-08-07 Sun 04:02] | 124 |80 |68 | | [2011-08-08 Mon 06:36] | 137 |93 |79 | | [2011-08-10 Wed 04:03] | 120 |80 |68 | | [2011-08-11 Thu 04:30] | 128 |78 |77 | | [2011-08-12 Fri 06:36] | 143 |82 |76 | | [2011-08-13 Sat 06:18] | 125 |76 |69 | | [2011-08-14 Sun 04:04] | 123 |70 |69 | | [2011-08-15 Mon 04:04] | 135 |83 |76 | | [2011-08-16 Tue 04:03] | 128 |80 |69 | | [2011-08-17 Wed 04:04] | 124 |80 |68 | | [2011-08-18 Thu 05:58] | 136 |87 |72 | | [2011-08-19 Fri 05:50] | 116 |80 |64 | | [2011-08-20 Sat 06:38] | 139 |84 |64 | | [2011-08-21 Sun 08:20] | 124 |84 |73 | | [2011-08-22 Mon 03:50] | 138 |76 |70 | | [2011-08-23 Tue 05:52] | 126 |79 |68 | | [2011-08-24 Wed 04:53] | 125 |81 |64 | | [2011-08-25 Thu 05:37] | 124 |79 |68 | | [2011-08-26 Fri 06:41] | 124 |87 |74 | | [2011-08-27 Sat 05:44] | 133 |74 |61 | | [2011-08-28 Sun 03:22] | 124 |76 |61 | | [2011-08-29 Mon 04:06] | 124 |76 |65 | | [2011-08-30 Tue 05:52] | 139 |87 |71 | | [2011-08-31 Wed 06:47] | 152 |86 |68 | | [2011-09-01 Thu 06:00] | 136 |86 |78 | | [2011-09-02 Fri 01:22] | 142 | 100 |78 | | [2011-09-03 Sat 09:12] | 126 |79 |70 | | [2011-09-04 Sun 11:53] | 130 |90 |72 | | [2011-09-05 Mon 06:29] | 138 |77 |65 | | [2011-09-06 Tue 05:42] | 121 |76 |68 | | [2011-09-07 Wed 06:47] | 131 |77 |68 | | [2011-09-08 Thu 06:02] | 122 |76 |72 | | [2011-09-10 Sat 05:38] | 126 |76 |69 | | [2011-09-11 Sun 10:12] | 137 |87 |64 | | [2011-09-12 Mon 04:00] | 135 |78 |89 | | [2011-09-13 Tue 06:00] | 132 |82 |66 | | [2011-09-14 Wed 06:01] | 137 |77 |77 | | [2011-09-15 Thu 04:08] | 141 |87 |64 | | [2011-09-17 Sat 08:35] | 121 |78 |66 | | [2011-09-18 Sun 07:04] | 124 |69 |65 | | [2011-09-19 Mon 06:00] | 133 |81 |69 | |+--+---+---| | mode | 124 |80 |68 | | min| 116 |69 |61 | | max| 152 | 100 |89 | #+TBLFM: @$2..@$4=vmode(@I..@II) :: @$2..@$4=vmin(@I..@II) :: @$2..@$4=vmax(@I..@II) | Date Stamp | Systolic | Diastolic | Pulse | |++---+---| | [2011-07-19 Tue 02:26] |138 |92 |74 | | [2011-07-20 Wed 04:03] |130 |85 |74 | | [2011-07-21 Thu 03:50] |128 |79 |76 | | [2011-07-22 Fri 02:33] |121 |80 |79 | | [2011-07-23 Sat 02:52] |118 |75
[O] slides precess in html5presentation
Hi folks, I think someone else mentioned this in an earlierthread but I can't find the solution anywhere. I am using this html5 presentation exporter: https://gist.github.com/509761 and it for the most part works really great, except that the slides 'precess' ovr time - -that is, the slides slowly slide ot the left, until eventually (after about 20 slides) the left side of a slide will become invisible. Has anyone else encountered this, and if so, have you found a solution? I tried using s5 but it appeared not to be working well with my file; so if there's a solution that uses html5presentation.el that'd be gret (or if someone has rigged up a deck.js ocnverter, i'd love to try that , too). thanks as always, matt
Re: [O] bug: org-mouse broken
Org-mouse still broken. I wonder if it would be safe to revert this patch, or perhaps it's a bug in org-mouse. On 2011-08-18, Samuel Wales samolog...@gmail.com wrote: git bisect: 628ebf04f74afa8694945386c507bde06c3aac9e is the first bad commit commit 628ebf04f74afa8694945386c507bde06c3aac9e Author: Nicolas Goaziou n.goaz...@gmail.com Date: Mon Jul 25 17:50:28 2011 +0200 Enforce white space after todo keywords * lisp/org.el (org-set-regexps-and-options): enforce white space after todo keyword, as word boundary isn't sufficient (i.e. in matches * TODO/this) :04 04 9786e7018273d86a894aecabac265e46429c233c ef1ffd65a9c8efa918dedfe5c157f0f1ef835923 Mlisp
Re: [O] bug: org-mouse broken
To reproduce load org-mouse and mouse-1 in the stars: *** will say no links instead of cycle click in the stars * more no links instead of cycle more * more with links will do menu instead of cycle http://google.com/whatever http://google.com * more
Re: [O] Problems with Org-Mode export
Another bit of information about this: if I remove: :session *R* from the line starting with: #+BABEL then I don't see any error message. OTOH, this isn't much of a workaround, because without a session, the values of the variables are not preserved between source-code blocks, so that, for instance, the combination: x - c(1, 3, 5) defined in one block and q - c(x, 8, 8) defined in another block raises an R error ('x' is not defined when the assignment to 'q' is made). Also, in grasping at straws, I've tried renaming the R session, as: ... :session mTest (on the theory that the '*' is used for emphasis in Org-Mode markup and might, therefore, somehow confuse things). That didn't help. -- Mike From: Michael Hannon jm_han...@yahoo.com To: Org-Mode List emacs-orgmode@gnu.org Sent: Friday, September 16, 2011 10:50 AM Subject: [O] Problems with Org-Mode export Greetings. I've been having problems lately in exporting Org-Mode source-code documents to HTML and/or PDF. I'm running Org-Mode 7.7 with Emacs 23 on 64-bit linux (Fedora 15). I've appended a document that exhibits at least some of the problem. The problems are similar to the problem described at: http://comments.gmane.org/gmane.emacs.orgmode/45316 and can *sometimes* be circumvented by executing org-reload. In the particular example shown below, the HTML export works as expected, but the PDF export fails with message: org-export-latex-preprocess: Wrong type argument: stringp, nil By the way, everything worked fine in the example until I added the last source block: #+begin_src R x #+end_src I tried using what I take to be the latest version of Org-Mode: Org-mode version 7.7 (release_7.7.290.g65d05) but that only made things worse. I tried an HTML export with this version, and it generated a horrendous-looking message that begins with: org-babel-R-evaluate: Wrong number of arguments: #[(session body result-type result-params column-names-p row-names-p) Æ=}... followed by a bunch of stuff containing enough non-printing characters that it's hard to reproduce in email, and ending with: ...org-mode/lisp/ob-R.elc . 9734)], 5 I'd welcome any help/advice that anybody can provide. Thanks, -- Mike ## Sample file that exhibits some export problems #+TITLE: This is a test #+AUTHOR: Michael Hannon #+email: jm_han...@yahoo.com #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes * Getting Started ** Batch Mode #+begin_src R :exports code pdf(xh.pdf) # set graphical output file hist(rnorm(100)) # generate 100 N(0,1) variates and plot their histogram dev.off() # close the graphical output file #+end_src If we put the code above in a file called =z.R=, we can execute the code from the command line via: =R CMD BATCH z.R= #+begin_src R x - c(1, 3, 5) #+end_src #+begin_src R x[3] #+end_src #+begin_src R q - c(x,x,8) #+end_src #+begin_src R x #+end_src
Re: [O] unexpected failure on all formulas
Hi, Nick, No whacks intended! It was an easy catch because I was mulling over similar problems with my code. My own second pass at a vmode implementation for Calc is below, now with support for negative values and bimodal data. It takes a different route and is a bit shorter, but doesn't handle all the cases your code does (I guess; I don't grok it all). Yours, Christian (defmath vmode (vec) Return the mode(s), i.e. most frequent value(s), of a vector of integers VEC. (let ((results (vec)) ; hold results (index 1) offset maxfreq) (setq offset (- 1 (vmin vec)) vec (+ offset vec) ; bump all ints positive freq (histogram vec (1+ (vmax vec))) offset (1+ offset) ; histogram added `0' slot maxfreq (vmax freq)) ;; Collect indexes (less offset) of all max freqs (while ( (setq index (find freq maxfreq index)) 0) (setq results (vconcat results index) index (1+ index))) (setq results (- results offset)) ; get neg ints back ;; Return results as vector or number (if ( (vlen results) 1) results (head results On 9/20/11 4:59 PM, Nick Dokos wrote: Christian Moem...@christianmoe.com wrote: I think your vmode() needs to subtract one from the result. The mode in the systolic column of Jude's dataset should be 124 (f=12), not 125 (f=2). Yes, this is an off-by-one error: in vfreqs, I should cons prev onto freqs, not (nth 0 vec). In addition to this and the multimodal problem that both you and Lawrence Mitchell pointed out, there is another off-by-one error when vfreqs gets to the end of the list. All in all, a disaster: can a posting be deleted? or at least marked with a big, red X so that it won't mislead in the future? I'll try to post a corrected version later on. OTOH, my main interest in this was the hooking up of a user function onto calc and the example, though deeply flawed, does illustrate that. Thanks to both Christian and Lawrence for the whacks in the head (although now I have a headache...) Nick
[O] ODT image export
I got the odt export working and I'm very excited about the possibility of using it, but when I export a file with an image link, the image isn't embedded. Instead there's a link to the file. Do I need to take any special steps to embed images in export? A few other questions, is there any functionality for export to ODP, that would be great. If it is possible to export to ODP, would it be possible to include the latex code for any embedded images in the comments of the slides? Finally, in odt export, is it possible to export tikz diagrams as images and embed those in the file? Thanks, Derek
[O] org-capture-hook only when in frame?
I have a function to create a frame for capture mode that I can call with emacsclient at any time: ;; Initialization of capture frames (defun make-capture-frame () Create a new frame and run org-capture (interactive) (make-frame '((name . capture) (width . 80) (height . 10))) (select-frame-by-name capture) ;; Org-remember splits windows, force it to a single window (add-hook 'org-capture-mode-hook 'delete-other-windows) (org-capture) ) This works great, however I actually would like org-capture-mode to split the screen when I am *not* calling this function, but it seems like when I have this existing, it deletes the other window even when I am inside the original emacs. thanks for any hints! micah -- pgpGfupcEBWJp.pgp Description: PGP signature
Re: [O] slides precess in html5presentation
On Tue, Sep 20, 2011 at 11:46 AM, Matt Price mopto...@gmail.com wrote: and it for the most part works really great, except that the slides 'precess' ovr time - -that is, the slides slowly slide ot the left, until eventually (after about 20 slides) the left side of a slide will become invisible. Has anyone else encountered this, and if so, have you found a solution? I find that this happens when I use firefox (5.0). It doesn't happen when I use chrome. Derek
Re: [O] org-capture-hook only when in frame?
On Tue, 20 Sep 2011 18:45:31 -0400, Micah Anderson mi...@riseup.net wrote: Non-text part: multipart/signed I have a function to create a frame for capture mode that I can call with emacsclient at any time: ;; Initialization of capture frames (defun make-capture-frame () Create a new frame and run org-capture (interactive) (make-frame '((name . capture) (width . 80) (height . 10))) (select-frame-by-name capture) ;; Org-remember splits windows, force it to a single window (let ((org-capture-mode-hook)) (add-hook 'org-capture-mode-hook 'delete-other-windows) (org-capture) ) ) Would probably work, although there may be better ways. Tom
Re: [O] org-capture-hook only when in frame?
Tom Prince tom.pri...@ualberta.net writes: On Tue, 20 Sep 2011 18:45:31 -0400, Micah Anderson mi...@riseup.net wrote: Non-text part: multipart/signed I have a function to create a frame for capture mode that I can call with emacsclient at any time: ;; Initialization of capture frames (defun make-capture-frame () Create a new frame and run org-capture (interactive) (make-frame '((name . capture) (width . 80) (height . 10))) (select-frame-by-name capture) ;; Org-remember splits windows, force it to a single window (let ((org-capture-mode-hook)) (add-hook 'org-capture-mode-hook 'delete-other-windows) (org-capture) ) ) Would probably work, although there may be better ways. Actually, it seems like I didn't need to do the hook at all, I just had to put a (delete-other-window) after the (org-capture), like this: (defun make-capture-frame () Create a new frame and run org-capture. (interactive) (make-frame '((name . capture) (width . 80 ) (height . 10))) (select-frame-by-name capture) (org-capture) (delete-other-windows) ) Now I am trying to get the frame to be destroyed after I've either canceled, or saved the capture, I found these referenced on the mailing list, and I've added them and loaded them, but for some reason they aren't working: (defadvice capture-finalize (after delete-capture-frame activate) Advise capture-finalize to close the frame if it is the capture frame (if (equal capture (frame-parameter nil 'name)) (delete-frame))) (defadvice capture-destroy (after delete-capture-frame activate) Advise capture-destroy to close the frame if it is the rememeber frame (if (equal capture (frame-parameter nil 'name)) (delete-frame))) what happens is I get the frame, I get the org-capture template, I enter my item, I finalize it, and then I'm switched back to the scratch buffer, rather than the frame being destroyed :P micah
Re: [O] org-capture-hook only when in frame?
Micah Anderson mi...@riseup.net writes: (defadvice capture-finalize (after delete-capture-frame activate) Advise capture-finalize to close the frame if it is the capture frame (if (equal capture (frame-parameter nil 'name)) (delete-frame))) (defadvice capture-destroy (after delete-capture-frame activate) Advise capture-destroy to close the frame if it is the rememeber frame (if (equal capture (frame-parameter nil 'name)) (delete-frame))) arg, these should be org-capture-finalize and org-capture-destroy... thats my problem. Sorry for the noise :) micah
Re: [O] Problems with Org-Mode export
Nick Dokos nicholas.do...@hp.com wrote: [...] FWIW, I don't get any error messages. I have no idea what the exported file should look like: I attach both the exported pdf and the exported html below (as well as the org file, which is just cut-n-pasted from what you posted). Versions: Org-mode version 7.7 (release_7.7.224.g6e14) GNU Emacs 24.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-09-13 I'll pull the newest bits and try again. Thanks, Nick. This is getting curiouser and curiouser. I can now reliably get documents exported using the vanilla 7.7 Org-Mode, but not with the development version I currently have installed: Org-mode version 7.7 (release_7.7.304.g9da4) I suspect that the following bit of the error message is the relevant one: org-babel-R-evaluate: Wrong number of arguments: #[(session body result-type result-params column-names-p row-names-p but I don't know what to make of it. In order to simplify the discussion, I've been working with some Org code that I took from the worg web site. Please see below for details. I've also appended the pieces of my .emacs file that relate to finding Org files. At this point I guess I'm ready to declare victory and slink away, but it WOULD be interesting to know what's going on. -- Mike -- #+TITLE: Test #+AUTHOR: Michael Hannon #+EMAIL: jm_han...@yahoo.com #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes Example taken from: http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html * Example of Org-Babel for R Literate Programming ** R text output A simple summary. #+begin_src R x - rnorm(10) summary(x) #+end_src ** R graphics output Note we use the object =x= generated in previous code block, thanks to the header option =:session *R*=. The output graphics file is =a.png=. #+begin_src R :file a.png y - rnorm(10) plot(x, y) #+end_src Same plot with larger dimension: #+begin_src R :file b.png :width 800 :height 800 plot(x, y) #+end_src -- Org-Mode path variables, standard and devel versions (setq load-path (cons /usr/local/emacs.d/ssh load-path)) (require 'ssh) ;;(setq load-path (cons /usr/local/emacs.d/org-mode/org-7.7/lisp load-path)) ;;(setq load-path (cons /usr/local/emacs.d/org-mode/org-7.7/contrib/lisp load-path)) (setq load-path (cons /usr/local/emacs.d/org-mode/org-devel/org-mode/lisp load-path)) (setq load-path (cons /usr/local/emacs.d/org-mode/org-devel/org-mode/contrib/lisp load-path)) (require 'org-install)
Re: [O] [babel] Trying to add ERT test cases
Hi Eric Eric Schulte schulte.e...@gmail.com writes: Footnotes: [1] , | org-test-with-temp-text is a Lisp macro in `org-test.el'. | | (org-test-with-temp-text TEXT rest BODY) | | Run body in a temporary buffer with Org-mode as the active | mode holding TEXT. If the string point appears in TEXT | then remove it and place the point there before running BODY. ` This looks useful, however I hit problems when refactoring my tests to use it. Would it be easy for your macro to accept string variables in addition to strings? Hmm, that is weird. I've just pushed up a fix so this should now be solved. Thanks for the catch -- Eric Thanks, that works great. I've updated test-ob.el to use the macro and include a patch. Best, Martyn From bb1680342b890dbe5562878a59655b5754ab5ef3 Mon Sep 17 00:00:00 2001 From: Martyn Jago martyn.j...@btinternet.com Date: Wed, 21 Sep 2011 05:06:44 +0100 Subject: [PATCH] Refactor tests to use `org-test-with-temp-text' * testing/lisp/test-ob.el: refactor --- testing/lisp/test-ob.el | 125 ++- 1 files changed, 58 insertions(+), 67 deletions(-) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index f78ca98..24a64c9 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -238,12 +238,10 @@ ))) (ert-deftest test-org-babel/inline-src_blk-default-results-replace-line-1 () - (with-temp-buffer - + (let ((test-line src_sh{echo 1})) ;; src_ at bol line 1... -(let ((test-line src_sh{echo 1})) - (insert test-line) - (should-error (org-ctrl-c-ctrl-c)) +(org-test-with-temp-text + test-line (goto-char (point-min)) (org-ctrl-c-ctrl-c) (should (string= (concat test-line =1=) @@ -259,12 +257,10 @@ (should (string= (concat test-line =1= =1= =1=) (buffer-substring-no-properties (point-at-bol) (point-at-eol) - ;; src_ follows space line 1... (let ((test-line src_emacs-lisp{ 1 })) - (beginning-of-line) - (insert (concat test-line \n)) - (goto-char (point-min)) +(org-test-with-temp-text + test-line (should-error (org-ctrl-c-ctrl-c)) (forward-char) (org-ctrl-c-ctrl-c) (should (string= @@ -275,15 +271,13 @@ (concat test-line =1= =1=) (buffer-substring-no-properties (point-at-bol) (point-at-eol (forward-char) - (should-error (org-ctrl-c-ctrl-c)) - ))) + (should-error (org-ctrl-c-ctrl-c) (ert-deftest test-org-babel/inline-src_blk-default-results-replace-line-2 () - (with-temp-buffer - -;; src_ at bol line 2... -(let ((test-line src_emacs-lisp{ \x\ })) - (insert (concat \n test-line)) + ;; src_ at bol line 2... + (let ((test-line src_emacs-lisp{ \x\ })) +(org-test-with-temp-text + (concat \n test-line) (should-error (org-ctrl-c-ctrl-c)) (goto-char (point-min)) (should-error (org-ctrl-c-ctrl-c)) @@ -292,9 +286,11 @@ (forward-char) (org-ctrl-c-ctrl-c) (should (string= (concat test-line =x=) - (buffer-substring-no-properties (point-at-bol) (point-at-eol) + (buffer-substring-no-properties (point-at-bol) (point-at-eol)) -(let ((test-line Some text prior to block src_emacs-lisp{ \y\ })) + (let ((test-line Some text prior to block src_emacs-lisp{ \y\ })) +(org-test-with-temp-text + test-line (goto-char (point-max)) (insert (concat \n test-line end)) (re-search-backward src) (org-ctrl-c-ctrl-c) @@ -306,25 +302,25 @@ (concat test-line =y= =y= end) (buffer-substring-no-properties (point-at-bol) (point-at-eol (forward-char) - (should-error (org-ctrl-c-ctrl-c)) - ))) + (should-error (org-ctrl-c-ctrl-c)) (ert-deftest test-org-babel/inline-src_blk-manual-results-replace () - (with-temp-buffer - -(let ((test-line src_emacs-lisp[:results replace]{ \x\ })) - (insert (concat \n test-line)) + (let ((test-line src_emacs-lisp[:results replace]{ \x\ })) +(org-test-with-temp-text + (concat \n test-line) (should-error (org-ctrl-c-ctrl-c)) - (goto-char (point-min)) + (goto-char (point-max)) (should-error (org-ctrl-c-ctrl-c)) - (forward-line) + (beginning-of-line) (should-error (org-ctrl-c-ctrl-c)) (forward-char) (org-ctrl-c-ctrl-c) (should (string= (concat test-line =x=) - (buffer-substring-no-properties (point-at-bol) (point-at-eol) + (buffer-substring-no-properties (point-at-bol) (point-at-eol)) -(let ((test-line Some text prior to block src_emacs-lisp[:results replace]{ \y\ })) + (let ((test-line Some text prior to block src_emacs-lisp[:results replace]{ \y\ })) +(org-test-with-temp-text + test-line (goto-char (point-max)) (insert (concat \n test-line end)) (re-search-backward src)