From b46d6c1c95e560bf21bd30758de80cc08b1992dd Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Sun, 6 Sep 2009 17:31:50 +0000 Subject: Rearrange for scoping --- lib/holes.el | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/holes.el b/lib/holes.el index f664a20d..3a2ca044 100644 --- a/lib/holes.el +++ b/lib/holes.el @@ -629,28 +629,6 @@ created. Return the number of holes created." "\\[holes-set-point-next-hole-destroy] to jump to active hole. \\[holes-short-doc] to see holes doc.")))))) -;;;###autoload -(defun holes-abbrev-complete () - "Complete abbrev by putting holes and indenting. -Moves point at beginning of expanded text. Put this function as -call-back for your abbrevs, and just expanded \"#\" and \"@{..}\" will -become holes." - (if holes-mode - (holes-replace-string-by-holes-backward-jump last-abbrev-location))) - - -;;;###autoload -(defun holes-insert-and-expand (s) - "Insert S, expand it and replace #s and @{]s by holes." - ;; insert the expansion of abbrev s, and replace #s by holes. It was - ;; possible to implement it with a simple ((insert s) (expand-abbrev)) - ;; but undo would show the 2 steps, which is bad. - (let ((pos (point)) - (ins (abbrev-expansion s))) - (insert (or ins s)) - (setq last-abbrev-location pos) - (holes-abbrev-complete))) - ;;;###autoload (define-minor-mode holes-mode "Toggle Holes minor mode. @@ -746,6 +724,28 @@ undoing on holes cannot make holes re-appear." (remove-hook 'skeleton-end-hook 'holes-skeleton-end-hook t) (holes-clear-all-buffer-holes))) +;;;###autoload +(defun holes-abbrev-complete () + "Complete abbrev by putting holes and indenting. +Moves point at beginning of expanded text. Put this function as +call-back for your abbrevs, and just expanded \"#\" and \"@{..}\" will +become holes." + (if holes-mode + (holes-replace-string-by-holes-backward-jump last-abbrev-location))) + + +;;;###autoload +(defun holes-insert-and-expand (s) + "Insert S, expand it and replace #s and @{]s by holes." + ;; insert the expansion of abbrev s, and replace #s by holes. It was + ;; possible to implement it with a simple ((insert s) (expand-abbrev)) + ;; but undo would show the 2 steps, which is bad. + (let ((pos (point)) + (ins (abbrev-expansion s))) + (insert (or ins s)) + (setq last-abbrev-location pos) + (holes-abbrev-complete))) + (provide 'holes) ;;; holes.el ends here -- cgit v1.2.3