|
From: | David Lord |
Subject: | [emacs-wiki-discuss] emacs-wiki-table.el |
Date: | Wed, 19 Jan 2005 14:28:45 -0000 |
Hi all,
I think I have found and fixed a little bug in emacs-wiki-table.el. When I go to publish a wiki page with a fancy (i.e. generated by table.el) table on it I get the error message: -
wrong-type-argument sequencep t
Tracking down the debug output, it looks to my newbie eye like a couple of close-brackets were in the wrong place in emacs-wiki-table-markup-fancy-table. Here is my edited version: -
(defun emacs-wiki-table-markup-fancy-table ()
"Mark up tables using the `table' package."
(let ((leader (match-string 1))
(begin (copy-marker (match-beginning 0)))
table end)
(goto-char (match-end 0))
(setq table
(with-current-buffer (table-generate-source 'html)
(prog1
(buffer-string)
(kill-buffer (current-buffer)))))
(goto-char begin)
(if (re-search-backward (concat "<p>["
emacs-wiki-regexp-space
"]+") nil t)
(replace-match (if (>= (string-width leader) 6)
"<center>\n"
(if (> (length leader) 0)
"<blockquote>\n"
""))))
(delete-region begin (re-search-forward "-+\\+\\s-*[\r\n]+\\s-*$"
nil t))
(insert table)
(setq end (point-marker))
(goto-char begin)
(while (< (point) end)
(if (looking-at "^\\s-+")
(replace-match ""))
(forward-line))
(goto-char end)
(if (re-search-forward (concat "["
emacs-wiki-regexp-space
"]+</p>") nil t)
(replace-match (if (>= (string-width leader) 6)
"\n</center>"
(if (> (length leader) 0)
"\n</blockquote>"
""))))
(set-match-data (list begin begin begin begin))
nil))
Regards
--
David Lord
[Prev in Thread] | Current Thread | [Next in Thread] |