From 4bf38bdaf4cd38b59fafd48615cbdec03b854f9c Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Mon, 21 Mar 2011 23:37:45 +0530 Subject: [PATCH] org-html.el: Take care of byte-compiler warnings. * lisp/org-html.el (org-html-dyn-first-heading-pos) (org-parse-table-of-contents) (org-parse-entity-control-callbacks-alist) (org-parse-entity-format-callbacks-alist) (org-parse-get-callback, no-css): defvar these symbols to keep the byte-compiler happy. (org-do-format-table-table-html): Bind empty (org-html-prepare-toc): Bind quote-re0 (org-parse-format-table-row): Bind i. (org-html-format-table-cell): Use text. --- lisp/org-html.el | 60 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/lisp/org-html.el b/lisp/org-html.el index 1f8b6ec15..bd5374154 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1044,6 +1044,14 @@ PUB-DIR is set, use this as the publishing directory." (let* ((org-parse-get-callback 'org-html-get)) (org-do-export arg hidden ext-plist to-buffer body-only pub-dir))) +;; Following variables are let-bound while `org-do-export' is in +;; progress +(defvar org-html-dyn-first-heading-pos) +(defvar org-parse-table-of-contents) +(defvar org-parse-entity-control-callbacks-alist) +(defvar org-parse-entity-format-callbacks-alist) +(defvar org-parse-get-callback) + (defun org-do-export (arg &optional hidden ext-plist to-buffer body-only pub-dir) "Export the outline as a pretty HTML file." @@ -1583,6 +1591,9 @@ PUB-DIR is set, use this as the publishing directory." (throw 'exit bib)))) nil)))) +;; Following variable is defined for native tables i.e., when +;; `org-table-is-styled' evals to t. +(defvar no-css) (defvar org-table-number-regexp) ; defined in org-table.el (defun org-format-table-html (lines olines &optional no-css) "Find out which HTML converter to use and return the HTML code. @@ -1725,10 +1736,10 @@ But it has the disadvantage, that no cell- or row-spanning is allowed." (label nil) (org-table-style 'table-table) (org-table-is-styled nil) - fields org-table-ncols i (org-table-rownum -1)) + fields org-table-ncols i (org-table-rownum -1) + (empty (org-parse-format 'SPACES 1))) (org-parse-begin 'TABLE caption label attributes) (while (setq line (pop lines)) - (setq empty (org-parse-format 'SPACES 1)) (cond ((string-match "^[ \t]*\\+-" line) (when field-buffer @@ -2100,7 +2111,6 @@ the alist of previous items." (defvar org-html-footnote-buffer) (defvar org-html-output-buffer) - (defun org-html-end-export () ;; insert the table of contents (when (and org-export-with-toc (not body-only)) @@ -2272,7 +2282,8 @@ the alist of previous items." (insert toc-entry)) (defun org-html-prepare-toc (lines level-offset opt-plist umax-toc) - (let* ((org-min-level (org-get-min-level lines level-offset)) + (let* ((quote-re0 (concat "^[ \t]*" org-quote-string "\\>")) + (org-min-level (org-get-min-level lines level-offset)) (org-last-level org-min-level) level) (with-temp-buffer @@ -2281,8 +2292,8 @@ the alist of previous items." (org-parse-begin 'SECTION "table-of-contents") (insert (org-parse-format 'HEADING - (nth 3 (plist-get opt-plist :lang-words)) - org-export-html-toplevel-hlevel)) + (nth 3 (plist-get opt-plist :lang-words)) + org-export-html-toplevel-hlevel)) (org-parse-begin 'SECTION "text-table-of-contents") (org-parse-begin 'LIST 'unordered) (org-parse-begin 'LIST-ITEM 'unordered) @@ -2315,7 +2326,7 @@ the alist of previous items." (replace-match (let ((org-html-protect t)) (org-parse-format 'FONTIFY - (match-string 1 line) "target")) + (match-string 1 line) "target")) t t line))) (when (string-match (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt) @@ -2372,20 +2383,21 @@ the alist of previous items." ((string= cookie "c") "center") (t nil)))))))) (incf org-table-rownum) - (setq i -1) - (org-parse-format - 'TABLE-ROW - (mapconcat - (lambda (x) - (when (string= x "") - (setq x text-for-empty-fields)) - (incf i) - (and org-table-is-styled - (< i org-table-ncols) - (string-match org-table-number-regexp x) - (incf (aref org-table-num-numeric-items-per-column i))) - (org-parse-format 'TABLE-CELL x org-table-rownum i)) - fields "\n"))) + + (let ((i -1)) + (org-parse-format + 'TABLE-ROW + (mapconcat + (lambda (x) + (when (string= x "") + (setq x text-for-empty-fields)) + (incf i) + (and org-table-is-styled + (< i org-table-ncols) + (string-match org-table-number-regexp x) + (incf (aref org-table-num-numeric-items-per-column i))) + (org-parse-format 'TABLE-CELL x org-table-rownum i)) + fields "\n")))) ;;;_ . get callback (defun org-parse-get (what &optional opt-plist) @@ -2892,13 +2904,13 @@ When TITLE is nil, just close all open levels." (cond (org-table-current-rowgroup-is-header (org-html-format-tags - org-export-table-header-tags x "col" cell-style-cookie)) + org-export-table-header-tags text "col" cell-style-cookie)) ((and (= c 0) org-export-html-table-use-header-tags-for-first-column) (org-html-format-tags - org-export-table-header-tags x "row" cell-style-cookie)) + org-export-table-header-tags text "row" cell-style-cookie)) (t (org-html-format-tags - org-export-table-data-tags x cell-style-cookie))))) + org-export-table-data-tags text cell-style-cookie))))) ;;;_ , footnote definition -- 2.11.4.GIT