yatex
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 diff
1.1 --- a/yahtml.el Thu Dec 09 12:23:22 2010 +0900 1.2 +++ b/yahtml.el Thu Dec 09 13:51:20 2010 +0900 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; -*- Emacs-Lisp -*- 1.5 ;;; (c) 1994-2010 by HIROSE Yuuji [yuuji(@)yatex.org] 1.6 -;;; Last modified Thu Dec 9 12:21:27 2010 on firestorm 1.7 +;;; Last modified Thu Dec 9 13:50:21 2010 on firestorm 1.8 ;;; $Id$ 1.9 1.10 (defconst yahtml-revision-number "1.74.2" 1.11 @@ -2339,7 +2339,7 @@ 1.12 Interactive prefix argument consults enclosing element other than td." 1.13 (interactive "P\nsDelimiter(s): \nr") 1.14 (let ((e (if (and e (listp e)) (read-string "Enclose with : " "td") "td")) 1.15 - p q) 1.16 + p q (ws "[ \t]")) 1.17 (if (string= delim "") (setq delim " \t\n")) 1.18 (setq delim (concat "[" delim "]+")) 1.19 (save-excursion 1.20 @@ -2353,8 +2353,9 @@ 1.21 (goto-char p) 1.22 (insert "<" e ">")) 1.23 (setq p (point)) 1.24 - (while (and (not (eobp)) (looking-at delim)) 1.25 - (delete-char 1))) 1.26 + (while (and (not (eobp)) (looking-at ws)) 1.27 + (delete-char 1)) 1.28 + (if (looking-at delim) (delete-char 1))) 1.29 (insert "<" e ">") 1.30 (goto-char (point-max)) 1.31 (insert "</" e ">"))))) 1.32 @@ -2375,6 +2376,7 @@ 1.33 (yahtml-td-region e delim (point) (point-end-of-line)) 1.34 (end-of-line) 1.35 (insert "</tr>") 1.36 + (yahtml-indent-line) 1.37 (forward-line 1)))))) 1.38 1.39 ;;; ---------- filling ----------