Browse Source

babel: replacing functions like "fifth" with "nth 4"

Eric Schulte 15 years ago
parent
commit
6fa2ab7eac

+ 2 - 2
lisp/babel/langs/ob-emacs-lisp.el

@@ -48,9 +48,9 @@
 (defun org-babel-expand-body:emacs-lisp (body params &optional processed-params)
 (defun org-babel-expand-body:emacs-lisp (body params &optional processed-params)
   "Expand BODY according to PARAMS, return the expanded body."
   "Expand BODY according to PARAMS, return the expanded body."
   (let* ((processed-params (or processed-params (org-babel-process-params params)))
   (let* ((processed-params (or processed-params (org-babel-process-params params)))
-         (vars (second processed-params))
+         (vars (nth 1 processed-params))
          (processed-params (org-babel-process-params params))
          (processed-params (org-babel-process-params params))
-         (result-params (third processed-params))
+         (result-params (nth 2 processed-params))
          (print-level nil) (print-length nil)
          (print-level nil) (print-length nil)
          (body (if (> (length vars) 0)
          (body (if (> (length vars) 0)
 		   (concat "(let ("
 		   (concat "(let ("

+ 3 - 3
lisp/babel/langs/ob-sh.el

@@ -42,7 +42,7 @@
 
 
 (defun org-babel-expand-body:sh (body params &optional processed-params)
 (defun org-babel-expand-body:sh (body params &optional processed-params)
   "Expand BODY according to PARAMS, return the expanded body."
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (second (or processed-params (org-babel-process-params params))))
+  (let ((vars (nth 1 (or processed-params (org-babel-process-params params))))
         (sep (cdr (assoc :separator params))))
         (sep (cdr (assoc :separator params))))
     (concat
     (concat
    (mapconcat ;; define any variables
    (mapconcat ;; define any variables
@@ -57,8 +57,8 @@
 function is called by `org-babel-execute-src-block'."
 function is called by `org-babel-execute-src-block'."
   (message "executing Shell source code block")
   (message "executing Shell source code block")
   (let* ((processed-params (org-babel-process-params params))
   (let* ((processed-params (org-babel-process-params params))
-         (session (org-babel-sh-initiate-session (first processed-params)))
-         (result-params (third processed-params)) 
+         (session (org-babel-sh-initiate-session (nth 0 processed-params)))
+         (result-params (nth 2 processed-params)) 
          (full-body (org-babel-expand-body:sh
          (full-body (org-babel-expand-body:sh
                      body params processed-params))) ;; then the source block body
                      body params processed-params))) ;; then the source block body
     (org-babel-reassemble-table
     (org-babel-reassemble-table

+ 18 - 18
lisp/babel/ob-exp.el

@@ -80,18 +80,18 @@ results - just like none only the block is run on export ensuring
 none ----- do not display either code or results upon export"
 none ----- do not display either code or results upon export"
   (interactive)
   (interactive)
   (message "org-babel-exp processing...")
   (message "org-babel-exp processing...")
-  (when (member (first headers) org-babel-interpreters)
+  (when (member (nth 0 headers) org-babel-interpreters)
     (save-excursion
     (save-excursion
       (goto-char (match-beginning 0))
       (goto-char (match-beginning 0))
       (let* ((info (org-babel-get-src-block-info))
       (let* ((info (org-babel-get-src-block-info))
-	     (params (third info)))
+	     (params (nth 2 info)))
 	;; expand noweb references in the original file
 	;; expand noweb references in the original file
-	(setf (second info)
+	(setf (nth 1 info)
 	      (if (and (cdr (assoc :noweb params))
 	      (if (and (cdr (assoc :noweb params))
 		       (string= "yes" (cdr (assoc :noweb params))))
 		       (string= "yes" (cdr (assoc :noweb params))))
 		  (org-babel-expand-noweb-references
 		  (org-babel-expand-noweb-references
 		   info (get-file-buffer org-current-export-file))
 		   info (get-file-buffer org-current-export-file))
-		(second info)))
+		(nth 1 info)))
 	(org-babel-exp-do-export info 'block)))))
 	(org-babel-exp-do-export info 'block)))))
 
 
 (defun org-babel-exp-inline-src-blocks (start end)
 (defun org-babel-exp-inline-src-blocks (start end)
@@ -104,18 +104,18 @@ options and are taken from `org-babel-defualt-inline-header-args'."
     (while (and (< (point) end)
     (while (and (< (point) end)
                 (re-search-forward org-babel-inline-src-block-regexp end t))
                 (re-search-forward org-babel-inline-src-block-regexp end t))
       (let* ((info (save-match-data (org-babel-parse-inline-src-block-match)))
       (let* ((info (save-match-data (org-babel-parse-inline-src-block-match)))
-	     (params (third info))
+	     (params (nth 2 info))
 	     (replacement
 	     (replacement
 	      (save-match-data
 	      (save-match-data
 		(if (org-babel-in-example-or-verbatim)
 		(if (org-babel-in-example-or-verbatim)
 		    (buffer-substring (match-beginning 0) (match-end 0))
 		    (buffer-substring (match-beginning 0) (match-end 0))
 		  ;; expand noweb references in the original file
 		  ;; expand noweb references in the original file
-		  (setf (second info)
+		  (setf (nth 1 info)
 			(if (and (cdr (assoc :noweb params))
 			(if (and (cdr (assoc :noweb params))
 				 (string= "yes" (cdr (assoc :noweb params))))
 				 (string= "yes" (cdr (assoc :noweb params))))
 			    (org-babel-expand-noweb-references
 			    (org-babel-expand-noweb-references
 			     info (get-file-buffer org-current-export-file))
 			     info (get-file-buffer org-current-export-file))
-			  (second info)))
+			  (nth 1 info)))
 		  (org-babel-exp-do-export info 'inline)))))
 		  (org-babel-exp-do-export info 'inline)))))
 	(setq end (+ end (- (length replacement) (length (match-string 1)))))
 	(setq end (+ end (- (length replacement) (length (match-string 1)))))
 	(replace-match replacement t t nil 1)))))
 	(replace-match replacement t t nil 1)))))
@@ -176,13 +176,13 @@ options are taken from `org-babel-default-header-args'."
 (defun org-babel-exp-do-export (info type)
 (defun org-babel-exp-do-export (info type)
   "Return a string containing the exported content of the current
   "Return a string containing the exported content of the current
 code block respecting the value of the :exports header argument."
 code block respecting the value of the :exports header argument."
-  (flet ((silently () (let ((session (cdr (assoc :session (third info)))))
+  (flet ((silently () (let ((session (cdr (assoc :session (nth 2 info)))))
 			(when (and session
 			(when (and session
 				   (not (equal "none" session))
 				   (not (equal "none" session))
-				   (not (assoc :noeval (third info))))
+				   (not (assoc :noeval (nth 2 info))))
 			  (org-babel-exp-results info type 'silent))))
 			  (org-babel-exp-results info type 'silent))))
 	 (clean () (org-babel-remove-result info)))
 	 (clean () (org-babel-remove-result info)))
-    (case (intern (or (cdr (assoc :exports (third info))) "code"))
+    (case (intern (or (cdr (assoc :exports (nth 2 info))) "code"))
       ('none (silently) (clean) "")
       ('none (silently) (clean) "")
       ('code (silently) (clean) (org-babel-exp-code info type))
       ('code (silently) (clean) (org-babel-exp-code info type))
       ('results (org-babel-exp-results info type))
       ('results (org-babel-exp-results info type))
@@ -195,13 +195,13 @@ code block respecting the value of the :exports header argument."
 for exportation by org-mode.  This function is called by
 for exportation by org-mode.  This function is called by
 `org-babel-exp-do-export'.  The code block will not be
 `org-babel-exp-do-export'.  The code block will not be
 evaluated."
 evaluated."
-  (let ((lang (first info))
-        (body (second info))
-        (switches (fourth info))
-        (name (fifth info))
+  (let ((lang (nth 0 info))
+        (body (nth 1 info))
+        (switches (nth 3 info))
+        (name (nth 4 info))
         (args (mapcar
         (args (mapcar
 	       #'cdr
 	       #'cdr
-	       (remove-if-not (lambda (el) (eq :var (car el))) (third info)))))
+	       (remove-if-not (lambda (el) (eq :var (car el))) (nth 2 info)))))
     (case type
     (case type
       ('inline (format "=%s=" body))
       ('inline (format "=%s=" body))
       ('block
       ('block
@@ -233,8 +233,8 @@ suitable for exportation by org-mode.  This function is called by
 `org-babel-exp-do-export'.  The code block will be evaluated.
 `org-babel-exp-do-export'.  The code block will be evaluated.
 Optional argument SILENT can be used to inhibit insertion of
 Optional argument SILENT can be used to inhibit insertion of
 results into the buffer."
 results into the buffer."
-  (let ((lang (first info))
-	(body (second info))
+  (let ((lang (nth 0 info))
+	(body (nth 1 info))
 	(params
 	(params
 	 ;; lets ensure that we lookup references in the original file
 	 ;; lets ensure that we lookup references in the original file
 	 (mapcar
 	 (mapcar
@@ -247,7 +247,7 @@ results into the buffer."
 				  "=" org-current-export-file
 				  "=" org-current-export-file
 				  ":" (match-string 2 (cdr pair))))
 				  ":" (match-string 2 (cdr pair))))
 	      pair))
 	      pair))
-	  (third info))))
+	  (nth 2 info))))
     (case type
     (case type
       ('inline
       ('inline
         (let ((raw (org-babel-execute-src-block
         (let ((raw (org-babel-execute-src-block

+ 3 - 3
lisp/babel/ob-lob.el

@@ -50,7 +50,7 @@ add files to this list use the `org-babel-lob-ingest' command."
   (interactive "f")
   (interactive "f")
   (org-babel-map-source-blocks file
   (org-babel-map-source-blocks file
     (let* ((info (org-babel-get-src-block-info))
     (let* ((info (org-babel-get-src-block-info))
-	   (source-name (intern (fifth info))))
+	   (source-name (intern (nth 4 info))))
       (when source-name
       (when source-name
         (setq org-babel-library-of-babel
         (setq org-babel-library-of-babel
               (cons (cons source-name info)
               (cons (cons source-name info)
@@ -76,7 +76,7 @@ src-block and if so then run the appropriate source block from
 the Library."
 the Library."
   (interactive)
   (interactive)
   (let ((info (org-babel-lob-get-info)))
   (let ((info (org-babel-lob-get-info)))
-    (if (first info) (progn (org-babel-lob-execute info) t) nil)))
+    (if (nth 0 info) (progn (org-babel-lob-execute info) t) nil)))
 
 
 (add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-lob-execute-maybe)
 (add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-lob-execute-maybe)
 
 
@@ -109,7 +109,7 @@ the word 'call'."
 		  (org-babel-clean-text-properties
 		  (org-babel-clean-text-properties
 		   (concat ":var results=" (mapconcat #'identity (butlast info) " ")))))))
 		   (concat ":var results=" (mapconcat #'identity (butlast info) " ")))))))
     (org-babel-execute-src-block
     (org-babel-execute-src-block
-     nil (list "emacs-lisp" "results" params nil nil (third info)))))
+     nil (list "emacs-lisp" "results" params nil nil (nth 2 info)))))
 
 
 (provide 'ob-lob)
 (provide 'ob-lob)
 ;;; ob-lob.el ends here
 ;;; ob-lob.el ends here

+ 2 - 2
lisp/babel/ob-table.el

@@ -82,7 +82,7 @@ rather than a single \"$\" (i.e. \"$$2\" instead of \"$2\" in the
 example above."
 example above."
   (let ((variables (mapcar
   (let ((variables (mapcar
                     (lambda (var)
                     (lambda (var)
-                      (if (and (= 3 (length var)) (eq (second var) '$))
+                      (if (and (= 3 (length var)) (eq (nth 1 var) '$))
                           (list (car var) (format "\"%s\"" (last var)))
                           (list (car var) (format "\"%s\"" (last var)))
                         var))
                         var))
                     variables)))
                     variables)))
@@ -95,7 +95,7 @@ example above."
                                 ,source-block
                                 ,source-block
                                 "("
                                 "("
                                 (mapconcat (lambda (var-spec)
                                 (mapconcat (lambda (var-spec)
-                                             (format "%S=%s" (first var-spec) (second var-spec)))
+                                             (format "%S=%s" (nth 0 var-spec) (nth 1 var-spec)))
                                            ',variables ", ")
                                            ',variables ", ")
                                 ")")))))
                                 ")")))))
            (org-babel-execute-src-block
            (org-babel-execute-src-block

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

@@ -55,7 +55,7 @@ file using `load-file'."
   (flet ((age (file)
   (flet ((age (file)
               (time-to-seconds
               (time-to-seconds
                (time-subtract (current-time)
                (time-subtract (current-time)
-                              (sixth (or (file-attributes (file-truename file))
+                              (nth 5 (or (file-attributes (file-truename file))
                                          (file-attributes file)))))))
                                          (file-attributes file)))))))
     (let* ((base-name (file-name-sans-extension file))
     (let* ((base-name (file-name-sans-extension file))
            (exported-file (concat base-name ".el")))
            (exported-file (concat base-name ".el")))
@@ -109,14 +109,14 @@ exported source code blocks by language."
 			      lang)
 			      lang)
 			  "-mode")))
 			  "-mode")))
                 (lang-specs (cdr (assoc lang org-babel-tangle-langs)))
                 (lang-specs (cdr (assoc lang org-babel-tangle-langs)))
-                (ext (first lang-specs))
-                (she-bang (second lang-specs))
-                (commentable (and (fboundp lang-f) (not (third lang-specs))))
+                (ext (nth 0 lang-specs))
+                (she-bang (nth 1 lang-specs))
+                (commentable (and (fboundp lang-f) (not (nth 2 lang-specs))))
                 she-banged)
                 she-banged)
            (mapc
            (mapc
             (lambda (spec)
             (lambda (spec)
               (flet ((get-spec (name)
               (flet ((get-spec (name)
-                               (cdr (assoc name (third spec)))))
+                               (cdr (assoc name (nth 2 spec)))))
                 (let* ((tangle (get-spec :tangle))
                 (let* ((tangle (get-spec :tangle))
                        (she-bang (if (> (length (get-spec :shebang)) 0)
                        (she-bang (if (> (length (get-spec :shebang)) 0)
                                      (get-spec :shebang)
                                      (get-spec :shebang)
@@ -189,11 +189,11 @@ code blocks by language."
                           (org-babel-clean-text-properties
                           (org-babel-clean-text-properties
 			   (car (pop org-stored-links)))))
 			   (car (pop org-stored-links)))))
              (info (org-babel-get-src-block-info))
              (info (org-babel-get-src-block-info))
-             (source-name (intern (or (fifth info)
+             (source-name (intern (or (nth 4 info)
                                       (format "block-%d" block-counter))))
                                       (format "block-%d" block-counter))))
-             (src-lang (first info))
+             (src-lang (nth 0 info))
 	     (expand-cmd (intern (concat "org-babel-expand-body:" src-lang)))
 	     (expand-cmd (intern (concat "org-babel-expand-body:" src-lang)))
-             (params (third info))
+             (params (nth 2 info))
              by-lang)
              by-lang)
         (unless (string= (cdr (assoc :tangle params)) "no") ;; skip
         (unless (string= (cdr (assoc :tangle params)) "no") ;; skip
           (unless (and lang (not (string= lang src-lang))) ;; limit by language
           (unless (and lang (not (string= lang src-lang))) ;; limit by language
@@ -219,8 +219,8 @@ code blocks by language."
 						(cdr (assoc :noweb params))))
 						(cdr (assoc :noweb params))))
                                           (org-babel-expand-noweb-references
                                           (org-babel-expand-noweb-references
 					   info)
 					   info)
-					(second info)))
-                                     (third
+					(nth 1 info)))
+                                     (nth 2
 				      (cdr (assoc src-lang
 				      (cdr (assoc src-lang
 						  org-babel-tangle-langs))))
 						  org-babel-tangle-langs))))
                                by-lang)) blocks))))))
                                by-lang)) blocks))))))
@@ -248,14 +248,14 @@ form
 					   (progn (insert text) (point)))
 					   (progn (insert text) (point)))
                            (end-of-line nil)
                            (end-of-line nil)
                            (insert "\n"))))
                            (insert "\n"))))
-    (let ((link (first spec))
-          (source-name (second spec))
-          (body (fourth spec))
-          (commentable (not (if (> (length (cdr (assoc :comments (third spec))))
+    (let ((link (nth 0 spec))
+          (source-name (nth 1 spec))
+          (body (nth 3 spec))
+          (commentable (not (if (> (length (cdr (assoc :comments (nth 2 spec))))
 				   0)
 				   0)
-                                (string= (cdr (assoc :comments (third spec)))
+                                (string= (cdr (assoc :comments (nth 2 spec)))
 					 "no")
 					 "no")
-                              (fifth spec)))))
+                              (nth 4 spec)))))
       (insert-comment (format "[[%s][%s]]" (org-link-escape link) source-name))
       (insert-comment (format "[[%s][%s]]" (org-link-escape link) source-name))
       (insert (format "\n%s\n" (replace-regexp-in-string
       (insert (format "\n%s\n" (replace-regexp-in-string
 				"^," "" (org-babel-chomp body))))
 				"^," "" (org-babel-chomp body))))

+ 29 - 29
lisp/babel/ob.el

@@ -82,8 +82,8 @@ function is called when `org-edit-special' is called with a
 prefix argument from inside of a source-code block."
 prefix argument from inside of a source-code block."
   (when current-prefix-arg
   (when current-prefix-arg
     (let* ((info (org-babel-get-src-block-info))
     (let* ((info (org-babel-get-src-block-info))
-           (lang (first info))
-           (params (third info))
+           (lang (nth 0 info))
+           (params (nth 2 info))
            (session (cdr (assoc :session params))))
            (session (cdr (assoc :session params))))
       (when (and info session) ;; we are in a source-code block with a session
       (when (and info session) ;; we are in a source-code block with a session
         (funcall
         (funcall
@@ -246,9 +246,9 @@ the header arguments specified at the front of the source code
 block."
 block."
   (interactive)
   (interactive)
   (let* ((info (or info (org-babel-get-src-block-info)))
   (let* ((info (or info (org-babel-get-src-block-info)))
-         (lang (first info))
-	 (params (setf (third info)
-                       (sort (org-babel-merge-params (third info) params)
+         (lang (nth 0 info))
+	 (params (setf (nth 2 info)
+                       (sort (org-babel-merge-params (nth 2 info) params)
                              (lambda (el1 el2) (string< (symbol-name (car el1))
                              (lambda (el1 el2) (string< (symbol-name (car el1))
                                                    (symbol-name (car el2)))))))
                                                    (symbol-name (car el2)))))))
          (new-hash
          (new-hash
@@ -256,11 +256,11 @@ block."
                    (string= "yes" (cdr (assoc :cache params))))
                    (string= "yes" (cdr (assoc :cache params))))
               (org-babel-sha1-hash info)))
               (org-babel-sha1-hash info)))
          (old-hash (org-babel-result-hash info))
          (old-hash (org-babel-result-hash info))
-         (body (setf (second info)
+         (body (setf (nth 1 info)
 		     (if (and (cdr (assoc :noweb params))
 		     (if (and (cdr (assoc :noweb params))
                               (string= "yes" (cdr (assoc :noweb params))))
                               (string= "yes" (cdr (assoc :noweb params))))
                          (org-babel-expand-noweb-references info)
                          (org-babel-expand-noweb-references info)
-		       (second info))))
+		       (nth 1 info))))
          (result-params (split-string (or (cdr (assoc :results params)) "")))
          (result-params (split-string (or (cdr (assoc :results params)) "")))
          (result-type (cond ((member "output" result-params) 'output)
          (result-type (cond ((member "output" result-params) 'output)
 			    ((member "value" result-params) 'value)
 			    ((member "value" result-params) 'value)
@@ -310,15 +310,15 @@ org-babel-expand-body:lang function." body)
 arguments, and pop open the results in a preview buffer."
 arguments, and pop open the results in a preview buffer."
   (interactive)
   (interactive)
   (let* ((info (or info (org-babel-get-src-block-info)))
   (let* ((info (or info (org-babel-get-src-block-info)))
-         (lang (first info))
-	 (params (setf (third info)
-                       (sort (org-babel-merge-params (third info) params)
+         (lang (nth 0 info))
+	 (params (setf (nth 2 info)
+                       (sort (org-babel-merge-params (nth 2 info) params)
                              (lambda (el1 el2) (string< (symbol-name (car el1))
                              (lambda (el1 el2) (string< (symbol-name (car el1))
                                                    (symbol-name (car el2)))))))
                                                    (symbol-name (car el2)))))))
-         (body (setf (second info)
+         (body (setf (nth 1 info)
 		     (if (and (cdr (assoc :noweb params))
 		     (if (and (cdr (assoc :noweb params))
                               (string= "yes" (cdr (assoc :noweb params))))
                               (string= "yes" (cdr (assoc :noweb params))))
-			 (org-babel-expand-noweb-references info) (second info))))
+			 (org-babel-expand-noweb-references info) (nth 1 info))))
          (cmd (intern (concat "org-babel-expand-body:" lang)))
          (cmd (intern (concat "org-babel-expand-body:" lang)))
          (expanded (funcall (if (fboundp cmd) cmd 'org-babel-expand-body:generic)
          (expanded (funcall (if (fboundp cmd) cmd 'org-babel-expand-body:generic)
                             body params)))
                             body params)))
@@ -331,9 +331,9 @@ header arguments for the source block before entering the
 session.  After loading the body this pops open the session."
 session.  After loading the body this pops open the session."
   (interactive)
   (interactive)
   (let* ((info (or info (org-babel-get-src-block-info)))
   (let* ((info (or info (org-babel-get-src-block-info)))
-         (lang (first info))
-         (body (second info))
-         (params (third info))
+         (lang (nth 0 info))
+         (body (nth 1 info))
+         (params (nth 2 info))
          (session (cdr (assoc :session params))))
          (session (cdr (assoc :session params))))
     (unless (member lang org-babel-interpreters)
     (unless (member lang org-babel-interpreters)
       (error "Language is not in `org-babel-interpreters': %s" lang))
       (error "Language is not in `org-babel-interpreters': %s" lang))
@@ -350,9 +350,9 @@ for the source block before entering the session. Copy the body
 of the source block to the kill ring."
 of the source block to the kill ring."
   (interactive)
   (interactive)
   (let* ((info (or info (org-babel-get-src-block-info)))
   (let* ((info (or info (org-babel-get-src-block-info)))
-         (lang (first info))
-         (body (second info))
-         (params (third info))
+         (lang (nth 0 info))
+         (body (nth 1 info))
+         (params (nth 2 info))
          (session (cdr (assoc :session params)))
          (session (cdr (assoc :session params)))
 	 (dir (cdr (assoc :dir params)))
 	 (dir (cdr (assoc :dir params)))
 	 (default-directory
 	 (default-directory
@@ -463,8 +463,8 @@ added to the header-arguments-alist."
 					 (lambda (ref) (cons :var ref))
 					 (lambda (ref) (cons :var ref))
 					 (org-babel-ref-split-args args))))))
 					 (org-babel-ref-split-args args))))))
 		(unless header-vars-only
 		(unless header-vars-only
-		  (setf (third info)
-			(org-babel-merge-params (sixth info) (third info)))))
+		  (setf (nth 2 info)
+			(org-babel-merge-params (nth 5 info) (nth 2 info)))))
 	    (setq info (append info (list nil nil))))
 	    (setq info (append info (list nil nil))))
 	  (append info (list indent)))
 	  (append info (list indent)))
       (if (save-excursion ;; inline source block
       (if (save-excursion ;; inline source block
@@ -478,8 +478,8 @@ added to the header-arguments-alist."
   (interactive)
   (interactive)
   (let* ((info (or info (org-babel-get-src-block-info)))
   (let* ((info (or info (org-babel-get-src-block-info)))
          (hash (sha1 (format "%s-%s" (mapconcat (lambda (arg) (format "%S" arg))
          (hash (sha1 (format "%s-%s" (mapconcat (lambda (arg) (format "%S" arg))
-                                                (third info) ":")
-                             (second info)))))
+                                                (nth 2 info) ":")
+                             (nth 1 info)))))
     (when (interactive-p) (message hash))
     (when (interactive-p) (message hash))
     hash))
     hash))
 
 
@@ -747,7 +747,7 @@ Return a list (session vars result-params result-type colnames rownames)."
   "Return a cons cell, the `car' of which contains the TABLE less
   "Return a cons cell, the `car' of which contains the TABLE less
 colnames, and the `cdr' of which contains a list of the column
 colnames, and the `cdr' of which contains a list of the column
 names."
 names."
-  (if (equal 'hline (second table))
+  (if (equal 'hline (nth 1 table))
       (cons (cddr table) (car table))
       (cons (cddr table) (car table))
     (cons (cdr table) (car table))))
     (cons (cdr table) (car table))))
 
 
@@ -800,7 +800,7 @@ of the vars, cnames and rnames."
       (lambda (var)
       (lambda (var)
         (when (listp (cdr var))
         (when (listp (cdr var))
           (when (and (not (equal colnames "no"))
           (when (and (not (equal colnames "no"))
-                     (or colnames (and (equal (second (cdr var)) 'hline)
+                     (or colnames (and (equal (nth 1 (cdr var)) 'hline)
                                        (not (member 'hline (cddr (cdr var)))))))
                                        (not (member 'hline (cddr (cdr var)))))))
             (let ((both (org-babel-get-colnames (cdr var))))
             (let ((both (org-babel-get-colnames (cdr var))))
               (setq cnames (cons (cons (car var) (cdr both))
               (setq cnames (cons (cons (car var) (cdr both))
@@ -894,8 +894,8 @@ following the source block."
     (let* ((on-lob-line (progn (beginning-of-line 1)
     (let* ((on-lob-line (progn (beginning-of-line 1)
 			       (looking-at org-babel-lob-one-liner-regexp)))
 			       (looking-at org-babel-lob-one-liner-regexp)))
 	   (name (if on-lob-line
 	   (name (if on-lob-line
-		     (first (org-babel-lob-get-info))
-		   (fifth (or info (org-babel-get-src-block-info)))))
+		     (nth 0 (org-babel-lob-get-info))
+		   (nth 4 (or info (org-babel-get-src-block-info)))))
 	   (head (unless on-lob-line (org-babel-where-is-src-block-head))) end)
 	   (head (unless on-lob-line (org-babel-where-is-src-block-head))) end)
       (when head (goto-char head))
       (when head (goto-char head))
       (or (and name (org-babel-find-named-result name))
       (or (and name (org-babel-find-named-result name))
@@ -1031,7 +1031,7 @@ code ---- the results are extracted in the syntax of the source
 	(let ((existing-result (org-babel-where-is-src-block-result
 	(let ((existing-result (org-babel-where-is-src-block-result
 				t info hash indent))
 				t info hash indent))
 	      (results-switches
 	      (results-switches
-               (cdr (assoc :results_switches (third info))))
+               (cdr (assoc :results_switches (nth 2 info))))
 	      beg end)
 	      beg end)
 	  (when existing-result
 	  (when existing-result
 	    (goto-char existing-result)
 	    (goto-char existing-result)
@@ -1283,8 +1283,8 @@ these arguments are not evaluated in the current source-code
 block but are passed literally to the \"example-block\"."
 block but are passed literally to the \"example-block\"."
   (let* ((parent-buffer (or parent-buffer (current-buffer)))
   (let* ((parent-buffer (or parent-buffer (current-buffer)))
          (info (or info (org-babel-get-src-block-info)))
          (info (or info (org-babel-get-src-block-info)))
-         (lang (first info))
-         (body (second info))
+         (lang (nth 0 info))
+         (body (nth 1 info))
          (new-body "") index source-name evaluate prefix)
          (new-body "") index source-name evaluate prefix)
     (flet ((nb-add (text)
     (flet ((nb-add (text)
                    (setq new-body (concat new-body text))))
                    (setq new-body (concat new-body text))))