From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Check argument is a string before calling string-match Date: Mon, 19 Sep 2011 19:20:02 -0400 Message-ID: <1316474402-26292-1-git-send-email-bernt@norang.ca> References: <1316467071.59048.YahooMailNeo@web161907.mail.bf1.yahoo.com> Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5n8P-0005V7-Jv for emacs-orgmode@gnu.org; Mon, 19 Sep 2011 19:20:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5n8O-000842-6h for emacs-orgmode@gnu.org; Mon, 19 Sep 2011 19:20:21 -0400 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:54834 helo=mho-01-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5n8O-000838-4k for emacs-orgmode@gnu.org; Mon, 19 Sep 2011 19:20:20 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1R5n8G-000IQg-FQ for emacs-orgmode@gnu.org; Mon, 19 Sep 2011 23:20:12 +0000 In-Reply-To: <1316467071.59048.YahooMailNeo@web161907.mail.bf1.yahoo.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen * lisp/org-html.el (org-export-as-html): Check string-match argument (org-html-handle-time-stamps): Check string-match argument Avoid wrong-type-argument errors during exporting. --- This may or may not be the same error you are getting - but I ran into this during exporting back in August and it was sitting in my queue. Please report if this fixes your issue or not. -Bernt lisp/org-html.el | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/org-html.el b/lisp/org-html.el index fde563b..6492c2f 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1598,7 +1598,8 @@ lang=\"%s\" xml:lang=\"%s\"> (setq line (org-html-handle-links line opt-plist)) ;; TODO items - (if (and (string-match org-todo-line-regexp line) + (if (and org-todo-line-regexp + (string-match org-todo-line-regexp line) (match-beginning 2)) (setq line @@ -2213,19 +2214,20 @@ for further information." "Format time stamps in string S, or remove them." (catch 'exit (let (r b) - (while (string-match org-maybe-keyword-time-regexp s) - (or b (setq b (substring s 0 (match-beginning 0)))) - (setq r (concat - r (substring s 0 (match-beginning 0)) - " @" - (if (match-end 1) - (format "@%s @" - (match-string 1 s))) - (format " @%s@" - (substring - (org-translate-time (match-string 3 s)) 1 -1)) - "@") - s (substring s (match-end 0)))) + (when org-maybe-keyword-time-regexp + (while (string-match org-maybe-keyword-time-regexp s) + (or b (setq b (substring s 0 (match-beginning 0)))) + (setq r (concat + r (substring s 0 (match-beginning 0)) + " @" + (if (match-end 1) + (format "@%s @" + (match-string 1 s))) + (format " @%s@" + (substring + (org-translate-time (match-string 3 s)) 1 -1)) + "@") + s (substring s (match-end 0))))) ;; Line break if line started and ended with time stamp stuff (if (not r) s -- 1.7.7.rc1.3.g5593