Function: table--generate-source-prologue

table--generate-source-prologue is a byte-compiled function defined in table.el.gz.

Signature

(table--generate-source-prologue DEST-BUFFER LANGUAGE CAPTION COL-LIST ROW-LIST)

Documentation

Generate and insert source prologue into DEST-BUFFER.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/table.el.gz
(defun table--generate-source-prologue (dest-buffer language caption col-list _row-list)
  "Generate and insert source prologue into DEST-BUFFER."
  (with-current-buffer dest-buffer
    (cond
     ((eq language 'html)
      (insert (format "<!-- This HTML table template is generated by emacs %s -->\n" emacs-version)
	      (format "<table %s>\n" table-html-table-attribute)
	      (if (and (stringp caption)
		       (not (string= caption "")))
		  (format "  <caption>%s</caption>\n" caption)
		"")))
     ((eq language 'latex)
      (insert (format "%% This LaTeX table template is generated by emacs %s\n" emacs-version)
	      "\\begin{" table-latex-environment "}{|"
              (apply #'concat (make-list (length col-list) "l|")) "}\n"
	      "\\hline\n"))
     ((eq language 'cals)
      (insert (format "<!-- This CALS table template is generated by emacs %s -->\n" emacs-version)
	      "<table frame=\"all\">\n")
      (if (and (stringp caption)
	       (not (string= caption "")))
	  (insert "  <title>" caption "</title>\n"))
      (insert (format "  <tgroup cols=\"%d\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n" (length col-list)))
      (table-put-source-info 'colspec-marker (point-marker))
      (table-put-source-info 'row-type (if (zerop table-cals-thead-rows) "tbody" "thead"))
      (set-marker-insertion-type (table-get-source-info 'colspec-marker) nil) ;; insert after
      (insert (format "    <%s valign=\"top\">\n" (table-get-source-info 'row-type))))
     ((eq language 'mediawiki)
      (insert (format
               "<!-- This HTML table template is generated by Emacs %s -->\n"
               emacs-version))
      (insert "{|\n")))))