aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2014-06-26 22:21:46 +0800
committerLeo Liu2014-06-26 22:21:46 +0800
commit2454874eb232ecc968c973843294ed676a04dc2b (patch)
tree1c2a1a943da0557c4877522a62366eecda021265
parentdceff1c15aad83623d773ab6bea70be229372584 (diff)
downloademacs-2454874eb232ecc968c973843294ed676a04dc2b.tar.gz
emacs-2454874eb232ecc968c973843294ed676a04dc2b.zip
* skeleton.el (skeleton-end-hook): Default to nil and move the
work to skeleton-insert. Fixes: debbugs:17850
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/skeleton.el7
2 files changed, 7 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8ff7e5247e6..f93b1ad8793 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-06-26 Leo Liu <sdl.web@gmail.com>
2
3 * skeleton.el (skeleton-end-hook): Default to nil and move the
4 work to skeleton-insert. (Bug#17850)
5
12014-06-26 Dmitry Antipov <dmantipov@yandex.ru> 62014-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2 7
3 * calc/calc-alg.el (math-beforep): 8 * calc/calc-alg.el (math-beforep):
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.")
62 "If non-nil, make sure that the skeleton inserted ends with a newline. 62 "If non-nil, make sure that the skeleton inserted ends with a newline.
63This just influences the way the default `skeleton-end-hook' behaves.") 63This just influences the way the default `skeleton-end-hook' behaves.")
64 64
65(defvar skeleton-end-hook 65(defvar skeleton-end-hook nil
66 (lambda ()
67 (or (eolp) (not skeleton-end-newline) (newline-and-indent)))
68 "Hook called at end of skeleton but before going to point of interest. 66 "Hook called at end of skeleton but before going to point of interest.
69By default this moves out anything following to next line,
70 unless `skeleton-end-newline' is set to nil.
71The variables `v1' and `v2' are still set when calling this.") 67The variables `v1' and `v2' are still set when calling this.")
72 68
73 69
@@ -268,6 +264,7 @@ When done with skeleton, but before going back to `_'-point call
268 (mapcar #'car skeleton-further-elements) 264 (mapcar #'car skeleton-further-elements)
269 (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements) 265 (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
270 (skeleton-internal-list skeleton str)) 266 (skeleton-internal-list skeleton str))
267 (or (eolp) (not skeleton-end-newline) (newline-and-indent))
271 (run-hooks 'skeleton-end-hook) 268 (run-hooks 'skeleton-end-hook)
272 (sit-for 0) 269 (sit-for 0)
273 (or (pos-visible-in-window-p beg) 270 (or (pos-visible-in-window-p beg)