Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419
[bpt/emacs.git] / lisp / expand.el
index 531174f..2e27672 100644 (file)
@@ -1,4 +1,4 @@
-;;; expand.el --- make abbreviations more usable.
+;;; expand.el --- make abbreviations more usable
 
 ;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 
@@ -47,7 +47,7 @@
 ;;     ("default" "default:\n\nbreak;" 10)
 ;;     ("main" "int\nmain(int argc, char * argv[])\n{\n\n}\n" 37))
 ;;   "Expansions for C mode")
-;; 
+;;
 ;;   and enter Abbrev mode with the following hook :
 ;;
 ;; (add-hook 'c-mode-hook (function (lambda ()
   "Loop var: "
   "for(" str _ @ "=0; " str @ "; " str @ ") {" \n
   @ _ \n
-  "}" >
-  )
+  "}" > \n)
 
 (defconst expand-c-sample-expand-list
   '(("if" "if () {\n \n} else {\n \n}" (5 10 21))
     (concat
      "(defmacro  ()\n"
      "  \"\"\n"
-     "  (` \n"
+     "  `( \n"
      "    ))")
     (list 11 13 18 25))
 
 
     )
    "Expansions for Lisp mode. See `expand-add-abbrevs'.")
+
 ;; perl example from Jari Aalto <jaalto@tre.tele.nokia.fi>
 (defconst expand-sample-perl-mode-expand-list
   (list
@@ -338,7 +337,7 @@ This variable is local to a buffer.")
 (put 'expand-abbrev-hook 'no-self-insert t)
 (defun expand-abbrev-hook ()
   "Abbrev hook used to do the expansion job of expand abbrevs.
-See `expand-add-abbrevs'."
+See `expand-add-abbrevs'.  Value is non-nil if expansion was done."
   ;; Expand only at the end of a line if we are near a word that has
   ;; an abbrev built from expand-add-abbrev.
   (if (and (eolp)
@@ -364,8 +363,9 @@ See `expand-add-abbrevs'."
                          expand-pos (expand-list-to-markers expand-list)
                          expand-list nil)))
              (run-hooks 'expand-expand-hook)
-             t))))
-  )
+             t)
+         nil))
+    nil))
 
 (defun expand-do-expansion ()
   (delete-backward-char (length last-abbrev-text))
@@ -496,7 +496,7 @@ This is used only in conjunction with `expand-add-abbrevs'."
 (defun expand-skeleton-end-hook ()
   (if skeleton-positions
       (setq expand-list skeleton-positions)))
-  
+
 (add-hook 'skeleton-end-hook (function expand-skeleton-end-hook))
 
 (provide 'expand)
@@ -504,4 +504,5 @@ This is used only in conjunction with `expand-add-abbrevs'."
 ;; run load hooks
 (run-hooks 'expand-load-hook)
 
+;;; arch-tag: fee53e9e-30e3-4ef3-b191-9785e1f8e885
 ;;; expand.el ends here