diff --git a/yahtml.el b/yahtml.el index 9419a38..0d01c39 100644 --- a/yahtml.el +++ b/yahtml.el @@ -1,6 +1,6 @@ ;;; -*- Emacs-Lisp -*- ;;; (c) 1994-2010 by HIROSE Yuuji [yuuji(@)yatex.org] -;;; Last modified Thu Dec 9 13:50:21 2010 on firestorm +;;; Last modified Thu Dec 9 14:40:52 2010 on firestorm ;;; $Id$ (defconst yahtml-revision-number "1.74.2" @@ -2338,7 +2338,10 @@ "Enclose each item in a region with ... 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")) + (let ((e (cond + ((null e) "td") + ((stringp e) e) + (t (read-string "Enclose with: " "td")))) p q (ws "[ \t]")) (if (string= delim "") (setq delim " \t\n")) (setq delim (concat "[" delim "]+")) @@ -2363,21 +2366,18 @@ (defun yahtml-tr-region (e delim beg end) "Enclose lines in a form tab-sv/csv with ..." (interactive "P\nsDelimiter(s): \nr") - (let ((e (if (and e (listp e)) (read-string "Enclose with : " "td") "td")) - p q) - (if (string= delim "") (setq delim " \t\n")) - ;; (setq delim (concat "[" delim "]+")) ;unnecessary here - (save-excursion - (save-restriction - (narrow-to-region (point) (mark)) - (goto-char (point-min)) - (while (not (eobp)) - (insert "") - (yahtml-td-region e delim (point) (point-end-of-line)) - (end-of-line) - (insert "") - (yahtml-indent-line) - (forward-line 1)))))) + (setq e (if (and e (listp e)) (read-string "Enclose with: " "th"))) + (save-excursion + (save-restriction + (narrow-to-region (point) (mark)) + (goto-char (point-min)) + (while (not (eobp)) + (insert "") + (yahtml-td-region e delim (point) (point-end-of-line)) + (end-of-line) + (insert "") + (yahtml-indent-line) + (forward-line 1))))) ;;; ---------- filling ---------- (defvar yahtml-saved-move-to-column (symbol-function 'move-to-column))