changeset 155:4fd09665b2be dev

yahtml-tr-region(): Allow null field (eg. ,,) in CSV.
author yuuji@gentei.org
date Thu, 09 Dec 2010 13:51:20 +0900
parents d3bcc4e2166a
children 9b5c19e860d8
files yahtml.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/yahtml.el	Thu Dec 09 12:23:22 2010 +0900
+++ b/yahtml.el	Thu Dec 09 13:51:20 2010 +0900
@@ -1,6 +1,6 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; (c) 1994-2010 by HIROSE Yuuji [yuuji(@)yatex.org]
-;;; Last modified Thu Dec  9 12:21:27 2010 on firestorm
+;;; Last modified Thu Dec  9 13:50:21 2010 on firestorm
 ;;; $Id$
 
 (defconst yahtml-revision-number "1.74.2"
@@ -2339,7 +2339,7 @@
 Interactive prefix argument consults enclosing element other than td."
   (interactive "P\nsDelimiter(s): \nr")
   (let ((e (if (and e (listp e)) (read-string "Enclose with : " "td") "td"))
-	p q)
+	p q (ws "[ \t]"))
     (if (string= delim "") (setq delim " \t\n"))
     (setq delim (concat "[" delim "]+"))
     (save-excursion
@@ -2353,8 +2353,9 @@
 	    (goto-char p)
 	    (insert "<" e ">"))
 	  (setq p (point))
-	  (while (and (not (eobp)) (looking-at delim))
-	    (delete-char 1)))
+	  (while (and (not (eobp)) (looking-at ws))
+	    (delete-char 1))
+	  (if (looking-at delim) (delete-char 1)))
 	(insert "<" e ">")
 	(goto-char (point-max))
 	(insert "</" e ">")))))
@@ -2375,6 +2376,7 @@
 	  (yahtml-td-region e delim (point) (point-end-of-line))
 	  (end-of-line)
 	  (insert "</tr>")
+	  (yahtml-indent-line)
 	  (forward-line 1))))))
 	
 ;;; ---------- filling ----------

yatex.org