Browse Source

Use assq instead of assoc for :keywords

* lisp/ob-C.el (org-babel-C-execute):
* lisp/ob-J.el (org-babel-execute:J):
* lisp/ob-R.el (org-babel-edit-prep:R):
(org-babel-expand-body:R):
(org-babel-execute:R):
(org-babel-variable-assignments:R):
(org-babel-R-initiate-session):
* lisp/ob-abc.el (org-babel-execute:abc):
* lisp/ob-asymptote.el (org-babel-execute:asymptote):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
(org-babel-execute:clojure):
* lisp/ob-core.el (org-babel-expand-body:generic):
(org-babel-load-in-session):
(org-babel-initiate-session):
(org-babel-open-src-block-result):
(org-babel-process-params):
(org-babel-insert-result):
(org-babel-expand-noweb-references):
* lisp/ob-ditaa.el (org-babel-execute:ditaa):
* lisp/ob-dot.el (org-babel-execute:dot):
* lisp/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp):
(org-babel-execute:emacs-lisp):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-do-export):
(org-babel-exp-code):
* lisp/ob-forth.el (org-babel-execute:forth):
* lisp/ob-fortran.el (org-babel-execute:fortran):
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars):
(org-babel-expand-body:gnuplot):
(org-babel-execute:gnuplot):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-io.el (org-babel-execute:io):
* lisp/ob-java.el (org-babel-execute:java):
* lisp/ob-js.el (org-babel-execute:js):
* lisp/ob-latex.el (org-babel-execute:latex):
* lisp/ob-ledger.el (org-babel-execute:ledger):
* lisp/ob-lilypond.el (org-babel-lilypond-process-basic):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
(org-babel-execute:lisp):
* lisp/ob-lua.el (org-babel-execute:lua):
* lisp/ob-maxima.el (org-babel-execute:maxima):
* lisp/ob-mscgen.el (org-babel-execute:mscgen):
* lisp/ob-ocaml.el (org-babel-execute:ocaml):
* lisp/ob-octave.el (org-babel-execute:octave):
* lisp/ob-org.el (org-babel-execute:org):
* lisp/ob-perl.el (org-babel-execute:perl):
* lisp/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/ob-plantuml.el (org-babel-execute:plantuml):
* lisp/ob-python.el (org-babel-execute:python):
* lisp/ob-ruby.el (org-babel-execute:ruby):
* lisp/ob-sass.el (org-babel-execute:sass):
* lisp/ob-scala.el (org-babel-execute:scala):
* lisp/ob-scheme.el (org-babel-execute:scheme):
* lisp/ob-screen.el (org-babel-execute:screen):
(org-babel-prep-session:screen):
* lisp/ob-shell.el (org-babel-execute:shell):
(org-babel-variable-assignments:shell):
(org-babel-sh-evaluate):
* lisp/ob-shen.el (org-babel-execute:shen):
* lisp/ob-sql.el (org-babel-execute:sql):
* lisp/ob-sqlite.el (org-babel-execute:sqlite):
* lisp/ob-tangle.el (org-babel-tangle):
(org-babel-tangle-single-block):
* lisp/org-src.el (org-src-associate-babel-session):
* lisp/org.el (org-next-link):
Use `assq' instead of `assoc' with :keyword keys.
Aaron Ecay 3 years ago
parent
commit
79650ffbbd

+ 10 - 10
lisp/ob-C.el

