summaryrefslogtreecommitdiff
path: root/lisp/skeleton.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2014-06-26 22:21:46 +0800
committerLeo Liu <sdl.web@gmail.com>2014-06-26 22:21:46 +0800
commit2454874eb232ecc968c973843294ed676a04dc2b (patch)
tree1c2a1a943da0557c4877522a62366eecda021265 /lisp/skeleton.el
parentdceff1c15aad83623d773ab6bea70be229372584 (diff)
downloademacs-2454874eb232ecc968c973843294ed676a04dc2b.tar.gz
* skeleton.el (skeleton-end-hook): Default to nil and move the
work to skeleton-insert. Fixes: debbugs:17850
Diffstat (limited to 'lisp/skeleton.el')
-rw-r--r--lisp/skeleton.el7
1 files changed, 2 insertions, 5 deletions
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index bb019db502c..1c6128a33a5 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -62,12 +62,8 @@ region.")
"If non-nil, make sure that the skeleton inserted ends with a newline.
This just influences the way the default `skeleton-end-hook' behaves.")
-(defvar skeleton-end-hook
- (lambda ()
- (or (eolp) (not skeleton-end-newline) (newline-and-indent)))
+(defvar skeleton-end-hook nil
"Hook called at end of skeleton but before going to point of interest.
-By default this moves out anything following to next line,
- unless `skeleton-end-newline' is set to nil.
The variables `v1' and `v2' are still set when calling this.")
@@ -268,6 +264,7 @@ When done with skeleton, but before going back to `_'-point call
(mapcar #'car skeleton-further-elements)
(mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
(skeleton-internal-list skeleton str))
+ (or (eolp) (not skeleton-end-newline) (newline-and-indent))
(run-hooks 'skeleton-end-hook)
(sit-for 0)
(or (pos-visible-in-window-p beg)