]> code.delx.au - gnu-emacs/blobdiff - lisp/skeleton.el
(hs-set-up-overlay): New user var.
[gnu-emacs] / lisp / skeleton.el
index 9c018ac7b25742c3c333f7f78aaa16fb8b1d988b..e843ef9f02d801d16991d2a9444d0c51415fdcb0 100644 (file)
@@ -112,11 +112,16 @@ are integer buffer positions in the reverse order of the insertion order.")
 (defvar skeleton-point)
 (defvar skeleton-regions)
 
+(def-edebug-spec skeleton-edebug-spec
+  ([&or null stringp (stringp &rest stringp) [[&not atom] def-form]]
+   &rest &or "n" "_" "-" ">" "@" "&" "!" "resume:"
+   ("quote" def-form) skeleton-edebug-spec def-form))
 ;;;###autoload
 (defmacro define-skeleton (command documentation &rest skeleton)
   "Define a user-configurable COMMAND that enters a statement skeleton.
 DOCUMENTATION is that of the command.
 SKELETON is as defined under `skeleton-insert'."
+  (declare (debug (&define name stringp skeleton-edebug-spec)))
   (if skeleton-debug
       (set command skeleton))
   `(progn
@@ -159,7 +164,12 @@ of `str' whereas the skeleton's interactor is then ignored."
                     (and skeleton-autowrap
                          (or (eq last-command 'mouse-drag-region)
                              (and transient-mark-mode mark-active))
-                         -1))
+                         ;; Deactivate the mark, in case one of the
+                         ;; elements of the skeleton is sensitive
+                         ;; to such situations (e.g. it is itself a
+                         ;; skeleton).
+                         (progn (deactivate-mark)
+                                -1)))
                   (if (stringp str)
                       str))
   ;; Return non-nil to tell expand-abbrev that expansion has happened.
@@ -551,4 +561,5 @@ symmetrical ones, and the same character twice for the others."
 
 (provide 'skeleton)
 
+;;; arch-tag: ccad7bd5-eb5d-40de-9ded-900197215c3e
 ;;; skeleton.el ends here