Browse Source

Switch some Babel-related libraries to lexical binding

* lisp/ob-sed.el:
* lisp/ob-shen.el:
(org-babel-execute:shen):
* lisp/ob-sql.el:
(org-babel-prep-session:sql):
* lisp/ob-sqlite.el:
(org-babel-execute:sqlite):
(org-babel-prep-session:sqlite):
* lisp/ob-stan.el:
(org-babel-prep-session:stan):
* lisp/ob-table.el: Switch some libraries to lexical binding.
Nicolas Goaziou 3 years ago
parent
commit
7706714200
6 changed files with 12 additions and 14 deletions
  1. 1 1
      lisp/ob-sed.el
  2. 3 4
      lisp/ob-shen.el
  3. 2 2
      lisp/ob-sql.el
  4. 3 4
      lisp/ob-sqlite.el
  5. 2 2
      lisp/ob-stan.el
  6. 1 1
      lisp/ob-table.el

+ 1 - 1
lisp/ob-sed.el

@@ -1,4 +1,4 @@
-;;; ob-sed.el --- org-babel functions for sed scripts
+;;; ob-sed.el --- Babel Functions for Sed Scripts    -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2015 Free Software Foundation
 

+ 3 - 4
lisp/ob-shen.el

@@ -1,4 +1,4 @@
-;;; ob-shen.el --- org-babel functions for Shen
+;;; ob-shen.el --- Babel Functions for Shen          -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
 
@@ -63,14 +63,13 @@
   "Execute a block of Shen code with org-babel.
 This function is called by `org-babel-execute-src-block'"
   (require 'inf-shen)
-  (let* ((result-type (cdr (assoc :result-type params)))
-	 (result-params (cdr (assoc :result-params params)))
+  (let* ((result-params (cdr (assoc :result-params params)))
          (full-body (org-babel-expand-body:shen body params)))
     (let ((results
            (with-temp-buffer
              (insert full-body)
              (call-interactively #'shen-eval-defun))))
-      (org-babel-result-cond result-params 
+      (org-babel-result-cond result-params
         results
         (condition-case nil (org-babel-script-escape results)
           (error results))))))

+ 2 - 2
lisp/ob-sql.el

@@ -1,4 +1,4 @@
-;;; ob-sql.el --- org-babel functions for sql evaluation
+;;; ob-sql.el --- Babel Functions for SQL            -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
 
@@ -217,7 +217,7 @@ This function is called by `org-babel-execute-src-block'."
    vars)
   body)
 
-(defun org-babel-prep-session:sql (session params)
+(defun org-babel-prep-session:sql (_session _params)
   "Raise an error because Sql sessions aren't implemented."
   (error "SQL sessions not yet implemented"))
 

+ 3 - 4
lisp/ob-sqlite.el

@@ -1,4 +1,4 @@
-;;; ob-sqlite.el --- org-babel functions for sqlite database interaction
+;;; ob-sqlite.el --- Babel Functions for SQLite Databases -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
 
@@ -68,8 +68,7 @@ This function is called by `org-babel-execute-src-block'."
 	(others (delq nil (mapcar
 			   (lambda (arg) (car (assoc arg params)))
 			   (list :header :echo :bail :column
-				 :csv :html :line :list))))
-	exit-code)
+				 :csv :html :line :list)))))
     (unless db (error "ob-sqlite: can't evaluate without a database"))
     (with-temp-buffer
       (insert
@@ -150,7 +149,7 @@ This function is called by `org-babel-execute-src-block'."
       (cons (car table) (cons 'hline (cdr table)))
     table))
 
-(defun org-babel-prep-session:sqlite (session params)
+(defun org-babel-prep-session:sqlite (_session _params)
   "Raise an error because support for SQLite sessions isn't implemented.
 Prepare SESSION according to the header arguments specified in PARAMS."
   (error "SQLite sessions not yet implemented"))

+ 2 - 2
lisp/ob-stan.el

@@ -1,4 +1,4 @@
-;;; ob-stan.el --- org-babel functions for Stan
+;;; ob-stan.el --- Babel Functions for Stan          -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
@@ -76,7 +76,7 @@ Otherwise, write the Stan code directly to the named file."
 	(call-process-shell-command (concat "make " file))))
     nil))		; Signal that output has been written to file.
 
-(defun org-babel-prep-session:stan (session params)
+(defun org-babel-prep-session:stan (_session _params)
   "Return an error because Stan does not support sessions."
   (user-error "Stan does not support sessions"))
 

+ 1 - 1
lisp/ob-table.el

@@ -1,4 +1,4 @@
-;;; ob-table.el --- support for calling org-babel functions from tables
+;;; ob-table.el --- Support for Calling Babel Functions from Tables -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2009-2015 Free Software Foundation, Inc.