summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2011-10-20 09:39:30 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2011-10-20 09:39:30 +0200
commit619da643a3a0975603b10e262671391d2101be69 (patch)
tree5561f62eb3b1a9e834c99a0ce09776532ca82316
parentd622d2f7091e47b6bc0c540b482fc148e7d74935 (diff)
parent92a01caa6deab2199cd16165f1cc685bbd95ba60 (diff)
downloadorg-mode-619da643a3a0975603b10e262671391d2101be69.tar.gz
Merge branch 'master' of orgmode.org:org-mode
-rw-r--r--contrib/lisp/org-contacts.el11
-rw-r--r--contrib/lisp/org-mime.el2
-rw-r--r--contrib/lisp/org-odt.el21
-rw-r--r--lisp/ob-sql.el55
-rw-r--r--lisp/ob.el2
5 files changed, 56 insertions, 35 deletions
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index f4d9cd7..4b21d26 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -169,9 +169,10 @@ If both match values are nil, return all contacts."
(when (not (fboundp 'completion-table-case-fold))
;; That function is new in Emacs 24...
- (defun completion-table-case-fold (table string pred action)
- (let ((completion-ignore-case t))
- (complete-with-action action table string pred))))
+ (defun completion-table-case-fold (table &optional dont-fold)
+ (lambda (string pred action)
+ (let ((completion-ignore-case (not dont-fold)))
+ (complete-with-action action table string pred)))))
(defun org-contacts-complete-name (&optional start)
"Complete text at START with a user name and email."
@@ -226,9 +227,7 @@ If both match values are nil, return all contacts."
;; If the user has an email address, append USER <EMAIL>.
if email collect (org-contacts-format-email contact-name email))
", ")))))
- (list start end (if org-contacts-completion-ignore-case
- (apply-partially #'completion-table-case-fold completion-list)
- completion-list))))
+ (list start end (completion-table-case-fold completion-list (not org-contacts-completion-ignore-case)))))
(defun org-contacts-message-complete-function ()
"Function used in `completion-at-point-functions' in `message-mode'."
diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
index 8d06faa..ec638c1 100644
--- a/contrib/lisp/org-mime.el
+++ b/contrib/lisp/org-mime.el
@@ -205,6 +205,8 @@ export that region, otherwise export the entire body."
(org-export-htmlize-output-type 'inline-css)
;; makes the replies with ">"s look nicer
(org-export-preserve-breaks org-mime-preserve-breaks)
+ ;; dvipng for inline latex because MathJax doesn't work in mail
+ (org-export-with-LaTeX-fragments "dvipng")
;; to hold attachments for inline html images
(html-and-images
(org-mime-replace-images
diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el
index f088b05..9ec99c3 100644
--- a/contrib/lisp/org-odt.el
+++ b/contrib/lisp/org-odt.el
@@ -184,7 +184,13 @@ FILE-MEMBERS.
Use options 1, 2 or 3 only if styles.xml alone suffices for
achieving the desired formatting. Use option 4, if the styles.xml
references additional files like header and footer images for
-achieving the desired formattting."
+achieving the desired formattting.
+
+Use \"#+ODT_STYLES_FILE: ...\" directive to set this variable on
+a per-file basis. For example,
+
+#+ODT_STYLES_FILE: \"/path/to/styles.xml\" or
+#+ODT_STYLES_FILE: (\"/path/to/file.ott\" (\"styles.xml\" \"image/hdr.png\"))."
:group 'org-export-odt
:type
'(choice
@@ -197,6 +203,10 @@ achieving the desired formattting."
(file :tag " Member" "styles.xml")
(repeat (file :tag "Member"))))))
+(eval-after-load 'org-exp
+ '(add-to-list 'org-export-inbuffer-options-extra
+ '("ODT_STYLES_FILE" :odt-styles-file)))
+
(defconst org-export-odt-tmpdir-prefix "odt-")
(defconst org-export-odt-bookmark-prefix "OrgXref.")
(defcustom org-export-odt-use-bookmarks-for-internal-links t
@@ -1277,7 +1287,8 @@ value of `org-export-odt-use-htmlfontify."
(org-export-odt-format-formula thefile href)))
(defun org-odt-is-formula-link-p (file)
- (member (downcase (file-name-extension file)) '("mathml")))
+ (let ((case-fold-search nil))
+ (string-match "\\.mathml\\'" file)))
(defun org-odt-format-org-link (opt-plist type-1 path fragment desc attr
descp)
@@ -1750,7 +1761,9 @@ visually."
(org-odt-update-meta-file opt-plist)
;; write styles file
- (org-odt-copy-styles-file)
+ (let ((styles-file (plist-get opt-plist :odt-styles-file)))
+ (org-odt-copy-styles-file (and styles-file
+ (read (org-trim styles-file)))))
;; Update styles.xml - take care of outline numbering
(with-current-buffer
@@ -2099,7 +2112,7 @@ visually."
To disable outline numbering pass a LEVEL of 0."
(goto-char (point-min))
(let ((regex
- "<text:outline-level-style\\(.*\\)text:level=\"\\([^\"]*\\)\"\\(.*\\)>")
+ "<text:outline-level-style\\([^>]*\\)text:level=\"\\([^\"]*\\)\"\\([^>]*\\)>")
(replacement
"<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
(while (re-search-forward regex nil t)
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index c526148..8d34356 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -84,31 +84,38 @@ This function is called by `org-babel-execute-src-block'."
(insert (org-babel-expand-body:sql body params)))
(message command)
(shell-command command)
- (with-temp-buffer
- ;; need to figure out what the delimiter is for the header row
+ (if (or (member "scalar" result-params)
+ (member "verbatim" result-params)
+ (member "html" result-params)
+ (member "code" result-params)
+ (equal (point-min) (point-max)))
+ (with-temp-buffer
+ (progn (insert-file-contents-literally out-file) (buffer-string)))
(with-temp-buffer
- (insert-file-contents out-file)
- (goto-char (point-min))
- (when (re-search-forward "^\\(-+\\)[^-]" nil t)
- (setq header-delim (match-string-no-properties 1)))
- (goto-char (point-max))
- (forward-char -1)
- (while (looking-at "\n")
- (delete-char 1)
- (goto-char (point-max))
- (forward-char -1))
- (write-file out-file))
- (org-table-import out-file '(16))
- (org-babel-reassemble-table
- (mapcar (lambda (x)
- (if (string= (car x) header-delim)
- 'hline
- x))
- (org-table-to-lisp))
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colnames params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rownames params)))))))
+ ;; need to figure out what the delimiter is for the header row
+ (with-temp-buffer
+ (insert-file-contents out-file)
+ (goto-char (point-min))
+ (when (re-search-forward "^\\(-+\\)[^-]" nil t)
+ (setq header-delim (match-string-no-properties 1)))
+ (goto-char (point-max))
+ (forward-char -1)
+ (while (looking-at "\n")
+ (delete-char 1)
+ (goto-char (point-max))
+ (forward-char -1))
+ (write-file out-file))
+ (org-table-import out-file '(16))
+ (org-babel-reassemble-table
+ (mapcar (lambda (x)
+ (if (string= (car x) header-delim)
+ 'hline
+ x))
+ (org-table-to-lisp))
+ (org-babel-pick-name (cdr (assoc :colname-names params))
+ (cdr (assoc :colnames params)))
+ (org-babel-pick-name (cdr (assoc :rowname-names params))
+ (cdr (assoc :rownames params))))))))
(defun org-babel-sql-expand-vars (body vars)
"Expand the variables held in VARS in BODY."
diff --git a/lisp/ob.el b/lisp/ob.el
index 487dcb0..0778fe0 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1272,7 +1272,7 @@ of the vars, cnames and rnames."
(setq var (cons (car var) (org-babel-del-hlines (cdr var))))))
var)
vars)
- cnames rnames)))
+ (reverse cnames) (reverse rnames))))
(defun org-babel-reassemble-table (table colnames rownames)
"Add column and row names to a table.