Kyle Meyer 9 роки тому
батько
коміт
15d591ee44
2 змінених файлів з 19 додано та 10 видалено
  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
 the outer-most code block.")
 
+(defvar *this*)
+
 ;;;###autoload
 (defun org-babel-execute-src-block (&optional arg info params)
   "Execute the current source code block.
@@ -659,7 +661,8 @@ block."
 	    (skip-chars-forward " \t")
 	    (let ((result (org-babel-read-result)))
 	      (message (replace-regexp-in-string
-			"%" "%%" (format "%S" result))) result)))
+			"%" "%%" (format "%S" result)))
+	      result)))
 	 ((org-babel-confirm-evaluate info)
 	  (let* ((lang (nth 0 info))
 		 (result-params (cdr (assoc :result-params params)))
@@ -754,7 +757,7 @@ org-babel-expand-body:lang function."
 	       "\n")))
 
 ;;;###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 according to the source code block's header
 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)))
     (dolist (new-list others)
       (dolist (arg-pair new-list)
-	(let ((header (car arg-pair))
-	      (args (cdr arg-pair)))
+	(let ((header (car arg-pair)))
 	  (setq results
 		(cons arg-pair (cl-remove-if
 				(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)
 
 ;;;###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.
 Evaluate the header arguments for the source block before
 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)
 
 ;;;###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."
   (interactive "P")
   (let ((swap-windows
@@ -1096,7 +1098,13 @@ end-body --------- point at the end of the body"
 		   (body (match-string 5))
 		   (beg-body (match-beginning 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)))))
        (unless visited-p (kill-buffer to-be-removed))
        (goto-char point))))
@@ -1623,7 +1631,7 @@ Note: this function removes any hlines in TABLE."
 	 (rownames (funcall (lambda ()
 			      (let ((tp table))
 				(mapcar
-				 (lambda (row)
+				 (lambda (_row)
 				   (prog1
 				       (pop (car tp))
 				     (setq tp (cdr tp))))
@@ -1801,7 +1809,8 @@ buffer or nil if no such result exists."
       (catch 'is-a-code-block
 	(when (re-search-forward
 	       (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)))
 		     (or (beginning-of-line 1)
 			 (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))
 				   'face))
 	  (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))
 	(add-text-properties (match-beginning 0) (match-end 0)
 			     (list 'mouse-face 'highlight