@@ -126,9 +126,9 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
 			  (`c ".c") (`cpp ".cpp") (`d ".d"))))
 	 (tmp-bin-file			;not used for D
 	  (org-babel-temp-file "C-bin-" org-babel-exeext))
-	 (cmdline (cdr (assoc :cmdline params)))
+	 (cmdline (cdr (assq :cmdline params)))
 	 (cmdline (if cmdline (concat " " cmdline) ""))
-	 (flags (cdr (assoc :flags params)))
+	 (flags (cdr (assq :flags params)))
 	 (flags (mapconcat 'identity
 			   (if (listp flags) flags (list flags)) " "))
 	 (libs (org-babel-read
@@ -172,15 +172,15 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
       (when results
 	(setq results (org-trim (org-remove-indentation results)))
 	(org-babel-reassemble-table
-	 (org-babel-result-cond (cdr (assoc :result-params params))
+	 (org-babel-result-cond (cdr (assq :result-params params))
 	   (org-babel-read results t)
 	   (let ((tmp-file (org-babel-temp-file "c-")))
 	     (with-temp-file tmp-file (insert results))
 	     (org-babel-import-elisp-from-file tmp-file)))
 	 (org-babel-pick-name
-	  (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+	  (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
 	 (org-babel-pick-name
-	  (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
+	  (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))
       )))
 
 (defun org-babel-C-expand-C++ (body params)
@@ -193,13 +193,13 @@ its header arguments."
 its header arguments."
   (let ((vars (org-babel--get-vars params))
 	(colnames (cdr (assq :colname-names params)))
-	(main-p (not (string= (cdr (assoc :main params)) "no")))
+	(main-p (not (string= (cdr (assq :main params)) "no")))
 	(includes (org-babel-read
-		   (or (cdr (assoc :includes params))
+		   (or (cdr (assq :includes params))
 		       (org-entry-get nil "includes" t))
 		   nil))
 	(defines (org-babel-read
-		  (or (cdr (assoc :defines params))
+		  (or (cdr (assq :defines params))
 		      (org-entry-get nil "defines" t))
 		  nil)))
     (when (stringp includes)
@@ -242,8 +242,8 @@ its header arguments."
 its header arguments."
   (let ((vars (org-babel--get-vars params))
 	(colnames (cdr (assq :colname-names params)))
-	(main-p (not (string= (cdr (assoc :main params)) "no")))
-	(imports (or (cdr (assoc :imports params))
+	(main-p (not (string= (cdr (assq :main params)) "no")))
+	(imports (or (cdr (assq :imports params))
 		     (org-babel-read (org-entry-get nil "imports" t)))))
     (when (stringp imports)
       (setq imports (split-string imports)))

+ 1 - 1
lisp/ob-J.el

@@ -75,7 +75,7 @@ PARAMS are given by org-babel.
 This function is called by `org-babel-execute-src-block'"
   (message "executing J source code block")
   (let* ((processed-params (org-babel-process-params params))
-	 (sessionp (cdr (assoc :session params)))
+	 (sessionp (cdr (assq :session params)))
          (full-body (org-babel-expand-body:J
                      body params processed-params))
 	 (tmp-script-file (org-babel-temp-file "J-src")))

+ 17 - 17
lisp/ob-R.el

@@ -90,7 +90,7 @@ this variable.")
 (defvar ess-current-process-name) ; dynamically scoped
 (defvar ess-local-process-name)   ; dynamically scoped
 (defun org-babel-edit-prep:R (info)
-  (let ((session (cdr (assoc :session (nth 2 info)))))
+  (let ((session (cdr (assq :session (nth 2 info)))))
     (when (and session
 	       (string-prefix-p "*"  session)
 	       (string-suffix-p "*" session))
@@ -143,24 +143,24 @@ This function is used when the table does not contain a header.")
   "Expand BODY according to PARAMS, return the expanded body."
   (mapconcat 'identity
 	     (append
-	      (when (cdr (assoc :prologue params))
-		(list (cdr (assoc :prologue params))))
+	      (when (cdr (assq :prologue params))
+		(list (cdr (assq :prologue params))))
 	      (org-babel-variable-assignments:R params)
 	      (list body)
-	      (when (cdr (assoc :epilogue params))
-		(list (cdr (assoc :epilogue params)))))
+	      (when (cdr (assq :epilogue params))
+		(list (cdr (assq :epilogue params)))))
 	     "\n"))
 
 (defun org-babel-execute:R (body params)
   "Execute a block of R code.
 This function is called by `org-babel-execute-src-block'."
   (save-excursion
-    (let* ((result-params (cdr (assoc :result-params params)))
-	   (result-type (cdr (assoc :result-type params)))
+    (let* ((result-params (cdr (assq :result-params params)))
+	   (result-type (cdr (assq :result-type params)))
            (session (org-babel-R-initiate-session
-		     (cdr (assoc :session params)) params))
-	   (colnames-p (cdr (assoc :colnames params)))
-	   (rownames-p (cdr (assoc :rownames params)))
+		     (cdr (assq :session params)) params))
+	   (colnames-p (cdr (assq :colnames params)))
+	   (rownames-p (cdr (assq :rownames params)))
 	   (graphics-file (and (member "graphics" (assq :result-params params))
 			       (org-babel-graphical-output-file params)))
 	   (full-body
@@ -180,10 +180,10 @@ This function is called by `org-babel-execute-src-block'."
 	     session full-body result-type result-params
 	     (or (equal "yes" colnames-p)
 		 (org-babel-pick-name
-		  (cdr (assoc :colname-names params)) colnames-p))
+		  (cdr (assq :colname-names params)) colnames-p))
 	     (or (equal "yes" rownames-p)
 		 (org-babel-pick-name
-		  (cdr (assoc :rowname-names params)) rownames-p)))))
+		  (cdr (assq :rowname-names params)) rownames-p)))))
       (if graphics-file nil result))))
 
 (defun org-babel-prep-session:R (session params)
@@ -214,15 +214,15 @@ This function is called by `org-babel-execute-src-block'."
      (lambda (pair)
        (org-babel-R-assign-elisp
 	(car pair) (cdr pair)
-	(equal "yes" (cdr (assoc :colnames params)))
-	(equal "yes" (cdr (assoc :rownames params)))))
+	(equal "yes" (cdr (assq :colnames params)))
+	(equal "yes" (cdr (assq :rownames params)))))
      (mapcar
       (lambda (i)
 	(cons (car (nth i vars))
 	      (org-babel-reassemble-table
 	       (cdr (nth i vars))
-	       (cdr (nth i (cdr (assoc :colname-names params))))
-	       (cdr (nth i (cdr (assoc :rowname-names params)))))))
+	       (cdr (nth i (cdr (assq :colname-names params))))
+	       (cdr (nth i (cdr (assq :rowname-names params)))))))
       (number-sequence 0 (1- (length vars)))))))
 
 (defun org-babel-R-quote-tsv-field (s)
@@ -262,7 +262,7 @@ This function is called by `org-babel-execute-src-block'."
 	  (ess-ask-for-ess-directory
 	   (and (boundp 'ess-ask-for-ess-directory)
 		ess-ask-for-ess-directory
-		(not (cdr (assoc :dir params))))))
+		(not (cdr (assq :dir params))))))
       (if (org-babel-comint-buffer-livep session)
 	  session
 	(save-window-excursion

+ 3 - 3
lisp/ob-abc.el

@@ -59,7 +59,7 @@
   "Execute a block of ABC code with org-babel.  This function is
    called by `org-babel-execute-src-block'"
   (message "executing Abc source code block")
-  (let* ((cmdline (cdr (assoc :cmdline params)))
+  (let* ((cmdline (cdr (assq :cmdline params)))
 	 (out-file (let ((file (cdr (assq :file params))))
 		     (if file (replace-regexp-in-string "\.pdf$" ".ps" file)
 		       (error "abc code block requires :file header argument"))))
@@ -77,8 +77,8 @@
 		    (file-name-extension out-file))
 		   out-file t))
     ;;; if we were asked for a pdf...
-    (when (string= (file-name-extension (cdr (assoc :file params))) "pdf")
-      (org-babel-eval (concat "ps2pdf" " " out-file " " (cdr (assoc :file params))) ""))
+    (when (string= (file-name-extension (cdr (assq :file params))) "pdf")
+      (org-babel-eval (concat "ps2pdf" " " out-file " " (cdr (assq :file params))) ""))
     ;;; indicate that the file has been written
     nil))
 

+ 2 - 2
lisp/ob-asymptote.el

@@ -54,10 +54,10 @@
 (defun org-babel-execute:asymptote (body params)
   "Execute a block of Asymptote code.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((out-file (cdr (assoc :file params)))
+  (let* ((out-file (cdr (assq :file params)))
          (format (or (file-name-extension out-file)
                      "pdf"))
-         (cmdline (cdr (assoc :cmdline params)))
+         (cmdline (cdr (assq :cmdline params)))
          (in-file (org-babel-temp-file "asymptote-"))
          (cmd
 	  (concat "asy "

+ 6 - 6
lisp/ob-awk.el

@@ -51,13 +51,13 @@
   "Execute a block of Awk code with org-babel.  This function is
 called by `org-babel-execute-src-block'"
   (message "executing Awk source code block")
-  (let* ((result-params (cdr (assoc :result-params params)))
-         (cmd-line (cdr (assoc :cmd-line params)))
-         (in-file (cdr (assoc :in-file params)))
+  (let* ((result-params (cdr (assq :result-params params)))
+         (cmd-line (cdr (assq :cmd-line params)))
+         (in-file (cdr (assq :in-file params)))
 	 (full-body (org-babel-expand-body:awk body params))
 	 (code-file (let ((file (org-babel-temp-file "awk-")))
                       (with-temp-file file (insert full-body)) file))
-	 (stdin (let ((stdin (cdr (assoc :stdin params))))
+	 (stdin (let ((stdin (cdr (assq :stdin params))))
 		   (when stdin
 		     (let ((tmp (org-babel-temp-file "awk-stdin-"))
 			   (res (org-babel-ref-resolve stdin)))
@@ -90,9 +90,9 @@ called by `org-babel-execute-src-block'"
 	     (with-temp-file tmp (insert results))
 	     (org-babel-import-elisp-from-file tmp)))))
      (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+      (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
      (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+      (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defun org-babel-awk-var-to-awk (var &optional sep)
   "Return a printed value of VAR suitable for parsing with awk."

+ 4 - 4
lisp/ob-clojure.el

@@ -68,7 +68,7 @@
 (defun org-babel-expand-body:clojure (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let* ((vars (org-babel--get-vars params))
-	 (result-params (cdr (assoc :result-params params)))
+	 (result-params (cdr (assq :result-params params)))
 	 (print-level nil) (print-length nil)
 	 (body (org-trim
 		(if (null vars) (org-trim body)
@@ -90,7 +90,7 @@
     (cl-case org-babel-clojure-backend
       (cider
        (require 'cider)
-       (let ((result-params (cdr (assoc :result-params params))))
+       (let ((result-params (cdr (assq :result-params params))))
 	 (setq result
 	       (nrepl-dict-get
 		(nrepl-sync-request:eval
@@ -107,8 +107,8 @@
 	       (slime-eval
 		`(swank:eval-and-grab-output
 		  ,(buffer-substring-no-properties (point-min) (point-max)))
-		(cdr (assoc :package params)))))))
-    (org-babel-result-cond (cdr (assoc :result-params params))
+		(cdr (assq :package params)))))))
+    (org-babel-result-cond (cdr (assq :result-params params))
       result
       (condition-case nil (org-babel-script-escape result)
 	(error result)))))

+ 23 - 23
lisp/ob-core.el

@@ -726,8 +726,8 @@ Expand a block of code with org-babel according to its header
 arguments.  This generic implementation of body expansion is
 called for languages which have not defined their own specific
 org-babel-expand-body:lang function."
-  (let ((pro (cdr (assoc :prologue params)))
-	(epi (cdr (assoc :epilogue params))))
+  (let ((pro (cdr (assq :prologue params)))
+	(epi (cdr (assq :epilogue params))))
     (mapconcat #'identity
 	       (append (when pro (list pro))
 		       var-lines
@@ -897,8 +897,8 @@ session."
 		       (if (org-babel-noweb-p params :eval)
 			   (org-babel-expand-noweb-references info)
 			 (nth 1 info)))))
-         (session (cdr (assoc :session params)))
-	 (dir (cdr (assoc :dir params)))
+         (session (cdr (assq :session params)))
+	 (dir (cdr (assq :dir params)))
 	 (default-directory
 	   (or (and dir (file-name-as-directory dir)) default-directory))
 	 (cmd (intern (concat "org-babel-load-session:" lang))))
@@ -918,8 +918,8 @@ the session.  Copy the body of the code block to the kill ring."
          (lang (nth 0 info))
          (body (nth 1 info))
          (params (nth 2 info))
-         (session (cdr (assoc :session params)))
-	 (dir (cdr (assoc :dir params)))
+         (session (cdr (assq :session params)))
+	 (dir (cdr (assq :dir params)))
 	 (default-directory
 	   (or (and dir (file-name-as-directory dir)) default-directory))
 	 (init-cmd (intern (format "org-babel-%s-initiate-session" lang)))
@@ -1020,7 +1020,7 @@ results already exist."
 	    ;; file results
 	    (org-open-at-point)
 	  (let ((r (org-babel-format-result
-		    (org-babel-read-result) (cdr (assoc :sep (nth 2 info))))))
+		    (org-babel-read-result) (cdr (assq :sep (nth 2 info))))))
 	    (pop-to-buffer (get-buffer-create "*Org-Babel Results*"))
 	    (delete-region (point-min) (point-max))
 	    (insert r)))
@@ -1511,25 +1511,25 @@ shown below.
 				       el
 				     (org-babel-ref-parse el)))
 				 (org-babel--get-vars params)))
