 
          ) ;cond
 
+        (when content
+          (delete-region beg end)
+          (deactivate-mark)
+          (let (beg end)
+            (setq beg (point-at-bol))
+            (insert content)
+            (setq end (point-at-eol))
+            (indent-region beg end)
+            )
+          ) ;when
+
         ) ;t
        ) ;cond
 
-      ;;(web-mode-with-silent-modifications
-      (delete-region beg end)
-      (deactivate-mark)
-      ;;)
-      ;;(web-mode-insert-and-indent content)
-      (let (beg end)
-        (setq beg (point-at-bol))
-        (insert content)
-        (setq end (point-at-eol))
-        (indent-region beg end)
-        )
-
-      ;;(when content (web-mode-insert-and-indent content))
-
       (when pos-after (goto-char pos-after))
 
-      ;;      (message "END")
-
       ))
+
+(defun web-mode-comment-ejs-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "//" (+ beg 2))))
+
+(defun web-mode-comment-erb-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "#" (+ beg 2))))
+
+(defun web-mode-comment-django-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "#" end)
+    (web-mode-insert-text-at-pos "#" (1+ beg))))
+
+(defun web-mode-comment-dust-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "!" end)
+    (web-mode-insert-text-at-pos "!" (1+ beg))))
+
+(defun web-mode-comment-aspx-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "#" end)
+    (web-mode-insert-text-at-pos "#" (1+ beg))))
+
+(defun web-mode-comment-jsp-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "--" (+ beg 2))))
+
+(defun web-mode-comment-go-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "/" (+ beg 2))))
+
+(defun web-mode-comment-php-block (pos)
+  (let (beg end)
+    (setq beg (web-mode-block-beginning-position pos)
+          end (web-mode-block-end-position pos))
+    (web-mode-insert-text-at-pos "*/" (- end 1))
+    (web-mode-insert-text-at-pos "/*" (+ beg (if (web-mode-looking-at "<\\?php" beg) 5 3)))))
 
 (defun web-mode-comment-boundaries (&optional pos)
   (interactive)

      (when (null go-back)
        (forward-char))

      (when (> (setq counter (1+ counter)) 3200)
        (message "attr-skip ** too much attr ** pos-ori(%S) limit(%S)" pos-ori limit)
        (setq continue nil))

      ) ;while

    (when (> attrs 0)
      (setq tag-flags (logior tag-flags 1)))

    tag-flags))


        nil)
      )))

(defun web-mode-markup-indentation-origin (pos)
  (save-excursion
    (let* ((continue (not (bobp)))
           ;;         (pos (point))
           (part-side (not (null (get-text-property pos 'part-side)))) ;part-side at the origin
           (types '(start end void)))
      (while continue
        (forward-line -1)
        (if (bobp)
            (setq pos (point)
                  continue nil)
          (back-to-indentation)
          (setq pos (point))
          (setq continue (not (or (and (null part-side)
                                       (null (get-text-property pos 'part-side))
                                       (get-text-property pos 'tag-beg)
                                       (member (get-text-property pos 'tag-type) types)
                                       (null (get-text-property (1- pos) 'invisible)))
                                  (and part-side
                                       (get-text-property pos 'part-side)
                                       (get-text-property pos 'tag-beg)
                                       (member (get-text-property pos 'tag-type) types)
                                       (null (get-text-property (1- pos) 'invisible)))
                                  (and (get-text-property pos 'block-beg)
                                       (not (get-text-property pos 'tag-type))
                                       (web-mode-block-is-control pos)
                                       (not (looking-at-p "{% comment"))))))
          ) ;if
        ) ;while
      ;;(message "indent-origin=%S" pos)
      pos)))

;;TODO : prendre en compte part-token
;; state=t <=> start tag
