Browse Source

Merge branch 'maint'

Kyle Meyer 9 years ago
parent
commit
15d591ee44
2 changed files with 19 additions and 10 deletions
  1. 18 9
      lisp/ob-core.el
  2. 1 1
      lisp/org.el

+ 18 - 9
lisp/ob-core.el

@@ -614,6 +614,8 @@ multiple blocks are being executed (e.g., in chained execution
 through use of the :var header argument) this marker points to
 through use of the :var header argument) this marker points to
 the outer-most code block.")
 the outer-most code block.")
 
 
+(defvar *this*)
+
 ;;;###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.
@@ -659,7 +661,8 @@ block."
 	    (skip-chars-forward " \t")
 	    (skip-chars-forward " \t")
 	    (let ((result (org-babel-read-result)))
 	    (let ((result (org-babel-read-result)))
 	      (message (replace-regexp-in-string
 	      (message (replace-regexp-in-string
-			"%" "%%" (format "%S" result))) result)))
+			"%" "%%" (format "%S" result)))
+	      result)))
 	 ((org-babel-confirm-evaluate info)
 	 ((org-babel-confirm-evaluate info)
 	  (let* ((lang (nth 0 info))
 	  (let* ((lang (nth 0 info))
 		 (result-params (cdr (assoc :result-params params)))
 		 (result-params (cdr (assoc :result-params params)))
@@ -754,7 +757,7 @@ org-babel-expand-body:lang function."
 	       "\n")))
 	       "\n")))
 
 
 ;;;###autoload
 ;;;###autoload
-(defun org-babel-expand-src-block (&optional arg info params)
+(defun org-babel-expand-src-block (&optional _arg info params)
   "Expand the current source code block.
   "Expand the current source code block.
 Expand according to the source code block's header
 Expand according to the source code block's header
 arguments and pop open the results in a preview buffer."
 arguments and pop open the results in a preview buffer."
@@ -807,8 +810,7 @@ arguments and pop open the results in a preview buffer."
   (let ((results (copy-sequence original)))
   (let ((results (copy-sequence original)))
     (dolist (new-list others)
     (dolist (new-list others)
       (dolist (arg-pair new-list)
       (dolist (arg-pair new-list)
-	(let ((header (car arg-pair))
-	      (args (cdr arg-pair)))
+	(let ((header (car arg-pair)))
 	  (setq results
 	  (setq results
 		(cons arg-pair (cl-remove-if
 		(cons arg-pair (cl-remove-if
 				(lambda (pair) (equal header (car pair)))
 				(lambda (pair) (equal header (car pair)))
@@ -901,7 +903,7 @@ arguments and pop open the results in a preview buffer."
 (add-hook 'org-tab-first-hook 'org-babel-header-arg-expand)
 (add-hook 'org-tab-first-hook 'org-babel-header-arg-expand)
 
 
 ;;;###autoload
 ;;;###autoload
-(defun org-babel-load-in-session (&optional arg info)
+(defun org-babel-load-in-session (&optional _arg info)
   "Load the body of the current source-code block.
   "Load the body of the current source-code block.
 Evaluate the header arguments for the source block before
 Evaluate the header arguments for the source block before
 entering the session.  After loading the body this pops open the
 entering the session.  After loading the body this pops open the
@@ -970,7 +972,7 @@ with a prefix argument then this is passed on to
 (defvar org-src-window-setup)
 (defvar org-src-window-setup)
 
 
 ;;;###autoload
 ;;;###autoload
-(defun org-babel-switch-to-session-with-code (&optional arg info)
+(defun org-babel-switch-to-session-with-code (&optional arg _info)
   "Switch to code buffer and display session."
   "Switch to code buffer and display session."
   (interactive "P")
   (interactive "P")
   (let ((swap-windows
   (let ((swap-windows
@@ -1096,7 +1098,13 @@ end-body --------- point at the end of the body"
 		   (body (match-string 5))
 		   (body (match-string 5))
 		   (beg-body (match-beginning 5))
 		   (beg-body (match-beginning 5))
 		   (end-body (match-end 5)))
 		   (end-body (match-end 5)))
-	       ,@body
+               ;; Silence byte-compiler in case `body' doesn't use all
+               ;; those variables.
+               (ignore full-block beg-block end-block lang
+                       beg-lang end-lang switches beg-switches
+                       end-switches header-args beg-header-args
+                       end-header-args body beg-body end-body)
+               ,@body
 	       (goto-char end-block)))))
 	       (goto-char end-block)))))
        (unless visited-p (kill-buffer to-be-removed))
        (unless visited-p (kill-buffer to-be-removed))
        (goto-char point))))
        (goto-char point))))
@@ -1623,7 +1631,7 @@ Note: this function removes any hlines in TABLE."
 	 (rownames (funcall (lambda ()
 	 (rownames (funcall (lambda ()
 			      (let ((tp table))
 			      (let ((tp table))
 				(mapcar
 				(mapcar
-				 (lambda (row)
+				 (lambda (_row)
 				   (prog1
 				   (prog1
 				       (pop (car tp))
 				       (pop (car tp))
 				     (setq tp (cdr tp))))
 				     (setq tp (cdr tp))))
@@ -1801,7 +1809,8 @@ buffer or nil if no such result exists."
       (catch 'is-a-code-block
       (catch 'is-a-code-block
 	(when (re-search-forward
 	(when (re-search-forward
 	       (concat org-babel-result-regexp
 	       (concat org-babel-result-regexp
-		       "[ \t]" (regexp-quote name) "[ \t]*[\n\f\v\r]") nil t)
+		       "[ \t]" (regexp-quote name) "[ \t]*[\n\f\v\r]")
+               nil t)
 	  (when (and (string= "name" (downcase (match-string 1)))
 	  (when (and (string= "name" (downcase (match-string 1)))
 		     (or (beginning-of-line 1)
 		     (or (beginning-of-line 1)
 			 (looking-at org-babel-src-block-regexp)
 			 (looking-at org-babel-src-block-regexp)

+ 1 - 1
lisp/org.el

@@ -5806,7 +5806,7 @@ prompted for."
     (let ((face (get-text-property (max (1- (match-beginning 0)) (point-min))
     (let ((face (get-text-property (max (1- (match-beginning 0)) (point-min))
 				   'face))
 				   'face))
 	  (link (org-match-string-no-properties 0)))
 	  (link (org-match-string-no-properties 0)))
-      (when (if (consp face) (memq 'org-tag face) (eq 'org-tag face))
+      (unless (if (consp face) (memq 'org-tag face) (eq 'org-tag face))
 	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(add-text-properties (match-beginning 0) (match-end 0)
 	(add-text-properties (match-beginning 0) (match-end 0)
 			     (list 'mouse-face 'highlight
 			     (list 'mouse-face 'highlight