bug fix and add snippets for html-mode

This commit is contained in:
Zhang Chiyuan 2008-03-06 13:20:03 +00:00
parent 43a6cd532c
commit 81b3a98f1e
7 changed files with 22 additions and 4 deletions

3
snippets/html-mode/div Normal file
View File

@ -0,0 +1,3 @@
#name : <div...>...</div>
# --
<div$1>$0</div>

View File

@ -0,0 +1,3 @@
#name : Doctype HTML 4.01 Strict
# --
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

View File

@ -0,0 +1,3 @@
#name : DocType XHTML 1.0 frameset
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

View File

@ -0,0 +1,3 @@
#name : DocType XHTML 1.1
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

View File

@ -0,0 +1,3 @@
#name : DocType XHTML 1.0 Strict
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

View File

@ -0,0 +1,3 @@
#name : DocType XHTML 1.0 Transitional
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

View File

@ -418,6 +418,8 @@ will be deleted before inserting template."
(widen) (widen)
(delete-char length) (delete-char length)
(setq buffer-undo-list original-undo-list)
;; Step 14: place the cursor at a proper place ;; Step 14: place the cursor at a proper place
(let ((groups (yas/snippet-groups snippet)) (let ((groups (yas/snippet-groups snippet))
(exit-marker (yas/snippet-exit-marker snippet))) (exit-marker (yas/snippet-exit-marker snippet)))
@ -427,9 +429,7 @@ will be deleted before inserting template."
(yas/group-primary-field (yas/group-primary-field
(car groups))))) (car groups)))))
;; no need to call exit-snippet, since no overlay created. ;; no need to call exit-snippet, since no overlay created.
(goto-char exit-marker))) (yas/exit-snippet snippet)))))))
(setq buffer-undo-list original-undo-list)))))
(defun yas/current-snippet-overlay (&optional point) (defun yas/current-snippet-overlay (&optional point)
"Get the most proper overlay which is belongs to a snippet." "Get the most proper overlay which is belongs to a snippet."
@ -608,7 +608,7 @@ otherwise, nil returned."
(let ((templates (gethash key (yas/current-snippet-table)))) (let ((templates (gethash key (yas/current-snippet-table))))
(if templates (if templates
(let ((template (if (null (cdr templates)) ; only 1 template (let ((template (if (null (cdr templates)) ; only 1 template
(cdar templates) (yas/template-content (cdar templates))
(yas/popup-for-template templates)))) (yas/popup-for-template templates))))
(when template (when template
(yas/expand-snippet start end template))) (yas/expand-snippet start end template)))