emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] emacs-wiki-table.el


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

This email and its attachments are confidential under applicable law and are intended for use of the sender's addressee only, unless the sender expressly agrees otherwise, or unless a separate written agreement exists between Iron Mountain and a recipient company governing communications between the parties and any data that may be so transmitted. Transmission of email over the Internet is not a secure communications medium. If you are requesting or have requested the transmittal of personal data, as defined in applicable privacy laws, by means of email or in an attachment to email, you may wish to select a more secure alternate means of transmittal that better supports your obligations to protect such personal data.

If the recipient of this message is not the recipient named above, and/or you have received this email in error, you must take no action based on the information in this email. You are hereby notified that any dissemination, misuse or copying or disclosure of this communication by a recipient who has received this message in error is strictly prohibited. If this message is received in error, please return this email to the sender and immediately highlight any error in transmittal. Thank you.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]