# HG changeset patch # User yuuji@gentei.org # Date 1291870280 -32400 # Node ID 4fd09665b2be58af9a65d2ce69f620f1e0175d43 # Parent d3bcc4e2166ad4b8cf2df67c408c8285afd6d1b4 yahtml-tr-region(): Allow null field (eg. ,,) in CSV. diff -r d3bcc4e2166a -r 4fd09665b2be yahtml.el --- 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 ""))))) @@ -2375,6 +2376,7 @@ (yahtml-td-region e delim (point) (point-end-of-line)) (end-of-line) (insert "") + (yahtml-indent-line) (forward-line 1)))))) ;;; ---------- filling ----------