Explorar el Código

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Conflicts:
	lisp/org.el
Carsten Dominik hace 14 años
padre
commit
2b1d745c09
Se han modificado 5 ficheros con 31 adiciones y 13 borrados
  1. 2 2
      lisp/ob-keys.el
  2. 0 2
      lisp/ob-lob.el
  3. 3 1
      lisp/ob-tangle.el
  4. 19 6
      lisp/ob.el
  5. 7 2
      lisp/org.el

+ 2 - 2
lisp/ob-keys.el

@@ -52,8 +52,8 @@ functions which are assigned key bindings, and see
     ("\C-p" . org-babel-previous-src-block)
     ("\C-p" . org-babel-previous-src-block)
     ("n" . org-babel-next-src-block)
     ("n" . org-babel-next-src-block)
     ("\C-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)
     ("o" . org-babel-open-src-block-result)
     ("\C-o" . org-babel-open-src-block-result)
     ("\C-o" . org-babel-open-src-block-result)
     ("\C-v" . org-babel-expand-src-block)
     ("\C-v" . org-babel-expand-src-block)

+ 0 - 2
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)))
   (let ((info (org-babel-lob-get-info)))
     (if (nth 0 info) (progn (org-babel-lob-execute info) t) nil)))
     (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
 ;;;###autoload
 (defun org-babel-lob-get-info ()
 (defun org-babel-lob-get-info ()
   "Return a Library of Babel function call as a string.
   "Return a Library of Babel function call as a string.

+ 3 - 1
lisp/ob-tangle.el

@@ -234,7 +234,9 @@ code blocks by language."
 	       (setq current-heading new-heading))
 	       (setq current-heading new-heading))
 	   (setq block-counter (+ 1 block-counter))))
 	   (setq block-counter (+ 1 block-counter))))
        (replace-regexp-in-string "[ \t]" "-"
        (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)
       (let* ((link (progn (call-interactively 'org-store-link)
                           (org-babel-clean-text-properties
                           (org-babel-clean-text-properties
 			   (car (pop org-stored-links)))))
 			   (car (pop org-stored-links)))))

+ 19 - 6
lisp/ob.el

@@ -195,17 +195,26 @@ of potentially harmful code."
       (error "evaluation aborted"))))
       (error "evaluation aborted"))))
 
 
 ;;;###autoload
 ;;;###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 ()
 (defun org-babel-execute-src-block-maybe ()
   "Conditionally execute a source block.
   "Conditionally execute a source block.
 Detect if this is context for a Babel src-block and if so
 Detect if this is context for a Babel src-block and if so
 then run `org-babel-execute-src-block'."
 then run `org-babel-execute-src-block'."
   (interactive)
   (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
 ;;;###autoload
 (defun org-babel-expand-src-block-maybe ()
 (defun org-babel-expand-src-block-maybe ()
@@ -298,6 +307,7 @@ can not be resolved.")
 ;;; functions
 ;;; functions
 (defvar call-process-region)
 (defvar call-process-region)
 ;;;###autoload
 ;;;###autoload
+
 (defun org-babel-execute-src-block (&optional arg info params)
 (defun org-babel-execute-src-block (&optional arg info params)
   "Execute the current source code block.
   "Execute the current source code block.
 Insert the results of execution into the buffer.  Source code
 Insert the results of execution into the buffer.  Source code
@@ -413,6 +423,9 @@ session."
          (body (nth 1 info))
          (body (nth 1 info))
          (params (nth 2 info))
          (params (nth 2 info))
          (session (cdr (assoc :session params)))
          (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))))
 	 (cmd (intern (concat "org-babel-load-session:" lang))))
     (unless (fboundp cmd)
     (unless (fboundp cmd)
       (error "No org-babel-load-session function for %s!" lang))
       (error "No org-babel-load-session function for %s!" lang))

+ 7 - 2
lisp/org.el

@@ -3077,7 +3077,7 @@ points to a file, `org-agenda-diary-entry' will be used instead."
 (defcustom org-format-latex-options
 (defcustom org-format-latex-options
   '(:foreground default :background default :scale 1.0
   '(:foreground default :background default :scale 1.0
     :html-foreground "Black" :html-background "Transparent" :html-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.
   "Options for creating images from LaTeX fragments.
 This is a property list with the following properties:
 This is a property list with the following properties:
 :foreground  the foreground color for images embedded in Emacs, e.g. \"Black\".
 :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
 :html-foreground, :html-background, :html-scale
              the same numbers for HTML export.
              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
 :matchers    a list indicating which matchers should be used to
              find LaTeX fragments.  Valid members of this list are:
              find LaTeX fragments.  Valid members of this list are:
              \"begin\"  find environments
              \"begin\"  find environments
@@ -15922,8 +15926,9 @@ Some of the options can be changed using the variable
 	 (fnh (if (featurep 'xemacs)
 	 (fnh (if (featurep 'xemacs)
                   (font-height (get-face-font 'default))
                   (font-height (get-face-font 'default))
                 (face-attribute 'default :height nil)))
                 (face-attribute 'default :height nil)))
+	 (res (plist-get options :html-resolution))
 	 (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0))
 	 (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))
 	 (fg (or (plist-get options (if buffer :foreground :html-foreground))
 		 "Black"))
 		 "Black"))
 	 (bg (or (plist-get options (if buffer :background :html-background))
 	 (bg (or (plist-get options (if buffer :background :html-background))