瀏覽代碼

babel: more compiler satisfaction

Eric Schulte 15 年之前
父節點
當前提交
0e939a7df5
共有 4 個文件被更改,包括 16 次插入3 次删除
  1. 9 0
      lisp/babel/langs/ob-sh.el
  2. 2 1
      lisp/babel/ob-exp.el
  3. 4 1
      lisp/babel/ob-ref.el
  4. 1 1
      lisp/babel/ob-tangle.el

+ 9 - 0
lisp/babel/langs/ob-sh.el

@@ -31,6 +31,15 @@
 ;;; Code:
 (require 'ob)
 (require 'shell)
+(eval-when-compile
+  (require 'cl))
+
+(defun-function org-babel-ref-variables "ob-ref" (params))
+(defun-function org-babel-comint-in-buffer "ob-comint" (buffer &rest body))
+(defun-function org-babel-comint-wait-for-output "ob-comint" (buffer))
+(defun-function org-babel-comint-buffer-livep "ob-comint" (buffer))
+(defun-function org-babel-comint-with-output "ob-comint" (meta &rest body))
+(defun-function orgtbl-to-generic "org-table" (table params))
 
 (org-babel-add-interpreter "sh")
 

+ 2 - 1
lisp/babel/ob-exp.el

@@ -194,6 +194,7 @@ code block respecting the value of the :exports header argument."
 		     "\n\n"
 		     (org-babel-exp-results info type))))))
 
+(defvar backend)
 (defun org-babel-exp-code (info type)
   "Return the code the current code block in a manner suitable
 for exportation by org-mode.  This function is called by
@@ -229,7 +230,7 @@ evaluated."
           ((eq backend 'html)
            (format "\n#+HTML: <label class=\"org-src-name\">%s</label>\n"
 		   call-line))
-          ((t (format ": %s\n" call-line)))))))))
+          ((format ": %s\n" call-line))))))))
 
 (defun org-babel-exp-results (info type &optional silent)
   "Return the results of the current code block in a manner

+ 4 - 1
lisp/babel/ob-ref.el

@@ -105,7 +105,10 @@ return nil."
       ;; if ref is indexed grab the indices -- beware nested indicies
       (when (and (string-match "\\[\\(.+\\)\\]" ref)
 		 (let ((str (substring ref 0 (match-beginning 0))))
-		   (= (count ?( str) (count ?) str))))
+		   (= (length (org-remove-if-not
+			       (lambda (el) (equal ?( el)) (string-to-list "((eric))")))
+		      (length (org-remove-if-not
+			       (lambda (el) (equal ?) el)) (string-to-list "((eric))"))))))
         (setq index (match-string 1 ref))
         (setq ref (substring ref 0 (match-beginning 0))))
       ;; assign any arguments to pass to source block

+ 1 - 1
lisp/babel/ob-tangle.el

@@ -55,7 +55,7 @@ org-mode formatted FILE.  This function will first export the
 source code using `org-babel-tangle' and then load the resulting
 file using `load-file'."
   (flet ((age (file)
-              (time-to-seconds
+              (float-time
                (time-subtract (current-time)
                               (nth 5 (or (file-attributes (file-truename file))
                                          (file-attributes file)))))))