0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 12:10:44 +00:00

Merge branch 'master' of orgmode.org:org-mode

This commit is contained in:
Carsten Dominik 2011-10-20 09:39:30 +02:00
commit 619da643a3
5 changed files with 56 additions and 35 deletions

View file

@ -169,9 +169,10 @@ If both match values are nil, return all contacts."
(when (not (fboundp 'completion-table-case-fold)) (when (not (fboundp 'completion-table-case-fold))
;; That function is new in Emacs 24... ;; That function is new in Emacs 24...
(defun completion-table-case-fold (table string pred action) (defun completion-table-case-fold (table &optional dont-fold)
(let ((completion-ignore-case t)) (lambda (string pred action)
(complete-with-action action table string pred)))) (let ((completion-ignore-case (not dont-fold)))
(complete-with-action action table string pred)))))
(defun org-contacts-complete-name (&optional start) (defun org-contacts-complete-name (&optional start)
"Complete text at START with a user name and email." "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 the user has an email address, append USER <EMAIL>.
if email collect (org-contacts-format-email contact-name email)) if email collect (org-contacts-format-email contact-name email))
", "))))) ", ")))))
(list start end (if org-contacts-completion-ignore-case (list start end (completion-table-case-fold completion-list (not org-contacts-completion-ignore-case)))))
(apply-partially #'completion-table-case-fold completion-list)
completion-list))))
(defun org-contacts-message-complete-function () (defun org-contacts-message-complete-function ()
"Function used in `completion-at-point-functions' in `message-mode'." "Function used in `completion-at-point-functions' in `message-mode'."

View file

@ -205,6 +205,8 @@ export that region, otherwise export the entire body."
(org-export-htmlize-output-type 'inline-css) (org-export-htmlize-output-type 'inline-css)
;; makes the replies with ">"s look nicer ;; makes the replies with ">"s look nicer
(org-export-preserve-breaks org-mime-preserve-breaks) (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 ;; to hold attachments for inline html images
(html-and-images (html-and-images
(org-mime-replace-images (org-mime-replace-images

View file

@ -184,7 +184,13 @@ FILE-MEMBERS.
Use options 1, 2 or 3 only if styles.xml alone suffices for Use options 1, 2 or 3 only if styles.xml alone suffices for
achieving the desired formatting. Use option 4, if the styles.xml achieving the desired formatting. Use option 4, if the styles.xml
references additional files like header and footer images for 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 :group 'org-export-odt
:type :type
'(choice '(choice
@ -197,6 +203,10 @@ achieving the desired formattting."
(file :tag " Member" "styles.xml") (file :tag " Member" "styles.xml")
(repeat (file :tag "Member")))))) (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-tmpdir-prefix "odt-")
(defconst org-export-odt-bookmark-prefix "OrgXref.") (defconst org-export-odt-bookmark-prefix "OrgXref.")
(defcustom org-export-odt-use-bookmarks-for-internal-links t (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))) (org-export-odt-format-formula thefile href)))
(defun org-odt-is-formula-link-p (file) (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 (defun org-odt-format-org-link (opt-plist type-1 path fragment desc attr
descp) descp)
@ -1750,7 +1761,9 @@ visually."
(org-odt-update-meta-file opt-plist) (org-odt-update-meta-file opt-plist)
;; write styles file ;; 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 ;; Update styles.xml - take care of outline numbering
(with-current-buffer (with-current-buffer
@ -2099,7 +2112,7 @@ visually."
To disable outline numbering pass a LEVEL of 0." To disable outline numbering pass a LEVEL of 0."
(goto-char (point-min)) (goto-char (point-min))
(let ((regex (let ((regex
"<text:outline-level-style\\(.*\\)text:level=\"\\([^\"]*\\)\"\\(.*\\)>") "<text:outline-level-style\\([^>]*\\)text:level=\"\\([^\"]*\\)\"\\([^>]*\\)>")
(replacement (replacement
"<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">")) "<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
(while (re-search-forward regex nil t) (while (re-search-forward regex nil t)

View file

@ -84,31 +84,38 @@ This function is called by `org-babel-execute-src-block'."
(insert (org-babel-expand-body:sql body params))) (insert (org-babel-expand-body:sql body params)))
(message command) (message command)
(shell-command command) (shell-command command)
(with-temp-buffer (if (or (member "scalar" result-params)
;; need to figure out what the delimiter is for the header row (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 (with-temp-buffer
(insert-file-contents out-file) ;; need to figure out what the delimiter is for the header row
(goto-char (point-min)) (with-temp-buffer
(when (re-search-forward "^\\(-+\\)[^-]" nil t) (insert-file-contents out-file)
(setq header-delim (match-string-no-properties 1))) (goto-char (point-min))
(goto-char (point-max)) (when (re-search-forward "^\\(-+\\)[^-]" nil t)
(forward-char -1) (setq header-delim (match-string-no-properties 1)))
(while (looking-at "\n") (goto-char (point-max))
(delete-char 1) (forward-char -1)
(goto-char (point-max)) (while (looking-at "\n")
(forward-char -1)) (delete-char 1)
(write-file out-file)) (goto-char (point-max))
(org-table-import out-file '(16)) (forward-char -1))
(org-babel-reassemble-table (write-file out-file))
(mapcar (lambda (x) (org-table-import out-file '(16))
(if (string= (car x) header-delim) (org-babel-reassemble-table
'hline (mapcar (lambda (x)
x)) (if (string= (car x) header-delim)
(org-table-to-lisp)) 'hline
(org-babel-pick-name (cdr (assoc :colname-names params)) x))
(cdr (assoc :colnames params))) (org-table-to-lisp))
(org-babel-pick-name (cdr (assoc :rowname-names params)) (org-babel-pick-name (cdr (assoc :colname-names params))
(cdr (assoc :rownames 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) (defun org-babel-sql-expand-vars (body vars)
"Expand the variables held in VARS in BODY." "Expand the variables held in VARS in BODY."

View file

@ -1272,7 +1272,7 @@ of the vars, cnames and rnames."
(setq var (cons (car var) (org-babel-del-hlines (cdr var)))))) (setq var (cons (car var) (org-babel-del-hlines (cdr var))))))
var) var)
vars) vars)
cnames rnames))) (reverse cnames) (reverse rnames))))
(defun org-babel-reassemble-table (table colnames rownames) (defun org-babel-reassemble-table (table colnames rownames)
"Add column and row names to a table. "Add column and row names to a table.