-	 (vars-and-names (if (and (assoc :colname-names params)
-				  (assoc :rowname-names params))
+	 (vars-and-names (if (and (assq :colname-names params)
+				  (assq :rowname-names params))
 			     (list processed-vars)
 			   (org-babel-disassemble-tables
 			    processed-vars
-			    (cdr (assoc :hlines params))
-			    (cdr (assoc :colnames params))
-			    (cdr (assoc :rownames params)))))
-	 (raw-result (or (cdr (assoc :results params)) ""))
+			    (cdr (assq :hlines params))
+			    (cdr (assq :colnames params))
+			    (cdr (assq :rownames params)))))
+	 (raw-result (or (cdr (assq :results params)) ""))
 	 (result-params (delete-dups
 			 (append
 			  (split-string (if (stringp raw-result)
 					    raw-result
 					  (eval raw-result t)))
-			  (cdr (assoc :result-params params))))))
+			  (cdr (assq :result-params params))))))
     (append
      (mapcar (lambda (var) (cons :var var)) (car vars-and-names))
      (list
-      (cons :colname-names (or (cdr (assoc :colname-names params))
+      (cons :colname-names (or (cdr (assq :colname-names params))
 			       (cadr  vars-and-names)))
       (cons :rowname-names (or (cdr (assq :rowname-names params))
 			       (cl-caddr vars-and-names)))
@@ -2153,8 +2153,8 @@ INFO may provide the values of these header arguments (in the
 	 (setq result (org-no-properties result))
 	 (when (member "file" result-params)
 	   (setq result (org-babel-result-to-file
-			 result (when (assoc :file-desc (nth 2 info))
-				  (or (cdr (assoc :file-desc (nth 2 info)))
+			 result (when (assq :file-desc (nth 2 info))
+				  (or (cdr (assq :file-desc (nth 2 info)))
 				      result))))))
 	((listp result))
 	(t (setq result (format "%S" result))))
@@ -2290,8 +2290,8 @@ INFO may provide the values of these header arguments (in the
 		  (setq end (point-marker))
 		  ;; possibly wrap result
 		  (cond
-		   ((assoc :wrap (nth 2 info))
-		    (let ((name (or (cdr (assoc :wrap (nth 2 info))) "RESULTS")))
+		   ((assq :wrap (nth 2 info))
+		    (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS")))
 		      (funcall wrap (concat "#+BEGIN_" name)
 			       (concat "#+END_" (car (org-split-string name)))
 			       nil nil (concat "{{{results(@@" name ":") "@@)}}}")))
@@ -2642,7 +2642,7 @@ block but are passed literally to the \"example-block\"."
          (body (nth 1 info))
 	 (ob-nww-start org-babel-noweb-wrap-start)
 	 (ob-nww-end org-babel-noweb-wrap-end)
-	 (comment (string= "noweb" (cdr (assoc :comments (nth 2 info)))))
+	 (comment (string= "noweb" (cdr (assq :comments (nth 2 info)))))
 	 (rx-prefix (concat "\\(" org-babel-src-name-regexp "\\|"
 			    ":noweb-ref[ \t]+" "\\)"))
          (new-body "")
@@ -2699,7 +2699,7 @@ block but are passed literally to the \"example-block\"."
                           (while (re-search-forward rx nil t)
                             (let* ((i (org-babel-get-src-block-info 'light))
                                    (body (org-babel-expand-noweb-references i))
-                                   (sep (or (cdr (assoc :noweb-sep (nth 2 i)))
+                                   (sep (or (cdr (assq :noweb-sep (nth 2 i)))
                                             "\n"))
                                    (full (if comment
                                              (let ((cs (org-babel-tangle-comment-links i)))
@@ -2710,11 +2710,11 @@ block but are passed literally to the \"example-block\"."
                               (setq expansion (cons sep (cons full expansion)))))
                         (org-babel-map-src-blocks nil
 			  (let ((i (org-babel-get-src-block-info 'light)))
-                            (when (equal (or (cdr (assoc :noweb-ref (nth 2 i)))
+                            (when (equal (or (cdr (assq :noweb-ref (nth 2 i)))
                                              (nth 4 i))
                                          source-name)
                               (let* ((body (org-babel-expand-noweb-references i))
-                                     (sep (or (cdr (assoc :noweb-sep (nth 2 i)))
+                                     (sep (or (cdr (assq :noweb-sep (nth 2 i)))
                                               "\n"))
                                      (full (if comment
                                                (let ((cs (org-babel-tangle-comment-links i)))

+ 5 - 5
lisp/ob-ditaa.el

@@ -81,17 +81,17 @@ Do not leave leading or trailing spaces in this string."
 (defun org-babel-execute:ditaa (body params)
   "Execute a block of Ditaa code with org-babel.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((out-file (or (cdr (assoc :file params))
+  (let* ((out-file (or (cdr (assq :file params))
 		       (error
 			"ditaa code block requires :file header argument")))
-	 (cmdline (cdr (assoc :cmdline params)))
-	 (java (cdr (assoc :java params)))
+	 (cmdline (cdr (assq :cmdline params)))
+	 (java (cdr (assq :java params)))
 	 (in-file (org-babel-temp-file "ditaa-"))
-	 (eps (cdr (assoc :eps params)))
+	 (eps (cdr (assq :eps params)))
 	 (eps-file (when eps
 		     (org-babel-process-file-name (concat in-file ".eps"))))
 	 (pdf-cmd (when (and (or (string= (file-name-extension out-file) "pdf")
-				 (cdr (assoc :pdf params))))
+				 (cdr (assq :pdf params))))
 		    (concat
 		     "epstopdf"
 		     " " eps-file

+ 3 - 3
lisp/ob-dot.el

@@ -64,11 +64,11 @@
 (defun org-babel-execute:dot (body params)
   "Execute a block of Dot code with org-babel.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((out-file (cdr (or (assoc :file params)
+  (let* ((out-file (cdr (or (assq :file params)
 			    (error "You need to specify a :file parameter"))))
-	 (cmdline (or (cdr (assoc :cmdline params))
+	 (cmdline (or (cdr (assq :cmdline params))
 		      (format "-T%s" (file-name-extension out-file))))
-	 (cmd (or (cdr (assoc :cmd params)) "dot"))
+	 (cmd (or (cdr (assq :cmd params)) "dot"))
 	 (in-file (org-babel-temp-file "dot-")))
     (with-temp-file in-file
       (insert (org-babel-expand-body:dot body params)))

+ 2 - 2
lisp/ob-ebnf.el

@@ -54,11 +54,11 @@
   "Execute a block of Ebnf code with org-babel.  This function is
 called by `org-babel-execute-src-block'"
   (save-excursion
-    (let* ((dest-file (cdr (assoc :file params)))
+    (let* ((dest-file (cdr (assq :file params)))
 	   (dest-dir (file-name-directory dest-file))
 	   (dest-root (file-name-sans-extension
 		       (file-name-nondirectory dest-file)))
-	   (style (cdr (assoc :style params)))
+	   (style (cdr (assq :style params)))
 	   (result nil))
       (with-temp-buffer
 	(when style (ebnf-push-style style))

+ 8 - 8
lisp/ob-emacs-lisp.el

@@ -42,7 +42,7 @@ their value.  It is used as the optional LEXICAL argument to
 (defun org-babel-expand-body:emacs-lisp (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let* ((vars (org-babel--get-vars params))
-         (result-params (cdr (assoc :result-params params)))
+         (result-params (cdr (assq :result-params params)))
          (print-level nil) (print-length nil)
          (body (if (> (length vars) 0)
 		   (concat "(let ("
@@ -71,19 +71,19 @@ their value.  It is used as the optional LEXICAL argument to
 		  (if (listp lexical)
 		      lexical
 		    (member lexical '("yes" "t"))))))
-      (org-babel-result-cond (cdr (assoc :result-params params))
+      (org-babel-result-cond (cdr (assq :result-params params))
 	(let ((print-level nil)
               (print-length nil))
-          (if (or (member "scalar" (cdr (assoc :result-params params)))
-                  (member "verbatim" (cdr (assoc :result-params params))))
+          (if (or (member "scalar" (cdr (assq :result-params params)))
+                  (member "verbatim" (cdr (assq :result-params params))))
               (format "%S" result)
             (format "%s" result)))
 	(org-babel-reassemble-table
 	 result
-         (org-babel-pick-name (cdr (assoc :colname-names params))
-                              (cdr (assoc :colnames params)))
-         (org-babel-pick-name (cdr (assoc :rowname-names params))
-                              (cdr (assoc :rownames params))))))))
+         (org-babel-pick-name (cdr (assq :colname-names params))
+                              (cdr (assq :colnames params)))
+         (org-babel-pick-name (cdr (assq :rowname-names params))
+                              (cdr (assq :rownames params))))))))
 
 (org-babel-make-language-alias "elisp" "emacs-lisp")
 

+ 3 - 3
lisp/ob-exp.el

@@ -175,7 +175,7 @@ this template."
 			       (org-babel-get-src-block-info nil element))
 			      (params (nth 2 info)))
 			 (setf (nth 1 info)
-			       (if (and (cdr (assoc :noweb params))
+			       (if (and (cdr (assq :noweb params))
 					(string= "yes"
 						 (cdr (assq :noweb params))))
 				   (org-babel-expand-noweb-references
@@ -270,7 +270,7 @@ this template."
 (defun org-babel-exp-do-export (info type &optional hash)
   "Return a string with the exported content of a code block.
 The function respects the value of the :exports header argument."
-  (let ((silently (lambda () (let ((session (cdr (assoc :session (nth 2 info)))))
+  (let ((silently (lambda () (let ((session (cdr (assq :session (nth 2 info)))))
 			  (unless (equal "none" session)
 			    (org-babel-exp-results info type 'silent)))))
 	(clean (lambda () (if (eq type 'inline)
@@ -329,7 +329,7 @@ replaced with its value."
 (defun org-babel-exp-code (info type)
   "Return the original code block formatted for export."
   (setf (nth 1 info)
-	(if (string= "strip-export" (cdr (assoc :noweb (nth 2 info))))
+	(if (string= "strip-export" (cdr (assq :noweb (nth 2 info))))
 	    (replace-regexp-in-string
 	     (org-babel-noweb-wrap) "" (nth 1 info))
 	  (if (org-babel-noweb-p (nth 2 info) :export)

+ 2 - 2
lisp/ob-forth.el

@@ -43,10 +43,10 @@
 (defun org-babel-execute:forth (body params)
   "Execute a block of Forth code with org-babel.
 This function is called by `org-babel-execute-src-block'"
-  (if (string= "none" (cdr (assoc :session params)))
+  (if (string= "none" (cdr (assq :session params)))
       (error "Non-session evaluation not supported for Forth code blocks")
     (let ((all-results (org-babel-forth-session-execute body params)))
-      (if (member "output" (cdr (assoc :result-params params)))
+      (if (member "output" (cdr (assq :result-params params)))
 	  (mapconcat #'identity all-results "\n")
 	(car (last all-results))))))
 

+ 8 - 8
lisp/ob-fortran.el

@@ -49,8 +49,8 @@
   "This function should only be called by `org-babel-execute:fortran'"
   (let* ((tmp-src-file (org-babel-temp-file "fortran-src-" ".F90"))
          (tmp-bin-file (org-babel-temp-file "fortran-bin-" org-babel-exeext))
-         (cmdline (cdr (assoc :cmdline params)))
-         (flags (cdr (assoc :flags params)))
+         (cmdline (cdr (assq :cmdline params)))
+         (flags (cdr (assq :flags params)))
          (full-body (org-babel-expand-body:fortran body params)))
     (with-temp-file tmp-src-file (insert full-body))
     (org-babel-eval
@@ -66,25 +66,25 @@
 	     (org-babel-eval
 	      (concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))))
       (org-babel-reassemble-table
-       (org-babel-result-cond (cdr (assoc :result-params params))
+       (org-babel-result-cond (cdr (assq :result-params params))
 	 (org-babel-read results)
          (let ((tmp-file (org-babel-temp-file "f-")))
            (with-temp-file tmp-file (insert results))
            (org-babel-import-elisp-from-file tmp-file)))
        (org-babel-pick-name
-        (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+        (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
        (org-babel-pick-name
-        (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
+        (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
 
 (defun org-babel-expand-body:fortran (body params)
   "Expand a block of fortran or fortran code with org-babel according to
 its header arguments."
   (let ((vars (org-babel--get-vars params))
-        (main-p (not (string= (cdr (assoc :main params)) "no")))
-        (includes (or (cdr (assoc :includes params))
+        (main-p (not (string= (cdr (assq :main params)) "no")))
+        (includes (or (cdr (assq :includes params))
                       (org-babel-read (org-entry-get nil "includes" t))))
         (defines (org-babel-read
-                  (or (cdr (assoc :defines params))
+                  (or (cdr (assq :defines params))
                       (org-babel-read (org-entry-get nil "defines" t))))))
     (mapconcat 'identity
 	       (list

+ 14 - 14
lisp/ob-gnuplot.el

@@ -79,7 +79,7 @@
 Dumps all vectors into files and returns an association list
 of variable names and the related value to be used in the gnuplot
 code."
-  (let ((*org-babel-gnuplot-missing* (cdr (assoc :missing params))))
+  (let ((*org-babel-gnuplot-missing* (cdr (assq :missing params))))
     (mapcar
      (lambda (pair)
        (cons
@@ -99,22 +99,22 @@ code."
   "Expand BODY according to PARAMS, return the expanded body."
   (save-window-excursion
     (let* ((vars (org-babel-gnuplot-process-vars params))
-           (out-file (cdr (assoc :file params)))
-	   (prologue (cdr (assoc :prologue params)))
-	   (epilogue (cdr (assoc :epilogue params)))
-	   (term (or (cdr (assoc :term params))
+           (out-file (cdr (assq :file params)))
+	   (prologue (cdr (assq :prologue params)))
+	   (epilogue (cdr (assq :epilogue params)))
+	   (term (or (cdr (assq :term params))
                      (when out-file
 		       (let ((ext (file-name-extension out-file)))
 			 (or (cdr (assoc (intern (downcase ext))
 					 *org-babel-gnuplot-terms*))
 			     ext)))))
-           (title (cdr (assoc :title params)))
-           (lines (cdr (assoc :line params)))
-           (sets (cdr (assoc :set params)))
-           (x-labels (cdr (assoc :xlabels params)))
-           (y-labels (cdr (assoc :ylabels params)))
-           (timefmt (cdr (assoc :timefmt params)))
-           (time-ind (or (cdr (assoc :timeind params))
+           (title (cdr (assq :title params)))
+           (lines (cdr (assq :line params)))
+           (sets (cdr (assq :set params)))
+           (x-labels (cdr (assq :xlabels params)))
+           (y-labels (cdr (assq :ylabels params)))
+           (timefmt (cdr (assq :timefmt params)))
+           (time-ind (or (cdr (assq :timeind params))
                          (when timefmt 1)))
 	   (add-to-body (lambda (text) (setq body (concat text "\n" body)))))
       ;; append header argument settings to body
@@ -168,8 +168,8 @@ code."
   "Execute a block of Gnuplot code.
 This function is called by `org-babel-execute-src-block'."
   (require 'gnuplot)
-  (let ((session (cdr (assoc :session params)))
-        (result-type (cdr (assoc :results params)))
+  (let ((session (cdr (assq :session params)))
+        (result-type (cdr (assq :results params)))
         (body (org-babel-expand-body:gnuplot body params))
 	output)
     (save-window-excursion

+ 3 - 3
lisp/ob-groovy.el

@@ -51,7 +51,7 @@ called by `org-babel-execute-src-block'"
   (let* ((processed-params (org-babel-process-params params))
          (session (org-babel-groovy-initiate-session (nth 0 processed-params)))
          (result-params (nth 2 processed-params))
-         (result-type (cdr (assoc :result-type params)))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
                      body params))
          (result (org-babel-groovy-evaluate
@@ -60,9 +60,9 @@ called by `org-babel-execute-src-block'"
     (org-babel-reassemble-table
      result
      (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+      (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
      (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+      (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defvar org-babel-groovy-wrapper-method
 

+ 7 - 7
lisp/ob-haskell.el

@@ -61,8 +61,8 @@
 
 (defun org-babel-execute:haskell (body params)
   "Execute a block of Haskell code."
-  (let* ((session (cdr (assoc :session params)))
-         (result-type (cdr (assoc :result-type params)))
+  (let* ((session (cdr (assq :session params)))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
 		     body params
 		     (org-babel-variable-assignments:haskell params)))
@@ -82,12 +82,12 @@
             (pcase result-type
               (`output (mapconcat #'identity (reverse (cdr results)) "\n"))
               (`value (car results)))))
-       (org-babel-result-cond (cdr (assoc :result-params params))
+       (org-babel-result-cond (cdr (assq :result-params params))
 	 result (org-babel-script-escape result)))
-     (org-babel-pick-name (cdr (assoc :colname-names params))
-			  (cdr (assoc :colname-names params)))
-     (org-babel-pick-name (cdr (assoc :rowname-names params))
-			  (cdr (assoc :rowname-names params))))))
+     (org-babel-pick-name (cdr (assq :colname-names params))
+			  (cdr (assq :colname-names params)))
+     (org-babel-pick-name (cdr (assq :rowname-names params))
+			  (cdr (assq :rowname-names params))))))
 
 (defun org-babel-haskell-initiate-session (&optional _session _params)
   "Initiate a haskell session.

+ 3 - 3
lisp/ob-io.el

@@ -47,7 +47,7 @@ called by `org-babel-execute-src-block'"
   (let* ((processed-params (org-babel-process-params params))
          (session (org-babel-io-initiate-session (nth 0 processed-params)))
          (result-params (nth 2 processed-params))
-         (result-type (cdr (assoc :result-type params)))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
                      body params))
          (result (org-babel-io-evaluate
@@ -56,9 +56,9 @@ called by `org-babel-execute-src-block'"
     (org-babel-reassemble-table
      result
      (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+      (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
      (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+      (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defvar org-babel-io-wrapper-method
   "(

+ 6 - 6
lisp/ob-java.el

@@ -51,13 +51,13 @@ parameters may be used, like javac -verbose"
   :type 'string)
 
 (defun org-babel-execute:java (body params)
-  (let* ((classname (or (cdr (assoc :classname params))
+  (let* ((classname (or (cdr (assq :classname params))
 			(error
 			 "Can't compile a java block without a classname")))
 	 (packagename (file-name-directory classname))
 	 (src-file (concat classname ".java"))
-	 (cmpflag (or (cdr (assoc :cmpflag params)) ""))
-	 (cmdline (or (cdr (assoc :cmdline params)) ""))
+	 (cmpflag (or (cdr (assq :cmpflag params)) ""))
+	 (cmdline (or (cdr (assq :cmdline params)) ""))
 	 (full-body (org-babel-expand-body:generic body params)))
     (with-temp-file src-file (insert full-body))
     (org-babel-eval
@@ -68,15 +68,15 @@ parameters may be used, like javac -verbose"
     (let ((results (org-babel-eval (concat org-babel-java-command
                                            " " cmdline " " classname) "")))
       (org-babel-reassemble-table
-       (org-babel-result-cond (cdr (assoc :result-params params))
+       (org-babel-result-cond (cdr (assq :result-params params))
 	 (org-babel-read results)
          (let ((tmp-file (org-babel-temp-file "c-")))
            (with-temp-file tmp-file (insert results))
            (org-babel-import-elisp-from-file tmp-file)))
        (org-babel-pick-name
-        (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+        (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
        (org-babel-pick-name
-        (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
+        (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
 
 (provide 'ob-java)
 

+ 5 - 5
lisp/ob-js.el

@@ -61,14 +61,14 @@
 (defun org-babel-execute:js (body params)
   "Execute a block of Javascript code with org-babel.
 This function is called by `org-babel-execute-src-block'"
-  (let* ((org-babel-js-cmd (or (cdr (assoc :cmd params)) org-babel-js-cmd))
-         (result-type (cdr (assoc :result-type params)))
+  (let* ((org-babel-js-cmd (or (cdr (assq :cmd params)) org-babel-js-cmd))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
 		     body params (org-babel-variable-assignments:js params)))
-	 (result (if (not (string= (cdr (assoc :session params)) "none"))
+	 (result (if (not (string= (cdr (assq :session params)) "none"))
 		     ;; session evaluation
 		     (let ((session (org-babel-prep-session:js
-				     (cdr (assoc :session params)) params)))
+				     (cdr (assq :session params)) params)))
 		       (nth 1
 			    (org-babel-comint-with-output
 				(session (format "%S" org-babel-js-eoe) t body)
@@ -88,7 +88,7 @@ This function is called by `org-babel-execute-src-block'"
 		     (org-babel-eval
 		      (format "%s %s" org-babel-js-cmd
 			      (org-babel-process-file-name script-file)) "")))))
-    (org-babel-result-cond (cdr (assoc :result-params params))
+    (org-babel-result-cond (cdr (assq :result-params params))
       result (org-babel-js-read result))))
 
 (defun org-babel-js-read (results)

+ 12 - 12
lisp/ob-latex.el

@@ -91,21 +91,21 @@
   "Execute a block of Latex code with Babel.
 This function is called by `org-babel-execute-src-block'."
   (setq body (org-babel-expand-body:latex body params))
-  (if (cdr (assoc :file params))
-      (let* ((out-file (cdr (assoc :file params)))
+  (if (cdr (assq :file params))
+      (let* ((out-file (cdr (assq :file params)))
 	     (extension (file-name-extension out-file))
 	     (tex-file (org-babel-temp-file "latex-" ".tex"))
-	     (border (cdr (assoc :border params)))
-	     (imagemagick (cdr (assoc :imagemagick params)))
-	     (im-in-options (cdr (assoc :iminoptions params)))
-	     (im-out-options (cdr (assoc :imoutoptions params)))
-	     (fit (or (cdr (assoc :fit params)) border))
-	     (height (and fit (cdr (assoc :pdfheight params))))
-	     (width (and fit (cdr (assoc :pdfwidth params))))
-	     (headers (cdr (assoc :headers params)))
-	     (in-buffer (not (string= "no" (cdr (assoc :buffer params)))))
+	     (border (cdr (assq :border params)))
+	     (imagemagick (cdr (assq :imagemagick params)))
+	     (im-in-options (cdr (assq :iminoptions params)))
+	     (im-out-options (cdr (assq :imoutoptions params)))
+	     (fit (or (cdr (assq :fit params)) border))
+	     (height (and fit (cdr (assq :pdfheight params))))
+	     (width (and fit (cdr (assq :pdfwidth params))))
+	     (headers (cdr (assq :headers params)))
+	     (in-buffer (not (string= "no" (cdr (assq :buffer params)))))
 	     (org-latex-packages-alist
-	      (append (cdr (assoc :packages params)) org-latex-packages-alist)))
+	      (append (cdr (assq :packages params)) org-latex-packages-alist)))
         (cond
          ((and (string-suffix-p ".png" out-file) (not imagemagick))
           (org-create-formula-image

+ 1 - 1
lisp/ob-ledger.el

@@ -46,7 +46,7 @@
   "Execute a block of Ledger entries with org-babel.  This function is
 called by `org-babel-execute-src-block'."
   (message "executing Ledger source code block")
-  (let ((cmdline (cdr (assoc :cmdline params)))
+  (let ((cmdline (cdr (assq :cmdline params)))
         (in-file (org-babel-temp-file "ledger-"))
 	(out-file (org-babel-temp-file "ledger-output-")))
     (with-temp-file in-file (insert body))

+ 2 - 2
lisp/ob-lilypond.el

@@ -157,8 +157,8 @@ specific arguments to =org-babel-tangle="
 
 (defun org-babel-lilypond-process-basic (body params)
   "Execute a lilypond block in basic mode."
-  (let* ((out-file (cdr (assoc :file params)))
-	 (cmdline (or (cdr (assoc :cmdline params))
+  (let* ((out-file (cdr (assq :file params)))
+	 (cmdline (or (cdr (assq :cmdline params))
 		      ""))
 	 (in-file (org-babel-temp-file "lilypond-")))
 

+ 10 - 10
lisp/ob-lisp.el

@@ -68,7 +68,7 @@ current directory string."
 (defun org-babel-expand-body:lisp (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let* ((vars (org-babel--get-vars params))
-	 (result-params (cdr (assoc :result-params params)))
+	 (result-params (cdr (assq :result-params params)))
 	 (print-level nil) (print-length nil)
 	 (body (if (null vars) (org-trim body)
 		 (concat "(let ("
@@ -91,30 +91,30 @@ a property list containing the parameters of the block."
 	     (`sly-eval 'sly)))
   (org-babel-reassemble-table
    (let ((result
-          (funcall (if (member "output" (cdr (assoc :result-params params)))
+          (funcall (if (member "output" (cdr (assq :result-params params)))
                        #'car #'cadr)
                    (with-temp-buffer
                      (insert (org-babel-expand-body:lisp body params))
                      (funcall org-babel-lisp-eval-fn
                               `(swank:eval-and-grab-output
-                                ,(let ((dir (if (assoc :dir params)
-                                                (cdr (assoc :dir params))
+                                ,(let ((dir (if (assq :dir params)
+                                                (cdr (assq :dir params))
                                               default-directory)))
                                    (format
                                     (if dir (format org-babel-lisp-dir-fmt dir)
                                       "(progn %s\n)")
                                     (buffer-substring-no-properties
                                      (point-min) (point-max)))))
-                              (cdr (assoc :package params)))))))
-     (org-babel-result-cond (cdr (assoc :result-params params))
+                              (cdr (assq :package params)))))))
+     (org-babel-result-cond (cdr (assq :result-params params))
        result
        (condition-case nil
            (read (org-babel-lisp-vector-to-list result))
          (error result))))
-   (org-babel-pick-name (cdr (assoc :colname-names params))
-			(cdr (assoc :colnames params)))
-   (org-babel-pick-name (cdr (assoc :rowname-names params))
-			(cdr (assoc :rownames params)))))
+   (org-babel-pick-name (cdr (assq :colname-names params))
+			(cdr (assq :colnames params)))
+   (org-babel-pick-name (cdr (assq :rowname-names params))
+			(cdr (assq :rownames params)))))
 
 (defun org-babel-lisp-vector-to-list (results)
   ;; TODO: better would be to replace #(...) with [...]

+ 9 - 9
lisp/ob-lua.el

@@ -80,12 +80,12 @@ This will typically be 'lua-mode."
   "Execute a block of Lua code with Babel.
 This function is called by `org-babel-execute-src-block'."
   (let* ((session (org-babel-lua-initiate-session
-		   (cdr (assoc :session params))))
-         (result-params (cdr (assoc :result-params params)))
-         (result-type (cdr (assoc :result-type params)))
+		   (cdr (assq :session params))))
+         (result-params (cdr (assq :result-params params)))
+         (result-type (cdr (assq :result-type params)))
 	 (return-val (when (and (eq result-type 'value) (not session))
-		       (cdr (assoc :return params))))
-	 (preamble (cdr (assoc :preamble params)))
+		       (cdr (assq :return params))))
+	 (preamble (cdr (assq :preamble params)))
          (full-body
 	  (org-babel-expand-body:generic
 	   (concat body (if return-val (format "\nreturn %s" return-val) ""))
@@ -94,10 +94,10 @@ This function is called by `org-babel-execute-src-block'."
 		  session full-body result-type result-params preamble)))
     (org-babel-reassemble-table
      result
-     (org-babel-pick-name (cdr (assoc :colname-names params))
-			  (cdr (assoc :colnames params)))
-     (org-babel-pick-name (cdr (assoc :rowname-names params))
-			  (cdr (assoc :rownames params))))))
+     (org-babel-pick-name (cdr (assq :colname-names params))
+			  (cdr (assq :colnames params)))
+     (org-babel-pick-name (cdr (assq :rowname-names params))
+			  (cdr (assq :rownames params))))))
 
 (defun org-babel-prep-session:lua (session params)
   "Prepare SESSION according to the header arguments in PARAMS.

+ 2 - 2
lisp/ob-maxima.el

@@ -69,9 +69,9 @@
   "Execute a block of Maxima entries with org-babel.
 This function is called by `org-babel-execute-src-block'."
   (message "executing Maxima source code block")
-  (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
+  (let ((result-params (split-string (or (cdr (assq :results params)) "")))
 	(result
-	 (let* ((cmdline (or (cdr (assoc :cmdline params)) ""))
+	 (let* ((cmdline (or (cdr (assq :cmdline params)) ""))
 		(in-file (org-babel-temp-file "maxima-" ".max"))
 		(cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
 			     org-babel-maxima-command in-file cmdline)))

+ 3 - 3
lisp/ob-mscgen.el

@@ -65,9 +65,9 @@
 This function is called by `org-babel-execute-src-block'.
 Default filetype is png.  Modify by setting :filetype parameter to
 mscgen supported formats."
-  (let* ((out-file (or (cdr (assoc :file params)) "output.png" ))
-         (filetype (or (cdr (assoc :filetype params)) "png" )))
-    (unless (cdr (assoc :file params))
+  (let* ((out-file (or (cdr (assq :file params)) "output.png" ))
+         (filetype (or (cdr (assq :filetype params)) "png" )))
+    (unless (cdr (assq :file params))
       (error "
 ERROR: no output file specified.  Add \":file name.png\" to the src header"))
     (org-babel-eval (concat "mscgen -T " filetype " -o " out-file) body)

+ 4 - 4
lisp/ob-ocaml.el

@@ -64,7 +64,7 @@
 		     body params
 		     (org-babel-variable-assignments:ocaml params)))
          (session (org-babel-prep-session:ocaml
-		   (cdr (assoc :session params)) params))
+		   (cdr (assq :session params)) params))
          (raw (org-babel-comint-with-output
 		  (session org-babel-ocaml-eoe-output nil full-body)
 		(insert
@@ -81,7 +81,7 @@
 					 (progn (setq out t) nil))))
 				   (mapcar #'org-trim (reverse raw)))))))
 	 (raw (org-trim clean))
-	 (result-params (cdr (assoc :result-params params))))
+	 (result-params (cdr (assq :result-params params))))
     (string-match
      "\\(\\(.*\n\\)*\\)[^:\n]+ : \\([^=\n]+\\) =\\(\n\\| \\)\\(.+\\)$"
      raw)
@@ -98,9 +98,9 @@
 	     (org-babel-ocaml-parse-output value type)
 	   raw))
        (org-babel-pick-name
-	(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+	(cdr (assq :colname-names params)) (cdr (assq :colnames params)))
        (org-babel-pick-name
-	(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
+	(cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
 
 (defvar tuareg-interactive-buffer-name)
 (defun org-babel-prep-session:ocaml (session _params)

+ 4 - 4
lisp/ob-octave.el

@@ -74,8 +74,8 @@ end")
   (let* ((session
 	  (funcall (intern (format "org-babel-%s-initiate-session"
 				   (if matlabp "matlab" "octave")))
-		   (cdr (assoc :session params)) params))
-         (result-type (cdr (assoc :result-type params)))
+		   (cdr (assq :session params)) params))
+         (result-type (cdr (assq :result-type params)))
 	 (full-body
 	  (org-babel-expand-body:generic
 	   body params (org-babel-variable-assignments:octave params)))
@@ -96,9 +96,9 @@ end")
       (org-babel-reassemble-table
        result
        (org-babel-pick-name
-	(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+	(cdr (assq :colname-names params)) (cdr (assq :colnames params)))
        (org-babel-pick-name
-	(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
+	(cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
 
 (defun org-babel-prep-session:matlab (session params)
   "Prepare SESSION according to PARAMS."

+ 1 - 1
lisp/ob-org.el

@@ -51,7 +51,7 @@
 (defun org-babel-execute:org (body params)
   "Execute a block of Org code with.
 This function is called by `org-babel-execute-src-block'."
-  (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
+  (let ((result-params (split-string (or (cdr (assq :results params)) "")))
 	(body (org-babel-expand-body:org
 	       (replace-regexp-in-string "^," "" body) params)))
     (cond

+ 5 - 5
lisp/ob-perl.el

@@ -40,18 +40,18 @@
 (defun org-babel-execute:perl (body params)
   "Execute a block of Perl code with Babel.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((session (cdr (assoc :session params)))
-         (result-params (cdr (assoc :result-params params)))
-         (result-type (cdr (assoc :result-type params)))
+  (let* ((session (cdr (assq :session params)))
+         (result-params (cdr (assq :result-params params)))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
 		     body params (org-babel-variable-assignments:perl params)))
 	 (session (org-babel-perl-initiate-session session)))
     (org-babel-reassemble-table
      (org-babel-perl-evaluate session full-body result-type result-params)
      (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+      (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
      (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+      (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defun org-babel-prep-session:perl (_session _params)
   "Prepare SESSION according to the header arguments in PARAMS."

+ 2 - 2
lisp/ob-picolisp.el

@@ -99,11 +99,11 @@
   (message "executing Picolisp source code block")
   (let* (
 	 ;; Name of the session or "none".
-	 (session-name (cdr (assoc :session params)))
+	 (session-name (cdr (assq :session params)))
 	 ;; Set the session if the session variable is non-nil.
 	 (session (org-babel-picolisp-initiate-session session-name))
 	 ;; Either OUTPUT or VALUE which should behave as described above.
-	 (result-params (cdr (assoc :result-params params)))
+	 (result-params (cdr (assq :result-params params)))
 	 ;; Expand the body with `org-babel-expand-body:picolisp'.
 	 (full-body (org-babel-expand-body:picolisp body params))
          ;; Wrap body appropriately for the type of evaluation and results.

+ 3 - 3
lisp/ob-plantuml.el

@@ -49,11 +49,11 @@
 (defun org-babel-execute:plantuml (body params)
   "Execute a block of plantuml code with org-babel.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((out-file (or (cdr (assoc :file params))
+  (let* ((out-file (or (cdr (assq :file params))
 		       (error "PlantUML requires a \":file\" header argument")))
-	 (cmdline (cdr (assoc :cmdline params)))
+	 (cmdline (cdr (assq :cmdline params)))
 	 (in-file (org-babel-temp-file "plantuml-"))
-	 (java (or (cdr (assoc :java params)) ""))
+	 (java (or (cdr (assq :java params)) ""))
 	 (cmd (if (string= "" org-plantuml-jar-path)
 		  (error "`org-plantuml-jar-path' is not set")
 		(concat "java " java " -jar "

+ 10 - 10
lisp/ob-python.el

@@ -74,14 +74,14 @@ This will typically be either `python' or `python-mode'."
   "Execute a block of Python code with Babel.
 This function is called by `org-babel-execute-src-block'."
   (let* ((session (org-babel-python-initiate-session
-		   (cdr (assoc :session params))))
-         (result-params (cdr (assoc :result-params params)))
-         (result-type (cdr (assoc :result-type params)))
+		   (cdr (assq :session params))))
+         (result-params (cdr (assq :result-params params)))
+         (result-type (cdr (assq :result-type params)))
 	 (return-val (when (and (eq result-type 'value) (not session))
-		       (cdr (assoc :return params))))
-	 (preamble (cdr (assoc :preamble params)))
+		       (cdr (assq :return params))))
+	 (preamble (cdr (assq :preamble params)))
 	 (org-babel-python-command
-	  (or (cdr (assoc :python params)) org-babel-python-command))
+	  (or (cdr (assq :python params)) org-babel-python-command))
          (full-body
 	  (org-babel-expand-body:generic
 	   (concat body (if return-val (format "\nreturn %s" return-val) ""))
@@ -90,10 +90,10 @@ This function is called by `org-babel-execute-src-block'."
 		  session full-body result-type result-params preamble)))
     (org-babel-reassemble-table
      result
-     (org-babel-pick-name (cdr (assoc :colname-names params))
-			  (cdr (assoc :colnames params)))
-     (org-babel-pick-name (cdr (assoc :rowname-names params))
-			  (cdr (assoc :rownames params))))))
+     (org-babel-pick-name (cdr (assq :colname-names params))
+			  (cdr (assq :colnames params)))
+     (org-babel-pick-name (cdr (assq :rowname-names params))
+			  (cdr (assq :rownames params))))))
 
 (defun org-babel-prep-session:python (session params)
   "Prepare SESSION according to the header arguments in PARAMS.

+ 8 - 8
lisp/ob-ruby.el

@@ -68,16 +68,16 @@
   "Execute a block of Ruby code with Babel.
 This function is called by `org-babel-execute-src-block'."
   (let* ((session (org-babel-ruby-initiate-session
-		   (cdr (assoc :session params))))
-         (result-params (cdr (assoc :result-params params)))
-         (result-type (cdr (assoc :result-type params)))
+		   (cdr (assq :session params))))
+         (result-params (cdr (assq :result-params params)))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
 		     body params (org-babel-variable-assignments:ruby params)))
          (result (if (member "xmp" result-params)
 		     (with-temp-buffer
 		       (require 'rcodetools)
 		       (insert full-body)
-		       (xmp (cdr (assoc :xmp-option params)))
+		       (xmp (cdr (assq :xmp-option params)))
 		       (buffer-string))
 		   (org-babel-ruby-evaluate
 		    session full-body result-type result-params))))
@@ -85,10 +85,10 @@ This function is called by `org-babel-execute-src-block'."
      (org-babel-result-cond result-params
        result
        (org-babel-ruby-table-or-string result))
-     (org-babel-pick-name (cdr (assoc :colname-names params))
-			  (cdr (assoc :colnames params)))
-     (org-babel-pick-name (cdr (assoc :rowname-names params))
-			  (cdr (assoc :rownames params))))))
+     (org-babel-pick-name (cdr (assq :colname-names params))
+			  (cdr (assq :colnames params)))
+     (org-babel-pick-name (cdr (assq :rowname-names params))
+			  (cdr (assq :rownames params))))))
 
 (defun org-babel-prep-session:ruby (session params)
   "Prepare SESSION according to the header arguments specified in PARAMS."

+ 2 - 2
lisp/ob-sass.el

@@ -45,9 +45,9 @@
 (defun org-babel-execute:sass (body params)
   "Execute a block of Sass code with Babel.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((file (cdr (assoc :file params)))
+  (let* ((file (cdr (assq :file params)))
          (out-file (or file (org-babel-temp-file "sass-out-")))
-         (cmdline (cdr (assoc :cmdline params)))
+         (cmdline (cdr (assq :cmdline params)))
          (in-file (org-babel-temp-file "sass-in-"))
          (cmd (concat "sass " (or cmdline "")
 		      " " (org-babel-process-file-name in-file)

+ 3 - 3
lisp/ob-scala.el

@@ -45,7 +45,7 @@ called by `org-babel-execute-src-block'"
   (let* ((processed-params (org-babel-process-params params))
          (session (org-babel-scala-initiate-session (nth 0 processed-params)))
          (result-params (nth 2 processed-params))
-         (result-type (cdr (assoc :result-type params)))
+         (result-type (cdr (assq :result-type params)))
          (full-body (org-babel-expand-body:generic
                      body params))
          (result (org-babel-scala-evaluate
@@ -54,9 +54,9 @@ called by `org-babel-execute-src-block'"
     (org-babel-reassemble-table
      result
      (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+      (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
      (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+      (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defvar org-babel-scala-wrapper-method
 

+ 8 - 8
lisp/ob-scheme.el

@@ -185,23 +185,23 @@ This function is called by `org-babel-execute-src-block'"
 			      (buffer-name source-buffer))))
     (save-excursion
       (org-babel-reassemble-table
-       (let* ((result-type (cdr (assoc :result-type params)))
-	      (impl (or (when (cdr (assoc :scheme params))
-			  (intern (cdr (assoc :scheme params))))
+       (let* ((result-type (cdr (assq :result-type params)))
+	      (impl (or (when (cdr (assq :scheme params))
+			  (intern (cdr (assq :scheme params))))
 			geiser-default-implementation
 			(car geiser-active-implementations)))
 	      (session (org-babel-scheme-make-session-name
-			source-buffer-name (cdr (assoc :session params)) impl))
+			source-buffer-name (cdr (assq :session params)) impl))
 	      (full-body (org-babel-expand-body:scheme body params)))
 	 (org-babel-scheme-execute-with-geiser
 	  full-body			 ; code
 	  (string= result-type "output") ; output?
 	  impl				 ; implementation
 	  (and (not (string= session "none")) session))) ; session
-       (org-babel-pick-name (cdr (assoc :colname-names params))
-			    (cdr (assoc :colnames params)))
-       (org-babel-pick-name (cdr (assoc :rowname-names params))
-			    (cdr (assoc :rownames params)))))))
+       (org-babel-pick-name (cdr (assq :colname-names params))
+			    (cdr (assq :colnames params)))
+       (org-babel-pick-name (cdr (assq :rowname-names params))
+			    (cdr (assq :rownames params)))))))
 
 (provide 'ob-scheme)
 

+ 4 - 4
lisp/ob-screen.el

@@ -48,7 +48,7 @@ In case you want to use a different screen than one selected by your $PATH")
 \"default\" session is used when none is specified."
   (message "Sending source code block to interactive terminal session...")
   (save-window-excursion
-    (let* ((session (cdr (assoc :session params)))
+    (let* ((session (cdr (assq :session params)))
            (socket (org-babel-screen-session-socketname session)))
       (unless socket (org-babel-prep-session:screen session params))
       (org-babel-screen-session-execute-string
@@ -56,9 +56,9 @@ In case you want to use a different screen than one selected by your $PATH")
 
 (defun org-babel-prep-session:screen (_session params)
   "Prepare SESSION according to the header arguments specified in PARAMS."
-  (let* ((session (cdr (assoc :session params)))
-         (cmd (cdr (assoc :cmd params)))
-         (terminal (cdr (assoc :terminal params)))
+  (let* ((session (cdr (assq :session params)))
+         (cmd (cdr (assq :cmd params)))
+         (terminal (cdr (assq :terminal params)))
          (process-name (concat "org-babel: terminal (" session ")")))
     (apply 'start-process process-name "*Messages*"
            terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location

+ 15 - 15
lisp/ob-shell.el

@@ -69,19 +69,19 @@ outside the Customize interface."
   "Execute a block of Shell commands with Babel.
 This function is called by `org-babel-execute-src-block'."
   (let* ((session (org-babel-sh-initiate-session
-		   (cdr (assoc :session params))))
-	 (stdin (let ((stdin (cdr (assoc :stdin params))))
+		   (cdr (assq :session params))))
+	 (stdin (let ((stdin (cdr (assq :stdin params))))
                   (when stdin (org-babel-sh-var-to-string
                                (org-babel-ref-resolve stdin)))))
-	 (cmdline (cdr (assoc :cmdline params)))
+	 (cmdline (cdr (assq :cmdline params)))
          (full-body (org-babel-expand-body:generic
 		     body params (org-babel-variable-assignments:shell params))))
     (org-babel-reassemble-table
      (org-babel-sh-evaluate session full-body params stdin cmdline)
      (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+      (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
      (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+      (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defun org-babel-prep-session:shell (session params)
   "Prepare SESSION according to the header arguments specified in PARAMS."
@@ -142,9 +142,9 @@ This function is called by `org-babel-execute-src-block'."
 
 (defun org-babel-variable-assignments:shell (params)
   "Return list of shell statements assigning the block's variables."
-  (let ((sep (cdr (assoc :separator params)))
-	(hline (when (string= "yes" (cdr (assoc :hlines params)))
-		 (or (cdr (assoc :hline-string params))
+  (let ((sep (cdr (assq :separator params)))
+	(hline (when (string= "yes" (cdr (assq :hlines params)))
+		 (or (cdr (assq :hline-string params))
 		     "hline"))))
     (mapcar
      (lambda (pair)
@@ -203,8 +203,8 @@ return the value of the last statement in BODY."
           ((or stdin cmdline)	       ; external shell script w/STDIN
            (let ((script-file (org-babel-temp-file "sh-script-"))
                  (stdin-file (org-babel-temp-file "sh-stdin-"))
-                 (shebang (cdr (assoc :shebang params)))
-                 (padline (not (string= "no" (cdr (assoc :padline params))))))
+                 (shebang (cdr (assq :shebang params)))
+                 (padline (not (string= "no" (cdr (assq :padline params))))))
              (with-temp-file script-file
                (when shebang (insert (concat shebang "\n")))
                (when padline (insert "\n"))
@@ -242,11 +242,11 @@ return the value of the last statement in BODY."
                   (list org-babel-sh-eoe-indicator))))
               2)) "\n"))
           ('otherwise                   ; external shell script
-           (if (and (cdr (assoc :shebang params))
-                    (> (length (cdr (assoc :shebang params))) 0))
+           (if (and (cdr (assq :shebang params))
+                    (> (length (cdr (assq :shebang params))) 0))
                (let ((script-file (org-babel-temp-file "sh-script-"))
-                     (shebang (cdr (assoc :shebang params)))
-                     (padline (not (equal "no" (cdr (assoc :padline params))))))
+                     (shebang (cdr (assq :shebang params)))
+                     (padline (not (equal "no" (cdr (assq :padline params))))))
                  (with-temp-file script-file
                    (when shebang (insert (concat shebang "\n")))
                    (when padline (insert "\n"))
@@ -255,7 +255,7 @@ return the value of the last statement in BODY."
                  (org-babel-eval script-file ""))
              (org-babel-eval shell-file-name (org-trim body)))))))
     (when results
-      (let ((result-params (cdr (assoc :result-params params))))
+      (let ((result-params (cdr (assq :result-params params))))
         (org-babel-result-cond result-params
           results
           (let ((tmp-file (org-babel-temp-file "sh-")))

+ 1 - 1
lisp/ob-shen.el

@@ -63,7 +63,7 @@
   "Execute a block of Shen code with org-babel.
 This function is called by `org-babel-execute-src-block'"
   (require 'inf-shen)
-  (let* ((result-params (cdr (assoc :result-params params)))
+  (let* ((result-params (cdr (assq :result-params params)))
          (full-body (org-babel-expand-body:shen body params)))
     (let ((results
            (with-temp-buffer

+ 13 - 13
lisp/ob-sql.el

@@ -129,17 +129,17 @@ function."
 (defun org-babel-execute:sql (body params)
   "Execute a block of Sql code with Babel.
 This function is called by `org-babel-execute-src-block'."
-  (let* ((result-params (cdr (assoc :result-params params)))
-         (cmdline (cdr (assoc :cmdline params)))
-         (dbhost (cdr (assoc :dbhost params)))
+  (let* ((result-params (cdr (assq :result-params params)))
+         (cmdline (cdr (assq :cmdline params)))
+         (dbhost (cdr (assq :dbhost params)))
          (dbport (cdr (assq :dbport params)))
-         (dbuser (cdr (assoc :dbuser params)))
-         (dbpassword (cdr (assoc :dbpassword params)))
-         (database (cdr (assoc :database params)))
-         (engine (cdr (assoc :engine params)))
-         (colnames-p (not (equal "no" (cdr (assoc :colnames params)))))
+         (dbuser (cdr (assq :dbuser params)))
+         (dbpassword (cdr (assq :dbpassword params)))
+         (database (cdr (assq :database params)))
+         (engine (cdr (assq :engine params)))
+         (colnames-p (not (equal "no" (cdr (assq :colnames params)))))
          (in-file (org-babel-temp-file "sql-in-"))
-         (out-file (or (cdr (assoc :out-file params))
+         (out-file (or (cdr (assq :out-file params))
                        (org-babel-temp-file "sql-out-")))
 	 (header-delim "")
          (command (pcase (intern engine)
@@ -246,10 +246,10 @@ SET COLSEP '|'
 		       'hline
 		     x))
 		 (org-table-to-lisp))
-	 (org-babel-pick-name (cdr (assoc :colname-names params))
-			      (cdr (assoc :colnames params)))
-	 (org-babel-pick-name (cdr (assoc :rowname-names params))
-			      (cdr (assoc :rownames params))))))))
+	 (org-babel-pick-name (cdr (assq :colname-names params))
+			      (cdr (assq :colnames params)))
+	 (org-babel-pick-name (cdr (assq :rowname-names params))
+			      (cdr (assq :rownames params))))))))
 
 (defun org-babel-sql-expand-vars (body vars)
   "Expand the variables held in VARS in BODY."

+ 5 - 5
lisp/ob-sqlite.el

@@ -60,11 +60,11 @@
 (defun org-babel-execute:sqlite (body params)
   "Execute a block of Sqlite code with Babel.
 This function is called by `org-babel-execute-src-block'."
-  (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
-	(db (cdr (assoc :db params)))
-	(separator (cdr (assoc :separator params)))
-	(nullvalue (cdr (assoc :nullvalue params)))
-	(headers-p (equal "yes" (cdr (assoc :colnames params))))
+  (let ((result-params (split-string (or (cdr (assq :results params)) "")))
+	(db (cdr (assq :db params)))
+	(separator (cdr (assq :separator params)))
+	(nullvalue (cdr (assq :nullvalue params)))
+	(headers-p (equal "yes" (cdr (assq :colnames params))))
 	(others (delq nil (mapcar
 			   (lambda (arg) (car (assq arg params)))
 			   (list :header :echo :bail :column

+ 5 - 5
lisp/ob-tangle.el

@@ -227,7 +227,7 @@ used to limit the exported source code blocks by language."
 	       org-babel-default-header-args))
 	    (tangle-file
 	     (when (equal arg '(16))
-	       (or (cdr (assoc :tangle (nth 2 (org-babel-get-src-block-info 'light))))
+	       (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info 'light))))
 		   (user-error "Point is not in a source code block"))))
 	    path-collector)
 	(mapc ;; map over all languages
@@ -284,7 +284,7 @@ used to limit the exported source code blocks by language."
 			      (insert-file-contents file-name))
 			    (goto-char (point-max))
 			    ;; Handle :padlines unless first line in file
-			    (unless (or (string= "no" (cdr (assoc :padline (nth 4 spec))))
+			    (unless (or (string= "no" (cdr (assq :padline (nth 4 spec))))
 					(= (point) (point-min)))
 			      (insert "\n"))
 			    (insert content)
@@ -470,7 +470,7 @@ list to be used by `org-babel-tangle' directly."
                       (org-babel-expand-noweb-references info)
                     (nth 1 info)))
                  (body
-                  (if (assoc :no-expand params)
+                  (if (assq :no-expand params)
                       body
                     (if (fboundp expand-cmd)
                         (funcall expand-cmd body params)
@@ -488,8 +488,8 @@ list to be used by `org-babel-tangle' directly."
               (run-hooks 'org-babel-tangle-body-hook)
               (buffer-string))))
 	 (comment
-	  (when (or (string= "both" (cdr (assoc :comments params)))
-		    (string= "org" (cdr (assoc :comments params))))
+	  (when (or (string= "both" (cdr (assq :comments params)))
+		    (string= "org" (cdr (assq :comments params))))
 	    ;; From the previous heading or code-block end
 	    (funcall
 	     org-babel-process-comment-text

+ 1 - 1
lisp/org-src.el

@@ -632,7 +632,7 @@ See also `org-src-mode-hook'."
 (defun org-src-associate-babel-session (info)
   "Associate edit buffer with comint session."
   (interactive)
-  (let ((session (cdr (assoc :session (nth 2 info)))))
+  (let ((session (cdr (assq :session (nth 2 info)))))
     (and session (not (string= session "none"))
 	 (org-babel-comint-buffer-livep session)
 	 (let ((f (intern (format "org-babel-%s-associate-session"

+ 1 - 1
lisp/org.el

@@ -10602,7 +10602,7 @@ If the link is in hidden text, expose it."
   (setq org-link-search-failed nil)
   (let* ((pos (point))
 	 (ct (org-context))
-	 (a (assoc :link ct))
+	 (a (assq :link ct))
 	 (srch-fun (if search-backward 're-search-backward 're-search-forward)))
     (cond (a (goto-char (nth (if search-backward 1 2) a)))
 	  ((looking-at org-any-link-re)