From 62dbf404f54a370a0390e9dfb5c94af0fa4b2edd Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Mon, 25 Oct 2010 11:12:49 -0600 Subject: [PATCH 1/5] ob-clojure: fixed error message when clojure binary is not found * lisp/ob-clojure.el (org-babel-clojure-babel-clojure-cmd): fixed error message when clojure binary is not found --- lisp/ob-clojure.el | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index 7ee9499d9..4c0070bae 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -91,28 +91,28 @@ (defvar swank-clojure-extra-classpaths) (defun org-babel-clojure-babel-clojure-cmd () "Create the command to start clojure according to current settings." - (if (and (not swank-clojure-binary) (not swank-clojure-classpath)) + (or (when swank-clojure-binary + (if (listp swank-clojure-binary) + swank-clojure-binary + (list swank-clojure-binary))) + (when swank-clojure-classpath + (delq + nil + (append + (list swank-clojure-java-path) + swank-clojure-extra-vm-args + (list + (when swank-clojure-library-paths + (concat "-Djava.library.path=" + (swank-clojure-concat-paths swank-clojure-library-paths))) + "-classpath" + (swank-clojure-concat-paths + (append + swank-clojure-classpath + swank-clojure-extra-classpaths)) + "clojure.main")))) (error "%s" (concat "You must specifiy either a `swank-clojure-binary' " - "or a `swank-clojure-jar-path'")) - (if swank-clojure-binary - (if (listp swank-clojure-binary) - swank-clojure-binary - (list swank-clojure-binary)) - (delq - nil - (append - (list swank-clojure-java-path) - swank-clojure-extra-vm-args - (list - (when swank-clojure-library-paths - (concat "-Djava.library.path=" - (swank-clojure-concat-paths swank-clojure-library-paths))) - "-classpath" - (swank-clojure-concat-paths - (append - swank-clojure-classpath - swank-clojure-extra-classpaths)) - "clojure.main")))))) + "or a `swank-clojure-classpath'")))) (defun org-babel-clojure-table-or-string (results) "Convert RESULTS to an elisp value. From 2a58795e1958210b96e9adee52b9dd68f7d1f50e Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 26 Oct 2010 06:34:16 +0200 Subject: [PATCH 2/5] Fix empty line bug in capture * lisp/org-capture.el (org-capture-empty-lines-before): (org-capture-empty-lines-after): Make sure the n=0 does not insert any newlines. Marcel van der Boom writes: > I'm in the process of migrating from org-remember to org-capture. > Pretty easy going so far, but it seems org-capture adds newlines, which > I think it should not do. > > My (test) capture-template is: > > (("t" "Todo" entry > (file "~/.outlet/GTD.org") > "* TODO %?" :prepend t :empty-lines 0) > > with the intention of inserting the captured task on the > first line of the file ~/.outlet/GTD.org. What happens when I capture > an task is this: > > > > * TODO Captured task > > > .... > > Both before and after the task is a newline. Also, when capturing and > cancelling the capture with C-c C-k the newlines remain whereas the > task is removed. --- lisp/org-capture.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 7915f7f0c..ef5825295 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -948,7 +948,7 @@ Point will be after the empty lines, so insertion can directly be done." (let ((pos (point))) (org-back-over-empty-lines) (delete-region (point) pos) - (newline n))) + (if (> n 0) (newline n)))) (defun org-capture-empty-lines-after (&optional n) "Arrange for the correct number of empty lines after the inserted string. @@ -957,7 +957,7 @@ Point will remain at the first line after the inserted text." (org-back-over-empty-lines) (while (looking-at "[ \t]*\n") (replace-match "")) (let ((pos (point))) - (newline n) + (if (> n 0) (newline n)) (goto-char pos))) (defvar org-clock-marker) ; Defined in org.el From eab8ea968779c14966ee085ee36ca74c1021cc5d Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 26 Oct 2010 07:10:48 +0200 Subject: [PATCH 3/5] Minor fixes --- lisp/org-docbook.el | 2 +- lisp/org-html.el | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index a087edb5f..4f1cc9aaa 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1006,7 +1006,7 @@ publishing directory." (org-export-docbook-close-para-maybe) (insert (org-export-docbook-finalize-table (org-format-table-html table-buffer table-orig-buffer - 'docbook))))) + 'no-css))))) (t ;; Normal lines diff --git a/lisp/org-html.el b/lisp/org-html.el index f4b1f17dc..be7dba21d 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1838,13 +1838,14 @@ lang=\"%s\" xml:lang=\"%s\"> nil)))) (defvar org-table-number-regexp) ; defined in org-table.el -(defun org-format-table-html (lines olines &optional docbook) - "Find out which HTML converter to use and return the HTML code." +(defun org-format-table-html (lines olines &optional no-css) + "Find out which HTML converter to use and return the HTML code. +NO-CSS is passed to the exporter." (if (stringp lines) (setq lines (org-split-string lines "\n"))) (if (string-match "^[ \t]*|" (car lines)) ;; A normal org table - (org-format-org-table-html lines nil docbook) + (org-format-org-table-html lines nil no-css) ;; Table made by table.el - test for spanning (let* ((hlines (delq nil (mapcar (lambda (x) @@ -1865,8 +1866,12 @@ lang=\"%s\" xml:lang=\"%s\"> (org-format-table-table-html-using-table-generate-source olines))))) (defvar org-table-number-fraction) ; defined in org-table.el -(defun org-format-org-table-html (lines &optional splice docbook) - "Format a table into HTML." +(defun org-format-org-table-html (lines &optional splice no-css) + "Format a table into HTML. +LINES is a list of lines. Optional argument SPLICE means, do not +insert header and surrounding tags, just format the lines. +Optional argument NO-CSS means use XHTML attributes instead of CSS +for formatting. This is required for the DocBook exporter." (require 'org-table) ;; Get rid of hlines at beginning and end (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines))) @@ -1965,7 +1970,9 @@ lang=\"%s\" xml:lang=\"%s\"> org-table-number-fraction) "right" "left"))) (push align aligns) - (format "%s%s" + (format (if no-css + "%s%s" + "%s%s") (if (memq gr '(:start :startend)) (prog1 (if colgropen @@ -1997,7 +2004,7 @@ lang=\"%s\" xml:lang=\"%s\"> (if (not org-export-html-table-align-individual-fields) "" (setq n (string-to-number (match-string 1 txt))) - (format (if docbook " align=\"%s\"" " class=\"%s\"") + (format (if no-css " align=\"%s\"" " class=\"%s\"") (or (nth n aligns) "left")))) x)) html)) From 3ffb50b0b7dc092a8d718e06ad0843100d82078b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 26 Oct 2010 07:18:31 +0200 Subject: [PATCH 4/5] Mention the direct git snapshot link on the homepage --- ORGWEBPAGE/index.org | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ORGWEBPAGE/index.org b/ORGWEBPAGE/index.org index ecad26c05..5063c04ad 100644 --- a/ORGWEBPAGE/index.org +++ b/ORGWEBPAGE/index.org @@ -145,8 +145,9 @@ formats. Follow the instructions for [[http://orgmode.org/manual/Installation.h You can check out the latest Org development version (along with every release we ever had) by using git. The git repository is [[http://repo.or.cz/w/org-mode.git][browsable -online]]. To get a local clone use something like the following (from -the command line....): +online]]. At any time you can get a [[http://repo.or.cz/w/org-mode.git/snapshot][snapshot]] of the files in it. To +get a local clone of the repository use something like the following +(from the command line....): : git clone git://repo.or.cz/org-mode.git From 47107b661224e696611a2bb7cbab3204444403e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= Date: Sun, 24 Oct 2010 22:01:47 +0200 Subject: [PATCH 5/5] Sexp diary entries may retrurn a list * lisp/org-agenda.el (org-agenda-get-sexps): Handle lists as return values from diary entries * lisp/org-bbdb.el (org-bbdb-anniversaries): Handle lists of anniversaries * lisp/org.el (org-diary-sexp-entry): Handle lists as return values from diary entries. ukasz Stelmach writes: > I've disovered, that %%(org-bbdb-anniversaries) returns (as every other > sexp) a string. Which is OK if there is only one. > > Anniversaries: John Doe's 10th wedding anniversary > > Unfortunately the agenda view becomes awful if we have noted Jane's > weeding date too > > Anniversaries: John Doe's 10th wedding anniversary; Jane Doe's 10th wedding anniversary > > And what if we know 3 Eves and 5 Adams and it's Christmas Eve? (Hint: > their name day) [...] As Thomas Bauman pointed out, there are functions that can be used in sexps which return cons cells like this (nil . "Full Moon 3:35am (CEST)") (this one is diary-lunar-phases), these aren't properly supported by the previous version of my patch. This one can distinguish between such a cons cell and a "real" list. ("John Doe's 10th wedding anniversary" "Jane Doe's 10th wedding anniversary") This is because (consp (cdr '(a . b))) ; => nil so org-diary-sexp-entry can be made return (cdr result) only in case of the former cons cell. The third condition in the `cond' block is IMHO enough as it is now, but if you think adding (listp (cdr result)) may help then be it. --- lisp/org-agenda.el | 23 +++++++++++++---------- lisp/org-bbdb.el | 3 +-- lisp/org.el | 3 +++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index ede62e8c4..8544a620a 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4499,17 +4499,20 @@ the documentation of `org-diary'." category (org-get-category beg) todo-state (org-get-todo-state)) - (if (string-match "\\S-" result) - (setq txt result) - (setq txt "SEXP entry returned empty string")) + (dolist (r (if (stringp result) + (list result) + result)) ;; we expect a list here + (if (string-match "\\S-" r) + (setq txt r) + (setq txt "SEXP entry returned empty string")) - (setq txt (org-format-agenda-item - "" txt category tags 'time)) - (org-add-props txt props 'org-marker marker) - (org-add-props txt nil - 'org-category category 'date date 'todo-state todo-state - 'type "sexp") - (push txt ee)))) + (setq txt (org-format-agenda-item + "" txt category tags 'time)) + (org-add-props txt props 'org-marker marker) + (org-add-props txt nil + 'org-category category 'date date 'todo-state todo-state + 'type "sexp") + (push txt ee))))) (nreverse ee))) (defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks) diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index 53514f786..0d3134d33 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -338,8 +338,7 @@ This is used by Org to re-create the anniversary hash table." (setq text (append text (list tmp))) (setq text (list tmp))))) )) - (when text - (mapconcat 'identity text "; ")))) + text)) (defun org-bbdb-complete-link () "Read a bbdb link with name completion." diff --git a/lisp/org.el b/lisp/org.el index 4a037fece..c4c64ee5d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15026,7 +15026,10 @@ D may be an absolute day number, or a calendar-type list (month day year)." (sleep-for 2)))))) (cond ((stringp result) result) ((and (consp result) + (not (consp (cdr result))) (stringp (cdr result))) (cdr result)) + ((and (consp result) + (stringp (car result))) result) (result entry) (t nil))))