diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-08-06 12:49:02 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-08-06 12:49:02 +0200 |
commit | 2b1d745c09616c5e449b1f9c8d8f205127fa7da9 (patch) | |
tree | 7ad43ea606293ccdbaff1988ca0ca78fb4cc7cdb | |
parent | 2ed0545b9948c088d67b15bdb60000e0e8ed8d6b (diff) | |
parent | 9330ad5b8106f0c6c0810c993db2f0def1741f63 (diff) | |
download | org-mode-2b1d745c09616c5e449b1f9c8d8f205127fa7da9.tar.gz |
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
Conflicts:
lisp/org.el
-rw-r--r-- | lisp/ob-keys.el | 4 | ||||
-rw-r--r-- | lisp/ob-lob.el | 2 | ||||
-rw-r--r-- | lisp/ob-tangle.el | 4 | ||||
-rw-r--r-- | lisp/ob.el | 25 | ||||
-rw-r--r-- | lisp/org.el | 9 |
5 files changed, 31 insertions, 13 deletions
diff --git a/lisp/ob-keys.el b/lisp/ob-keys.el index 837db24..e9ba3d9 100644 --- a/lisp/ob-keys.el +++ b/lisp/ob-keys.el @@ -52,8 +52,8 @@ functions which are assigned key bindings, and see ("\C-p" . org-babel-previous-src-block) ("n" . org-babel-next-src-block) ("\C-n" . org-babel-next-src-block) - ("e" . org-babel-execute-src-block) - ("\C-e" . org-babel-execute-src-block) + ("e" . org-babel-execute-maybe) + ("\C-e" . org-babel-execute-maybe) ("o" . org-babel-open-src-block-result) ("\C-o" . org-babel-open-src-block-result) ("\C-v" . org-babel-expand-src-block) diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el index f0f9438..8c207f7 100644 --- a/lisp/ob-lob.el +++ b/lisp/ob-lob.el @@ -77,8 +77,6 @@ if so then run the appropriate source block from the Library." (let ((info (org-babel-lob-get-info))) (if (nth 0 info) (progn (org-babel-lob-execute info) t) nil))) -(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-lob-execute-maybe) - ;;;###autoload (defun org-babel-lob-get-info () "Return a Library of Babel function call as a string. diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 7464f59..a7ba072 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -234,7 +234,9 @@ code blocks by language." (setq current-heading new-heading)) (setq block-counter (+ 1 block-counter)))) (replace-regexp-in-string "[ \t]" "-" - (nth 4 (org-heading-components)))) + (condition-case nil + (nth 4 (org-heading-components)) + (error (buffer-file-name))))) (let* ((link (progn (call-interactively 'org-store-link) (org-babel-clean-text-properties (car (pop org-stored-links))))) @@ -195,17 +195,26 @@ of potentially harmful code." (error "evaluation aborted")))) ;;;###autoload +(defun org-babel-execute-safely-maybe () + (unless org-babel-no-eval-on-ctrl-c-ctrl-c + (org-babel-execute-maybe))) + +(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-execute-safely-maybe) + +;;;###autoload +(defun org-babel-execute-maybe () + (interactive) + (or (org-babel-execute-src-block-maybe) + (org-babel-lob-execute-maybe))) + (defun org-babel-execute-src-block-maybe () "Conditionally execute a source block. Detect if this is context for a Babel src-block and if so then run `org-babel-execute-src-block'." (interactive) - (if (not org-babel-no-eval-on-ctrl-c-ctrl-c) - (let ((info (org-babel-get-src-block-info))) - (if info - (progn (org-babel-execute-src-block current-prefix-arg info) t) nil)) - nil)) -(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-execute-src-block-maybe) + (let ((info (org-babel-get-src-block-info))) + (if info + (progn (org-babel-execute-src-block current-prefix-arg info) t) nil))) ;;;###autoload (defun org-babel-expand-src-block-maybe () @@ -298,6 +307,7 @@ can not be resolved.") ;;; functions (defvar call-process-region) ;;;###autoload + (defun org-babel-execute-src-block (&optional arg info params) "Execute the current source code block. Insert the results of execution into the buffer. Source code @@ -413,6 +423,9 @@ session." (body (nth 1 info)) (params (nth 2 info)) (session (cdr (assoc :session params))) + (dir (cdr (assoc :dir params))) + (default-directory + (or (and dir (file-name-as-directory dir)) default-directory)) (cmd (intern (concat "org-babel-load-session:" lang)))) (unless (fboundp cmd) (error "No org-babel-load-session function for %s!" lang)) diff --git a/lisp/org.el b/lisp/org.el index b0dd3c0..12cf7ff 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3077,7 +3077,7 @@ points to a file, `org-agenda-diary-entry' will be used instead." (defcustom org-format-latex-options '(:foreground default :background default :scale 1.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 - :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) + :html-resolution 140 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) "Options for creating images from LaTeX fragments. This is a property list with the following properties: :foreground the foreground color for images embedded in Emacs, e.g. \"Black\". @@ -3088,7 +3088,11 @@ This is a property list with the following properties: :html-foreground, :html-background, :html-scale the same numbers for HTML export. +<<<<<<< HEAD +======= +:html-resolution the resolution of images for HTML output +>>>>>>> 9330ad5b8106f0c6c0810c993db2f0def1741f63 :matchers a list indicating which matchers should be used to find LaTeX fragments. Valid members of this list are: \"begin\" find environments @@ -15922,8 +15926,9 @@ Some of the options can be changed using the variable (fnh (if (featurep 'xemacs) (font-height (get-face-font 'default)) (face-attribute 'default :height nil))) + (res (plist-get options :html-resolution)) (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0)) - (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.)))))) + (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh res)))))) (fg (or (plist-get options (if buffer :foreground :html-foreground)) "Black")) (bg (or (plist-get options (if buffer :background :html-background)) |